theme: guard access to page.File.Filename #1005
Some checks failed
docs-build-deployment / Run deploy (push) Has been cancelled
docs-build / Run build (push) Has been cancelled

This commit is contained in:
Sören Weber 2025-01-31 14:57:10 +01:00
parent c0f6af2b42
commit 8b70bdf31a
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
27 changed files with 76 additions and 42 deletions

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'piratify' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $content := .content }}
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}

View file

@ -1,4 +1,4 @@
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
{{- if and .File .File.Filename -}}
{{ readFile .File.Filename | safeHTML }}
{{- with and .File .File.Filename -}}
{{ readFile . | safeHTML }}
{{- end }}

View file

@ -4,12 +4,13 @@
{{- $enable := printf "%s" (lower .name) }}
{{- $wantsPage := false }}
{{- $filepath := "[virtual file]" }}{{ with and $.File $.File.Filename }}{{ $filepath = . }}{{ end }}
{{- if ne (index $.Params $disable) nil }}
{{- $wantsPage = not (index $.Params $disable) }}
{{- warnf "%q: DEPRECATED front matter 'disable%s' found, use '%s' or '%s.force' instead and invert the value; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0" $.File.Filename .name (lower .name) (lower .name) }}
{{- warnf "%q: DEPRECATED front matter 'disable%s' found, use '%s' or '%s.force' instead and invert the value; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0" $filepath .name (lower .name) (lower .name) }}
{{- else if and (eq .name "Math") (ne (index $.Params "disableMathJax") nil) }}
{{- $wantsPage = not (index $.Params "disableMathJax") }}
{{- warnf "%q: DEPRECATED front matter 'disableMathJax' found, use 'math' or 'math.force' instead and invert the value; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0" $.File.Filename }}
{{- warnf "%q: DEPRECATED front matter 'disableMathJax' found, use 'math' or 'math.force' instead and invert the value; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0" $filepath }}
{{- end }}
{{- with index $.Params $enable }}
{{- $wantsPage = or

View file

@ -25,7 +25,8 @@
{{- else if eq $by "default" }}
{{- $pages = $page.Pages }}
{{- else }}
{{- warnf "%q: Unknown pages sort order '%s'" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: Unknown pages sort order '%s'" $filepath }}
{{- $pages = $page.Pages }}
{{- end }}

View file

@ -1,11 +1,12 @@
{{- $url := "" }}
{{- with .menu }}
{{- $filepath := "[virtual file]" }}{{ with and $.page $.page.File $.page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $errorlevel := or $.page.Params.link.errorlevel $.page.Site.Params.link.errorlevel }}
{{- if .PageRef }}
{{- with .Page }}
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
{{- else }}
{{- $msg := printf "%q: config menu link '%s' is not a page" $.page.File.Filename .PageRef }}
{{- $msg := printf "%q: config menu link '%s' is not a page" $filepath .PageRef }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .PageRef "page" $.page "param" "link" "msg" $msg) }}
{{- end }}
{{- else }}
@ -15,7 +16,7 @@
{{- if $u.IsAbs }}
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" $.page "type" "menu link") $u.String }}
{{- else }}
{{- $msg := printf "%q: config menu link '%s' given by 'URL' is not verified; if it is a page use 'PageRef' instead" $.page.File.Filename . }}
{{- $msg := printf "%q: config menu link '%s' given by 'URL' is not verified; if it is a page use 'PageRef' instead" $filepath . }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" . "page" $.page "param" "link" "msg" $msg) }}
{{- end }}
{{- end }}

View file

@ -15,12 +15,13 @@
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
{{- end }}
{{- $url := "" }}
{{- $filepath := "[virtual file]" }}{{ with and .File .File.Filename }}{{ $filepath = . }}{{ end }}
{{- $errorlevel := or .Params.link.errorlevel .Site.Params.link.errorlevel }}
{{- if .Params.menuPageRef }}
{{- with site.Home.GetPage (.Params.menuPageRef) }}
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
{{- else }}
{{- $msg := printf "%q: front matter crosslink '%s' is not a page" .File.Filename .Params.menuPageRef }}
{{- $msg := printf "%q: front matter crosslink '%s' is not a page" $filepath .Params.menuPageRef }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .Params.menuPageRef "page" . "param" "link" "msg" $msg) }}
{{- end }}
{{- else if .Params.menuUrl }}
@ -29,7 +30,7 @@
{{- if $u.IsAbs }}
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" . "type" "menu link") $u.String }}
{{- else }}
{{- $msg := printf "%q: front matter crosslink '%s' given by 'menuURL' is not verified; if it is a page use 'menuPageRef' instead" .File.Filename .Params.menuUrl }}
{{- $msg := printf "%q: front matter crosslink '%s' given by 'menuURL' is not verified; if it is a page use 'menuPageRef' instead" $filepath .Params.menuUrl }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .Params.menuUrl "page" . "param" "link" "msg" $msg) }}
{{- end }}
{{- end }}

View file

@ -1,9 +1,11 @@
{{- $page := .page }}
{{- warnf "%q: DEPRECATED shortcode `attachments` found, use `resources` instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments#migration" $page.File.Filename }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'attachments' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'attachments' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED shortcode `attachments` found, use `resources` instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/attachments#migration" $filepath }}
{{- $color := .color | default "" }}
{{- $style := .style | default "default" }}
{{- if and (not $color) (eq (len $color) 0) }}
@ -26,7 +28,7 @@
{{- $urlPrefix := strings.TrimRight "/" $page.RelPermalink }}
{{- with $page }}
{{- if ne .BundleType "leaf" }}
{{- 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 }}
{{- 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" $filepath }}
{{- 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>

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'badge' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $color := .color | default "" }}
{{- $content := .content }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'button' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'button' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $color := .color | default "" }}
{{- $content := .content }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'children' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'children' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $showhidden := .showhidden | default false }}
{{- if eq (printf "%T" $showhidden) "string" }}

View file

@ -1,13 +1,15 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'expand' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'expand' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $title := .title | default (T "Expand-title") }}
{{- $title = trim $title " " }}
{{- $expanded := .expanded | default false }}
{{- if and (isset . "open") (or (ne (printf "%T" .open) "string") (ne (trim .open " " ) "")) }}
{{- warnf "%q: DEPRECATED parameter 'open' for shortcode 'expand' found, use 'expanded' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-3-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'open' for shortcode 'expand' found, use 'expanded' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-3-0" $filepath }}
{{- $expanded = .open }}
{{- end }}
{{- if eq (printf "%T" $expanded) "string" }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'highlight' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'highlight' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $attributes := dict }}
{{- $otherAttributes := dict }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'icon' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $icon := .icon | default "" }}
{{- $icon = trim $icon " " }}

View file

@ -2,7 +2,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'image' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'image' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $title := .title }}
{{- $alt := .alt }}
@ -34,7 +35,8 @@
{{- $src = printf "%s#%s" $src . }}
{{- end }}
{{- else }}
{{- $msg := printf "%q: image '%s' is not a resource" $page.File.Filename .url }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $msg := printf "%q: image '%s' is not a resource" $filepath .url }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .url "page" $page "param" "image" "msg" $msg) }}
{{- end }}
{{- end }}
@ -52,7 +54,8 @@
{{- end }}
{{- end }}
{{- if $u.Query.Has "featherlight" }}
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-11-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED usage of 'featherlight' image CSS class found, use 'lightbox' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-11-0" $filepath }}
{{- $effects = merge $effects (dict "lightbox" (ne ($u.Query.Get "featherlight") "false")) }}
{{- end }}
{{- range $k, $v := $effects }}

View file

@ -2,10 +2,12 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'link' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'link' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- if strings.HasPrefix .url "HAHAHUGOSHORTCODE" }}
{{- warnf "%q: WARNING you must call the ref / relref shortcode with '%% %%' instead of '< >' to work correctly for the anchor target attribute" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: WARNING you must call the ref / relref shortcode with '%% %%' instead of '< >' to work correctly for the anchor target attribute" $filepath }}
{{- end }}
{{- $attributes := dict }}
{{- $title := .title | default "" }}
@ -61,6 +63,7 @@
{{- else }}
{{- $linkPage = $page.Page }}
{{- end }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $errorlevel := or $page.Params.link.errorlevel $page.Site.Params.link.errorlevel }}
{{- with $linkPage }}
{{- $href = partial "permalink.gotmpl" (dict "to" .) }}
@ -69,7 +72,7 @@
{{- end }}
{{- with $u.Fragment }}
{{- $ctx := dict
"contentPath" $page.File.Filename
"contentPath" $filepath
"errorLevel" $errorlevel
"page" $linkPage
"parsedURL" $u
@ -79,7 +82,7 @@
{{- $href = printf "%s#%s" $href . }}
{{- end }}
{{- else }}
{{- $msg := printf "%q: link '%s' is not a page or a resource" $page.File.Filename .url }}
{{- $msg := printf "%q: link '%s' is not a page or a resource" $filepath .url }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .url "page" $page "param" "link" "msg" $msg) }}
{{- end }}
{{- end }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'math' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'math' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $content := .content }}
{{- $align := .align | default "center" }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'mermaid' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'mermaid' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $content := .content }}
{{- $align := .align | default "center" }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $class := .class | default "notices" }}
{{- $containerstyle := .containerstyle | default "div" }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'openapi' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'openapi' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $u := urls.Parse .src }}
{{- $src := $u.String }}
@ -18,7 +19,8 @@
{{- $src = "" }}
{{- $spec = .Content }}
{{- else }}
{{- $msg := printf "%q: OpenAPI spec '%s' is not a resource" $page.File.Filename .src }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- $msg := printf "%q: OpenAPI spec '%s' is not a resource" $filepath .src }}
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .src "page" $page "param" "openapi" "msg" $msg) }}
{{- end }}
{{- end }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'resources' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'resources' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $color := .color | default "" }}
{{- $style := .style | default "default" }}
@ -23,7 +24,8 @@
{{- $sort := .sort | default "asc" }}
{{- $pattern := .pattern | default "" }}
{{- if eq $page.BundleType "" }}
{{- warnf "%q: UNSUPPORTED usage of 'resources' shortcode found, use a page bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/resources" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: UNSUPPORTED usage of 'resources' shortcode found, use a page bundle instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/resources" $filepath }}
{{- end }}
{{- $content := partial "inline/resource-list" (dict
"page" $page

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'siteparam' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'siteparam' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $paramNames := split .name "." }}
{{- with $page }}

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tab' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tab' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $tabs := (slice | append (dict
"color" .color

View file

@ -1,7 +1,8 @@
{{- $page := .page }}
{{- if and (not $page) .context }}
{{- $page = .context }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tabs' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'tabs' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-18-0" $filepath }}
{{- end }}
{{- $groupid := .groupid | default (partial "_relearn/makeRandomMd5.gotmpl" $page) | plainify | anchorize }}
{{- $color := .color }}
@ -11,7 +12,8 @@
{{- $tabs := slice }}
{{- range $tab := (.content | default slice) }}
{{- if and (not $tab.title) $tab.name }}
{{- warnf "%q: DEPRECATED parameter 'name' for shortcode 'tab' found, use 'title' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-16-0" $page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and $page $page.File $page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'name' for shortcode 'tab' found, use 'title' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/5/#5-16-0" $filepath }}
{{- $tab = merge $tab (dict "title" .name) }}
{{- end }}
{{- with $tab }}

View file

@ -1 +1 @@
7.3.2+db9ca5d2958a7e5956d4f37f6d79e8d2076b8381
7.3.2+c0f6af2b423bb063ce6339883fb1e6e31b8df866

View file

@ -1,6 +1,7 @@
{{- $_hugo_config := `{ "version": 1 }` }}
{{- if (.Get "icon-position") }}
{{- warnf "%q: DEPRECATED parameter 'icon-position' for shortcode 'button' found, use 'iconposition' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/button#parameter" .Page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and .Page .Page.File .Page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'icon-position' for shortcode 'button' found, use 'iconposition' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/button#parameter" $filepath }}
{{- end }}
{{- partial "shortcodes/button.html" (dict
"page" .Page

View file

@ -1,5 +1,6 @@
{{- if (.Get "showfirstheading") }}
{{- warnf "%q: UNSUPPORTED parameter 'showfirstheading' for shortcode 'include' found, use 'hidefirstheading' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/4/#4-2-0" .Page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and .Page .Page.File .Page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: UNSUPPORTED parameter 'showfirstheading' for shortcode 'include' found, use 'hidefirstheading' instead; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/4/#4-2-0" $filepath }}
{{- end }}
{{- partial "shortcodes/include.html" (dict
"page" .Page

View file

@ -2,7 +2,8 @@
{{- $color := (.Get "color") }}
{{- $groupid := ((.Get "groupid") | default (.Get "groupId")) }}
{{- if (.Get "groupId") }}
{{- warnf "%q: DEPRECATED parameter 'groupId' for shortcode 'tabs' found, use 'groupid' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs#parameter" .Page.File.Filename }}
{{- $filepath := "[virtual file]" }}{{ with and .Page .Page.File .Page.File.Filename }}{{ $filepath = . }}{{ end }}
{{- warnf "%q: DEPRECATED parameter 'groupId' for shortcode 'tabs' found, use 'groupid' instead; see https://mcshelby.github.io/hugo-theme-relearn/shortcodes/tabs#parameter" $filepath }}
{{- end }}
{{- $icon := (.Get "icon") }}
{{- $style := (.Get "style") }}