mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-03-03 16:00:13 +00:00
theme: guard access to page.File.Filename #1005
This commit is contained in:
parent
c0f6af2b42
commit
8b70bdf31a
27 changed files with 76 additions and 42 deletions
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}
|
{{- $pagefield := cond (ne $content nil) nil (.pagefield | default "Content") }}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
|
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
|
||||||
{{- if and .File .File.Filename -}}
|
{{- with and .File .File.Filename -}}
|
||||||
{{ readFile .File.Filename | safeHTML }}
|
{{ readFile . | safeHTML }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -4,12 +4,13 @@
|
||||||
{{- $enable := printf "%s" (lower .name) }}
|
{{- $enable := printf "%s" (lower .name) }}
|
||||||
|
|
||||||
{{- $wantsPage := false }}
|
{{- $wantsPage := false }}
|
||||||
|
{{- $filepath := "[virtual file]" }}{{ with and $.File $.File.Filename }}{{ $filepath = . }}{{ end }}
|
||||||
{{- if ne (index $.Params $disable) nil }}
|
{{- if ne (index $.Params $disable) nil }}
|
||||||
{{- $wantsPage = not (index $.Params $disable) }}
|
{{- $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) }}
|
{{- else if and (eq .name "Math") (ne (index $.Params "disableMathJax") nil) }}
|
||||||
{{- $wantsPage = not (index $.Params "disableMathJax") }}
|
{{- $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 }}
|
{{- end }}
|
||||||
{{- with index $.Params $enable }}
|
{{- with index $.Params $enable }}
|
||||||
{{- $wantsPage = or
|
{{- $wantsPage = or
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
{{- else if eq $by "default" }}
|
{{- else if eq $by "default" }}
|
||||||
{{- $pages = $page.Pages }}
|
{{- $pages = $page.Pages }}
|
||||||
{{- else }}
|
{{- 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 }}
|
{{- $pages = $page.Pages }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
{{- $url := "" }}
|
{{- $url := "" }}
|
||||||
{{- with .menu }}
|
{{- 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 }}
|
{{- $errorlevel := or $.page.Params.link.errorlevel $.page.Site.Params.link.errorlevel }}
|
||||||
{{- if .PageRef }}
|
{{- if .PageRef }}
|
||||||
{{- with .Page }}
|
{{- with .Page }}
|
||||||
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
|
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .PageRef "page" $.page "param" "link" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
|
@ -15,7 +16,7 @@
|
||||||
{{- if $u.IsAbs }}
|
{{- if $u.IsAbs }}
|
||||||
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" $.page "type" "menu link") $u.String }}
|
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" $.page "type" "menu link") $u.String }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" . "page" $.page "param" "link" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -15,12 +15,13 @@
|
||||||
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
<meta name="robots" content="noindex, nofollow, noarchive, noimageindex">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $url := "" }}
|
{{- $url := "" }}
|
||||||
|
{{- $filepath := "[virtual file]" }}{{ with and .File .File.Filename }}{{ $filepath = . }}{{ end }}
|
||||||
{{- $errorlevel := or .Params.link.errorlevel .Site.Params.link.errorlevel }}
|
{{- $errorlevel := or .Params.link.errorlevel .Site.Params.link.errorlevel }}
|
||||||
{{- if .Params.menuPageRef }}
|
{{- if .Params.menuPageRef }}
|
||||||
{{- with site.Home.GetPage (.Params.menuPageRef) }}
|
{{- with site.Home.GetPage (.Params.menuPageRef) }}
|
||||||
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
|
{{- $url = partial "permalink.gotmpl" (dict "to" .) }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .Params.menuPageRef "page" . "param" "link" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if .Params.menuUrl }}
|
{{- else if .Params.menuUrl }}
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
{{- if $u.IsAbs }}
|
{{- if $u.IsAbs }}
|
||||||
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" . "type" "menu link") $u.String }}
|
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" $url "page" . "type" "menu link") $u.String }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .Params.menuUrl "page" . "param" "link" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{{- $page := .page }}
|
{{- $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 }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- 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 "" }}
|
{{- $color := .color | default "" }}
|
||||||
{{- $style := .style | default "default" }}
|
{{- $style := .style | default "default" }}
|
||||||
{{- if and (not $color) (eq (len $color) 0) }}
|
{{- if and (not $color) (eq (len $color) 0) }}
|
||||||
|
@ -26,7 +28,7 @@
|
||||||
{{- $urlPrefix := strings.TrimRight "/" $page.RelPermalink }}
|
{{- $urlPrefix := strings.TrimRight "/" $page.RelPermalink }}
|
||||||
{{- with $page }}
|
{{- with $page }}
|
||||||
{{- if ne .BundleType "leaf" }}
|
{{- 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 -}}
|
{{- end -}}
|
||||||
<div class="box attachments cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ 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>
|
<div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $color := .color | default "" }}
|
{{- $color := .color | default "" }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $color := .color | default "" }}
|
{{- $color := .color | default "" }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $showhidden := .showhidden | default false }}
|
{{- $showhidden := .showhidden | default false }}
|
||||||
{{- if eq (printf "%T" $showhidden) "string" }}
|
{{- if eq (printf "%T" $showhidden) "string" }}
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $title := .title | default (T "Expand-title") }}
|
{{- $title := .title | default (T "Expand-title") }}
|
||||||
{{- $title = trim $title " " }}
|
{{- $title = trim $title " " }}
|
||||||
{{- $expanded := .expanded | default false }}
|
{{- $expanded := .expanded | default false }}
|
||||||
{{- if and (isset . "open") (or (ne (printf "%T" .open) "string") (ne (trim .open " " ) "")) }}
|
{{- 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 }}
|
{{- $expanded = .open }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq (printf "%T" $expanded) "string" }}
|
{{- if eq (printf "%T" $expanded) "string" }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $attributes := dict }}
|
{{- $attributes := dict }}
|
||||||
{{- $otherAttributes := dict }}
|
{{- $otherAttributes := dict }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $icon := .icon | default "" }}
|
{{- $icon := .icon | default "" }}
|
||||||
{{- $icon = trim $icon " " }}
|
{{- $icon = trim $icon " " }}
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $title := .title }}
|
{{- $title := .title }}
|
||||||
{{- $alt := .alt }}
|
{{- $alt := .alt }}
|
||||||
|
@ -34,7 +35,8 @@
|
||||||
{{- $src = printf "%s#%s" $src . }}
|
{{- $src = printf "%s#%s" $src . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .url "page" $page "param" "image" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -52,7 +54,8 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $u.Query.Has "featherlight" }}
|
{{- 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")) }}
|
{{- $effects = merge $effects (dict "lightbox" (ne ($u.Query.Get "featherlight") "false")) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range $k, $v := $effects }}
|
{{- range $k, $v := $effects }}
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- if strings.HasPrefix .url "HAHAHUGOSHORTCODE" }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- $attributes := dict }}
|
{{- $attributes := dict }}
|
||||||
{{- $title := .title | default "" }}
|
{{- $title := .title | default "" }}
|
||||||
|
@ -61,6 +63,7 @@
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $linkPage = $page.Page }}
|
{{- $linkPage = $page.Page }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- $errorlevel := or $page.Params.link.errorlevel $page.Site.Params.link.errorlevel }}
|
||||||
{{- with $linkPage }}
|
{{- with $linkPage }}
|
||||||
{{- $href = partial "permalink.gotmpl" (dict "to" .) }}
|
{{- $href = partial "permalink.gotmpl" (dict "to" .) }}
|
||||||
|
@ -69,7 +72,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $u.Fragment }}
|
{{- with $u.Fragment }}
|
||||||
{{- $ctx := dict
|
{{- $ctx := dict
|
||||||
"contentPath" $page.File.Filename
|
"contentPath" $filepath
|
||||||
"errorLevel" $errorlevel
|
"errorLevel" $errorlevel
|
||||||
"page" $linkPage
|
"page" $linkPage
|
||||||
"parsedURL" $u
|
"parsedURL" $u
|
||||||
|
@ -79,7 +82,7 @@
|
||||||
{{- $href = printf "%s#%s" $href . }}
|
{{- $href = printf "%s#%s" $href . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .url "page" $page "param" "link" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
{{- $align := .align | default "center" }}
|
{{- $align := .align | default "center" }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $content := .content }}
|
{{- $content := .content }}
|
||||||
{{- $align := .align | default "center" }}
|
{{- $align := .align | default "center" }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $class := .class | default "notices" }}
|
{{- $class := .class | default "notices" }}
|
||||||
{{- $containerstyle := .containerstyle | default "div" }}
|
{{- $containerstyle := .containerstyle | default "div" }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $u := urls.Parse .src }}
|
{{- $u := urls.Parse .src }}
|
||||||
{{- $src := $u.String }}
|
{{- $src := $u.String }}
|
||||||
|
@ -18,7 +19,8 @@
|
||||||
{{- $src = "" }}
|
{{- $src = "" }}
|
||||||
{{- $spec = .Content }}
|
{{- $spec = .Content }}
|
||||||
{{- else }}
|
{{- 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) }}
|
{{- partial "_relearn/urlErrorReport.gotmpl" (dict "url" .src "page" $page "param" "openapi" "msg" $msg) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $color := .color | default "" }}
|
{{- $color := .color | default "" }}
|
||||||
{{- $style := .style | default "default" }}
|
{{- $style := .style | default "default" }}
|
||||||
|
@ -23,7 +24,8 @@
|
||||||
{{- $sort := .sort | default "asc" }}
|
{{- $sort := .sort | default "asc" }}
|
||||||
{{- $pattern := .pattern | default "" }}
|
{{- $pattern := .pattern | default "" }}
|
||||||
{{- if eq $page.BundleType "" }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- $content := partial "inline/resource-list" (dict
|
{{- $content := partial "inline/resource-list" (dict
|
||||||
"page" $page
|
"page" $page
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $paramNames := split .name "." }}
|
{{- $paramNames := split .name "." }}
|
||||||
{{- with $page }}
|
{{- with $page }}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $tabs := (slice | append (dict
|
{{- $tabs := (slice | append (dict
|
||||||
"color" .color
|
"color" .color
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{{- $page := .page }}
|
{{- $page := .page }}
|
||||||
{{- if and (not $page) .context }}
|
{{- if and (not $page) .context }}
|
||||||
{{- $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 }}
|
{{- end }}
|
||||||
{{- $groupid := .groupid | default (partial "_relearn/makeRandomMd5.gotmpl" $page) | plainify | anchorize }}
|
{{- $groupid := .groupid | default (partial "_relearn/makeRandomMd5.gotmpl" $page) | plainify | anchorize }}
|
||||||
{{- $color := .color }}
|
{{- $color := .color }}
|
||||||
|
@ -11,7 +12,8 @@
|
||||||
{{- $tabs := slice }}
|
{{- $tabs := slice }}
|
||||||
{{- range $tab := (.content | default slice) }}
|
{{- range $tab := (.content | default slice) }}
|
||||||
{{- if and (not $tab.title) $tab.name }}
|
{{- 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) }}
|
{{- $tab = merge $tab (dict "title" .name) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with $tab }}
|
{{- with $tab }}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7.3.2+db9ca5d2958a7e5956d4f37f6d79e8d2076b8381
|
7.3.2+c0f6af2b423bb063ce6339883fb1e6e31b8df866
|
|
@ -1,6 +1,7 @@
|
||||||
{{- $_hugo_config := `{ "version": 1 }` }}
|
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||||
{{- if (.Get "icon-position") }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- partial "shortcodes/button.html" (dict
|
{{- partial "shortcodes/button.html" (dict
|
||||||
"page" .Page
|
"page" .Page
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{{- if (.Get "showfirstheading") }}
|
{{- 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 }}
|
{{- end }}
|
||||||
{{- partial "shortcodes/include.html" (dict
|
{{- partial "shortcodes/include.html" (dict
|
||||||
"page" .Page
|
"page" .Page
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
{{- $color := (.Get "color") }}
|
{{- $color := (.Get "color") }}
|
||||||
{{- $groupid := ((.Get "groupid") | default (.Get "groupId")) }}
|
{{- $groupid := ((.Get "groupid") | default (.Get "groupId")) }}
|
||||||
{{- if (.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 }}
|
{{- end }}
|
||||||
{{- $icon := (.Get "icon") }}
|
{{- $icon := (.Get "icon") }}
|
||||||
{{- $style := (.Get "style") }}
|
{{- $style := (.Get "style") }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue