mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
attachments: remove warnings for unsupported Hugo versions #825
This commit is contained in:
parent
7c9f145e93
commit
43e9a8c376
1 changed files with 2 additions and 13 deletions
|
@ -41,23 +41,12 @@
|
|||
{{- $urlPrefix := strings.TrimRight "/" $page.RelPermalink }}
|
||||
{{- with $page }}
|
||||
{{- if ne .BundleType "leaf" }}
|
||||
{{- $hugoVersion := "0.112.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- warnf "%q: UNSUPPORTED usage of 'attachments' shortcode found while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
{{- else }}
|
||||
{{- warnf "%q: DEPRECATED usage of 'attachments' shortcode found which will not be compatible while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- warnf "%q: UNSUPPORTED usage of 'attachments' shortcode found while using Hugo >= 0.112.0, use a leaf bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments/index.html#single-language" $page.File.Filename }}
|
||||
{{- end }}
|
||||
<div class="box attachments cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
|
||||
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||
<ul class="box-content attachments-files">
|
||||
{{- $fileDir := "" }}
|
||||
{{- $hugoVersion := "0.112.0" }}
|
||||
{{- if ge hugo.Version $hugoVersion }}
|
||||
{{- $fileDir = path.Dir (strings.TrimPrefix (path.Clean hugo.WorkingDir) (path.Clean .File.Filename)) }}
|
||||
{{- else }}
|
||||
{{- $fileDir = printf "%s/%s" (path.Clean (.Language.ContentDir | default "content")) (path.Clean .File.Dir) }}
|
||||
{{- end }}
|
||||
{{- $fileDir := path.Dir (strings.TrimPrefix (path.Clean hugo.WorkingDir) (path.Clean .File.Filename)) }}
|
||||
{{- $fileDir = printf "%s/" (path.Clean (strings.TrimPrefix "/" $fileDir)) }}
|
||||
{{- $fileLink := $fileDir }}
|
||||
{{- $fileLink = strings.TrimPrefix "content/" $fileLink }}
|
||||
|
|
Loading…
Reference in a new issue