From 20798f3a3a492311e8af7117228c565021ac96a9 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Thu, 6 Feb 2025 21:42:51 -0800 Subject: [PATCH] Use camel case for vars --- layouts/_default/_markup/render-link.html | 6 +- layouts/_default/baseof.html | 8 +- layouts/_default/list.atom.xml | 10 +- layouts/_default/list.rss.xml | 30 +++--- layouts/partials/paige/comments.html | 6 +- layouts/partials/paige/image.html | 108 +++++++++++----------- layouts/partials/paige/list-item.html | 16 ++-- layouts/partials/paige/page-header.html | 18 ++-- layouts/partials/paige/schemas.html | 58 ++++++------ layouts/partials/paige/site-header.html | 38 ++++---- layouts/partials/paige/tag-iframe.html | 4 +- layouts/partials/paige/tag-img.html | 8 +- layouts/partials/paige/tag-link.html | 10 +- layouts/partials/paige/tag-script.html | 6 +- layouts/partials/paige/video.html | 16 ++-- layouts/shortcodes/paige/figure.html | 22 ++--- layouts/shortcodes/paige/gallery.html | 18 ++-- layouts/shortcodes/paige/image.html | 12 +-- layouts/shortcodes/paige/tabs/button.html | 8 +- layouts/shortcodes/paige/tabs/pane.html | 8 +- layouts/shortcodes/paige/vimeo.html | 28 +++--- layouts/shortcodes/paige/youtube.html | 16 ++-- 22 files changed, 226 insertions(+), 228 deletions(-) diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 159b055a..572133fc 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,7 +1,7 @@ {{- $href := cond (.Destination | not | not) (printf ` href="%s"` .Destination) "" -}} -{{- $targetvalue := partial "paige/func-target.html" (dict "page" .Page "url" .Destination) -}} +{{- $targetValue := partial "paige/func-target.html" (dict "page" .Page "url" .Destination) -}} {{- $title := cond (.Title | not | not) (printf ` title="%s"` .Title) "" -}} -{{- $targetattr := cond ($targetvalue | not | not) (printf ` target="%s"` $targetvalue) "" -}} +{{- $targetAttr := cond ($targetValue | not | not) (printf ` target="%s"` $targetValue) "" -}} -{{- printf `%s` $href $targetattr $title .Text | safeHTML -}} +{{- printf `%s` $href $targetAttr $title .Text | safeHTML -}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 0b0f36bd..47eb5819 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,13 +1,13 @@ {{ $page := . }} -{{ $itemattrs := slice }} +{{ $itemAttrs := slice }} {{ $microdata := $page.Params.paige.page.microdata }} {{ range $k, $v := $microdata }} - {{ $itemattrs = $itemattrs | append (printf `%s="%v"` $k $v) }} + {{ $itemAttrs = $itemAttrs | append (printf `%s="%v"` $k $v) }} {{ end }} -{{ $itemattrs = delimit (sort $itemattrs) " " }} +{{ $itemAttrs = delimit (sort $itemAttrs) " " }} {{ partial "paige/tag-html.html" $page }} @@ -20,7 +20,7 @@
-
+
{{ if templates.Exists "partials/paige/site-first.html" }} {{ partial "paige/site-first.html" $page }} {{ end }} diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 846950dd..1d27ee9c 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -98,19 +98,19 @@ {{ range $subpage := $subpages }} {{ $content := .Content }} + {{ $external := and .Params.link (not (.Param "paige.feed.link_to_page")) | not | not }} {{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") .RelPermalink }} - {{ $paramlink := and .Params.link (not (.Param "paige.feed.link_to_page")) | not | not }} {{ $published := cond (not .PublishDate.IsZero) (.PublishDate.Format $format) "" }} {{ $summary := .Description | markdownify }} {{ $title := .Title | markdownify }} {{ $updated := .Lastmod.Format $format }} - {{ $link := cond $paramlink .Params.link .Permalink }} + {{ $link := cond $external .Params.link .Permalink }} - {{ if and $content $paramlink }} - {{ $link := or (.Param "paige.feed.page_link" | markdownify) "⏎" }} + {{ if and $content $external }} + {{ $text := or (.Param "paige.feed.page_link" | markdownify) "⏎" }} - {{ $footer := printf `

%s

` .Permalink (htmlEscape .Title) $link | safeHTML }} + {{ $footer := printf `

%s

` .Permalink (htmlEscape .Title) $text | safeHTML }} {{ $content = print $content $footer }} {{ end }} diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml index 826b6ce7..284b5313 100644 --- a/layouts/_default/list.rss.xml +++ b/layouts/_default/list.rss.xml @@ -1,19 +1,19 @@ {{ $page := . }} +{{ $build := false }} {{ $copyright := site.Copyright | markdownify | plainify | htmlUnescape }} {{ $description := or $page.Description (i18n "paige_recent_content") }} +{{ $editor := $page.Param "paige.feed.rss.managing_editor" }} {{ $format := "Mon, 02 Jan 2006 15:04:05 MST" }} {{ $language := site.LanguageCode | default site.Language.Lang }} -{{ $lastbuilddate := false }} {{ $limit := site.Config.Services.RSS.Limit }} {{ $link := ($page.AlternativeOutputFormats.Get "html").Permalink }} -{{ $managingeditor := $page.Param "paige.feed.rss.managing_editor" }} +{{ $master := $page.Param "paige.feed.rss.web_master" }} {{ $subpages := slice }} -{{ $webmaster := $page.Param "paige.feed.rss.web_master" }} {{ range $page.RegularPagesRecursive.ByPublishDate.Reverse }} - {{ if or (and (not $lastbuilddate) (not .Lastmod.IsZero)) (and $lastbuilddate (lt $lastbuilddate .Lastmod)) }} - {{ $lastbuilddate = .Lastmod }} + {{ if or (and (not $build) (not .Lastmod.IsZero)) (and $build (lt $build .Lastmod)) }} + {{ $build = .Lastmod }} {{ end }} {{ if not (.Param "paige.feed.disable") }} @@ -72,19 +72,19 @@ {{ . }} {{ end }} - {{ with $lastbuilddate }} + {{ with $build }} {{ . }} {{ end }} {{ $link }} - {{ with $managingeditor }} + {{ with $editor }} {{ . }} {{ end }} {{ $title }} - {{ with $webmaster }} + {{ with $master }} {{ . }} {{ end }} @@ -93,12 +93,12 @@ {{ $author := "" }} {{ $authors := partial "paige/func-authors.html" . }} {{ $description := .Content }} + {{ $external := and .Params.link (not (.Param "paige.feed.link_to_page")) | not | not }} {{ $guid := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") (cond (.Params.id | not) .RelPermalink .Params.id) }} - {{ $paramlink := and .Params.link (not (.Param "paige.feed.link_to_page")) | not | not }} - {{ $pubdate := .PublishDate.Format $format }} + {{ $published := .PublishDate.Format $format }} {{ $title := .Title | markdownify | plainify | htmlUnescape }} - {{ $link := cond $paramlink .Params.link .Permalink }} + {{ $link := cond $external .Params.link .Permalink }} {{ with $authors }} {{ $primary := index . 0 }} @@ -110,10 +110,10 @@ {{ end }} {{ end }} - {{ if and $description $paramlink }} - {{ $pagelink := or (.Param "paige.feed.page_link" | markdownify) "⏎" }} + {{ if and $description $external }} + {{ $text := or (.Param "paige.feed.page_link" | markdownify) "⏎" }} - {{ $footer := printf `

%s

` .Permalink (htmlEscape $title) $pagelink | safeHTML }} + {{ $footer := printf `

%s

` .Permalink (htmlEscape $title) $text | safeHTML }} {{ $description = print $description $footer }} {{ end }} @@ -143,7 +143,7 @@ {{ . }} {{ end }} - {{ with $pubdate }} + {{ with $published }} {{ . }} {{ end }} diff --git a/layouts/partials/paige/comments.html b/layouts/partials/paige/comments.html index 6399acfe..10ddfd9e 100644 --- a/layouts/partials/paige/comments.html +++ b/layouts/partials/paige/comments.html @@ -1,11 +1,11 @@ {{ $page := . }} {{ $enabled := $page.Param "paige.comments.disable" | not }} -{{ $disabledkinds := $page.Param "paige.comments.disable_kinds" }} +{{ $disabledKinds := $page.Param "paige.comments.disable_kinds" }} -{{ $enabledkind := or (not $disabledkinds) (not (in $disabledkinds $page.Kind)) }} +{{ $enabledKind := or (not $disabledKinds) (not (in $disabledKinds $page.Kind)) }} -{{ if and $enabled $enabledkind }} +{{ if and $enabled $enabledKind }} {{ template "_internal/disqus.html" $page }} {{ partial "paige/comments/cactus.html" $page }} {{ partial "paige/comments/commento.html" $page }} diff --git a/layouts/partials/paige/image.html b/layouts/partials/paige/image.html index 76ec850d..ebd36a1b 100644 --- a/layouts/partials/paige/image.html +++ b/layouts/partials/paige/image.html @@ -4,13 +4,13 @@ {{ $breakpoints := $params.breakpoints }} {{ $class := $params.class }} {{ $densities := $params.densities }} -{{ $fetchpriority := $params.fetchpriority }} +{{ $fetchPriority := $params.fetchpriority }} {{ $height := $params.height }} {{ $link := $params.link }} {{ $linked := $params.linked }} {{ $loading := $params.loading }} -{{ $maxheight := $params.maxheight }} -{{ $maxwidth := $params.maxwidth }} +{{ $maxHeight := $params.maxheight }} +{{ $maxWidth := $params.maxwidth }} {{ $page := $params.page }} {{ $process := $params.process }} {{ $resource := $params.resource }} @@ -21,14 +21,14 @@ {{ $title := $params.title }} {{ $width := $params.width }} -{{ $intrinsicheight := "" }} -{{ $intrinsicwidth := "" }} +{{ $intrinsicHeight := "" }} +{{ $intrinsicWidth := "" }} -{{ if and (or $height $maxheight) (not (or $maxwidth $width)) }} +{{ if and (or $height $maxHeight) (not (or $maxWidth $width)) }} {{ $width = "auto" }} {{ end }} -{{ if and (or $maxwidth $width) (not (or $height $maxheight)) }} +{{ if and (or $maxWidth $width) (not (or $height $maxHeight)) }} {{ $height = "auto" }} {{ end }} @@ -54,12 +54,12 @@ {{ $style = $style | append (print "height: " $height) }} {{ end }} -{{ if $maxheight }} - {{ $style = $style | append (print "max-height: " $maxheight) }} +{{ if $maxHeight }} + {{ $style = $style | append (print "max-height: " $maxHeight) }} {{ end }} -{{ if $maxwidth }} - {{ $style = $style | append (print "max-width: " $maxwidth) }} +{{ if $maxWidth }} + {{ $style = $style | append (print "max-width: " $maxWidth) }} {{ end }} {{ if $width }} @@ -77,7 +77,7 @@ {{ $options := slice }} {{ $quality := "" }} {{ $size := "" }} - {{ $smallerresource := $resource }} + {{ $smallerResource := $resource }} {{ if $process }} {{ range split (lower (cond (eq $process "default") "" $process)) " " }} @@ -109,33 +109,33 @@ {{ $smalleroptions := print $size " " $quality " " $options }} {{ if eq $method "crop" }} - {{ $smallerresource = $resource.Crop $smalleroptions }} + {{ $smallerResource = $resource.Crop $smalleroptions }} {{ else if eq $method "fill" }} - {{ $smallerresource = $resource.Fill $smalleroptions }} + {{ $smallerResource = $resource.Fill $smalleroptions }} {{ else if eq $method "fit" }} - {{ $smallerresource = $resource.Fit $smalleroptions }} + {{ $smallerResource = $resource.Fit $smalleroptions }} {{ else if eq $method "resize" }} - {{ $smallerresource = $resource.Resize $smalleroptions }} + {{ $smallerResource = $resource.Resize $smalleroptions }} {{ end }} {{ end }} - {{ $smallerresource = $smallerresource | fingerprint }} - {{ $intrinsicheight = $smallerresource.Height }} - {{ $intrinsicwidth = $smallerresource.Width }} - {{ $src = $smallerresource.Permalink }} + {{ $smallerResource = $smallerResource | fingerprint }} + {{ $intrinsicHeight = $smallerResource.Height }} + {{ $intrinsicWidth = $smallerResource.Width }} + {{ $src = $smallerResource.Permalink }} {{ if and (not $sizes) (not $srcset) }} - {{ $partialresource := "" }} + {{ $partialResource := "" }} {{ if and $method (or $breakpoints $densities) (ne $method "resize") }} - {{ $partialoptions := print $size " q100 " $options }} + {{ $partialOptions := print $size " q100 " $options }} {{ if eq $method "crop" }} - {{ $partialresource = $resource.Crop $partialoptions }} + {{ $partialResource = $resource.Crop $partialOptions }} {{ else if eq $method "fill" }} - {{ $partialresource = $resource.Fill $partialoptions }} + {{ $partialResource = $resource.Fill $partialOptions }} {{ else if eq $method "fit" }} - {{ $partialresource = $resource.Fit $partialoptions }} + {{ $partialResource = $resource.Fit $partialOptions }} {{ end }} {{ end }} @@ -143,81 +143,81 @@ {{ $densities = split $densities " " }} {{ $srcset = slice }} - {{ $parseddensities := slice }} + {{ $parsedDensities := slice }} {{ range $densities }} {{ with findRE `^(\d+(\.\d+)?x|\.\d+x)$` . 1 }} - {{ $parseddensities = $parseddensities | append (strings.TrimSuffix "x" (index . 0) | float) }} + {{ $parsedDensities = $parsedDensities | append (strings.TrimSuffix "x" (index . 0) | float) }} {{ else }} {{ errorf "layouts/partials/paige/image.html: invalid pixel density: %q" . }} {{ end }} {{ end }} - {{ $parseddensities = $parseddensities | uniq | sort }} + {{ $parsedDensities = $parsedDensities | uniq | sort }} - {{ if lt (len $parseddensities) 2 }} + {{ if lt (len $parsedDensities) 2 }} {{ errorf "layouts/partials/paige/image.html: must have at least two unique pixel densities" }} {{ end }} {{ $base := 0 }} - {{ $maxdensity := index $parseddensities (sub (len $parseddensities) 1) }} + {{ $maxDensity := index $parsedDensities (sub (len $parsedDensities) 1) }} - {{ with $partialresource }} - {{ $base = div .Width $maxdensity }} + {{ with $partialResource }} + {{ $base = div .Width $maxDensity }} {{ else }} - {{ $base = div $smallerresource.Width $maxdensity }} + {{ $base = div $smallerResource.Width $maxDensity }} {{ end }} - {{ range $parseddensities }} - {{ if eq . $maxdensity }} + {{ range $parsedDensities }} + {{ if eq . $maxDensity }} {{ continue }} {{ end }} - {{ $imagewidth := mul $base . | math.Round | int }} + {{ $imageWidth := mul $base . | math.Round | int }} {{ $resized := "" }} - {{ with $partialresource }} - {{ $resized = .Resize (print $imagewidth "x " $quality " " $options) }} + {{ with $partialResource }} + {{ $resized = .Resize (print $imageWidth "x " $quality " " $options) }} {{ else }} - {{ $resized = $smallerresource.Resize (print $imagewidth "x q100 " $options) }} + {{ $resized = $smallerResource.Resize (print $imageWidth "x q100 " $options) }} {{ end }} {{ $resized = $resized | fingerprint }} {{ $srcset = $srcset | append (printf "%s %gx" $resized.RelPermalink .) }} {{ end }} - {{ $srcset = $srcset | append (printf "%s %gx" $smallerresource.RelPermalink $maxdensity) }} + {{ $srcset = $srcset | append (printf "%s %gx" $smallerResource.RelPermalink $maxDensity) }} {{ $srcset = delimit $srcset ", " | string }} {{ else if $breakpoints }} {{ $sizes = slice }} {{ $srcset = slice }} - {{ $maxwidth := 0 }} + {{ $maxWidth := 0 }} {{ range slice (slice 550 576) (slice 696 768) (slice 936 992) (slice 1116 1200) (slice 1296 1400) }} - {{ $imagewidth := index . 0 }} - {{ $viewwidth := index . 1 }} + {{ $imageWidth := index . 0 }} + {{ $viewWidth := index . 1 }} - {{ if gt $imagewidth $smallerresource.Width }} + {{ if gt $imageWidth $smallerResource.Width }} {{ continue }} {{ end }} {{ $resized := "" }} - {{ with $partialresource }} - {{ $resized = .Resize (print $imagewidth "x " $quality " " $options) }} + {{ with $partialResource }} + {{ $resized = .Resize (print $imageWidth "x " $quality " " $options) }} {{ else }} - {{ $resized = $smallerresource.Resize (print $imagewidth "x q100 " $options) }} + {{ $resized = $smallerResource.Resize (print $imageWidth "x q100 " $options) }} {{ end }} {{ $resized = $resized | fingerprint }} - {{ $maxwidth = math.Max $maxwidth $imagewidth }} - {{ $sizes = $sizes | append (printf "(max-width: %dpx) %dpx" $viewwidth $imagewidth) }} - {{ $srcset = $srcset | append (printf "%s %dw" $resized.RelPermalink $imagewidth) }} + {{ $maxWidth = math.Max $maxWidth $imageWidth }} + {{ $sizes = $sizes | append (printf "(max-width: %dpx) %dpx" $viewWidth $imageWidth) }} + {{ $srcset = $srcset | append (printf "%s %dw" $resized.RelPermalink $imageWidth) }} {{ end }} {{ if $sizes }} - {{ $sizes = $sizes | append (print $maxwidth "px") }} + {{ $sizes = $sizes | append (print $maxWidth "px") }} {{ $sizes = delimit $sizes ", " }} {{ $srcset = delimit $srcset ", " }} {{ end }} @@ -230,15 +230,15 @@ {{ $content := partial "paige/tag-img.html" (dict "alt" $alt "class" $class - "fetchpriority" $fetchpriority - "height" $intrinsicheight + "fetchpriority" $fetchPriority + "height" $intrinsicHeight "loading" $loading "sizes" $sizes "src" $src "srcset" $srcset "style" $style "title" $title - "width" $intrinsicwidth + "width" $intrinsicWidth ) }} {{ if $linked }} diff --git a/layouts/partials/paige/list-item.html b/layouts/partials/paige/list-item.html index f77a44ef..b755fac6 100644 --- a/layouts/partials/paige/list-item.html +++ b/layouts/partials/paige/list-item.html @@ -3,20 +3,20 @@ {{ $authors := partial "paige/func-authors.html" $page | and ($page.Parent.Param "paige.subpage.disable_authors" | not) }} {{ $categories := $page.GetTerms "categories" }} {{ $date := $page.PublishDate | and ($page.Parent.Param "paige.subpage.disable_date" | not) }} -{{ $dateformat := $page.Parent.Param "paige.date_format" | default ":date_long" }} {{ $description := $page.Description | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_description" | not) }} {{ $draft := $page.Draft }} {{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }} {{ $flags := slice }} +{{ $format := $page.Parent.Param "paige.date_format" | default ":date_long" }} {{ $future := and $page.PublishDate (gt $page.PublishDate now) }} +{{ $link := $page.RelPermalink }} {{ $modified := and $page.PublishDate $page.Lastmod (lt $page.PublishDate $page.Lastmod) }} -{{ $readingtime := $page.ReadingTime | and ($page.Parent.Param "paige.subpage.disable_reading_time" | not) }} +{{ $normal := eq ($page.Parent.Param "paige.keyword_style" | default "text") "text" }} {{ $series := $page.GetTerms "series" | and ($page.Parent.Param "paige.subpage.disable_series" | not) }} {{ $summary := $page.Summary | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_summary" | not) }} {{ $tags := $page.GetTerms "tags" }} -{{ $textkeywords := eq ($page.Parent.Param "paige.keyword_style" | default "text") "text" }} +{{ $time := $page.ReadingTime | and ($page.Parent.Param "paige.subpage.disable_reading_time" | not) }} {{ $title := $page.Title | markdownify | plainify | htmlUnescape | and ($page.Parent.Param "paige.subpage.disable_title" | not) }} -{{ $titlelink := $page.RelPermalink }} {{ if $draft }} {{ $flags = $flags | append "paige-draft" "paige-unpublished" }} @@ -43,7 +43,7 @@
{{ with $title }} -

{{ . }}

+

{{ . }}

{{ end }} {{ with $description }} @@ -65,7 +65,7 @@ {{- $kind = "tag" -}} {{- end -}} - {{- if $textkeywords -}} + {{- if $normal -}} {{- if gt $i 0 }} · {{ end -}} {{ .Title }} @@ -100,11 +100,11 @@ {{ with $date }}

- +

{{ end }} - {{ with $readingtime }} + {{ with $time }}

{{ . }} {{ i18n "paige_minutes" . }}

{{ end }}
diff --git a/layouts/partials/paige/page-header.html b/layouts/partials/paige/page-header.html index 6cc1689c..794d3ae7 100644 --- a/layouts/partials/paige/page-header.html +++ b/layouts/partials/paige/page-header.html @@ -4,22 +4,22 @@ {{ $authors := partial "paige/func-authors.html" $page | and ($page.Param "paige.page.disable_authors" | not) }} {{ $categories := $page.GetTerms "categories" }} {{ $date := and $page.IsPage $page.PublishDate | and ($page.Param "paige.page.disable_date" | not) }} -{{ $dateformat := $page.Param "paige.date_format" | default ":date_long" }} {{ $description := $page.Description | markdownify | and ($page.Param "paige.page.disable_description" | not) }} {{ $first := templates.Exists "partials/paige/page-header-first.html" }} +{{ $format := $page.Param "paige.date_format" | default ":date_long" }} {{ $last := templates.Exists "partials/paige/page-header-last.html" }} {{ $link := $page.Params.link }} {{ $microdata := $page.Params.paige.page.microdata }} -{{ $readingtime := $page.ReadingTime | and ($page.Param "paige.page.disable_reading_time" | not) }} +{{ $normal := eq ($page.Param "paige.keyword_style" | default "text") "text" }} {{ $series := $page.GetTerms "series" | and ($page.Param "paige.page.disable_series" | not) }} {{ $tags := $page.GetTerms "tags" }} -{{ $textkeywords := eq ($page.Param "paige.keyword_style" | default "text") "text" }} +{{ $time := $page.ReadingTime | and ($page.Param "paige.page.disable_reading_time" | not) }} {{ $title := $page.Title | markdownify | and ($page.Param "paige.page.disable_title" | not) }} {{ $toc := and $page.Content (ne $page.TableOfContents ``) | and ($page.Param "paige.page.disable_toc" | not) }} {{ $keywords := sort (append $categories $tags) "Title" | and ($page.Param "paige.page.disable_keywords" | not) }} -{{ if or $alert $authors $date $description $first $keywords $last $readingtime $series $title $toc }} +{{ if or $alert $authors $date $description $first $keywords $last $time $series $title $toc }}
{{ if $first }} @@ -34,10 +34,10 @@

{{ . }}

{{ end }} - {{ if or $authors $date $keywords $readingtime $series }} + {{ if or $authors $date $keywords $time $series }}
{{ with $keywords }} -

+

{{ range $i, $term := . -}} {{- $kind := false -}} @@ -47,7 +47,7 @@ {{- $kind = "tag" -}} {{- end -}} - {{- if $textkeywords -}} + {{- if $normal -}} {{- if gt $i 0 }} · {{ end -}} {{ .Title }} @@ -82,11 +82,11 @@ {{ with $date }}

- +

{{ end }} - {{ with $readingtime }} + {{ with $time }}

{{ . }} {{ i18n "paige_minutes" . }}

{{ end }}
diff --git a/layouts/partials/paige/schemas.html b/layouts/partials/paige/schemas.html index a54f47b6..953f9ca8 100644 --- a/layouts/partials/paige/schemas.html +++ b/layouts/partials/paige/schemas.html @@ -1,15 +1,15 @@ {{ $page := . }} {{ $auto := $page.Param "paige.page.disable_auto_schema" | not }} -{{ $pagebase := $page.Param "paige.page.base_schema" }} -{{ $sitebase := $page.Param "paige.site.base_schema" }} +{{ $pageBase := $page.Param "paige.page.base_schema" }} +{{ $siteBase := $page.Param "paige.site.base_schema" }} {{ range $page.Param "paige.site.schemas" }} - + {{ end }} {{ range $page.Param "paige.page.schemas" }} - + {{ end }} {{ if $auto }} @@ -38,44 +38,44 @@ {{ end }} {{ with $audios }} - {{ $audioObjects := slice }} + {{ $objects := slice }} {{ range $audios }} - {{ $audioObjects = $audioObjects | append (dict "@type" "AudioObject" "url" .) }} + {{ $objects = $objects | append (dict "@type" "AudioObject" "url" .) }} {{ end }} - {{ $schema.Set "audio" $audioObjects }} + {{ $schema.Set "audio" $objects }} {{ end }} {{ with $authors }} - {{ $authorObjects := slice }} + {{ $objects := slice }} {{ range $authors }} - {{ $authoremail := cond (. | not | not) .Params.paige.author.email "" }} - {{ $authorname := cond (. | not | not) .Params.paige.author.name "" }} - {{ $authorurl := cond (. | not | not) .Params.paige.author.url "" }} + {{ $email := cond (. | not | not) .Params.paige.author.email "" }} + {{ $name := cond (. | not | not) .Params.paige.author.name "" }} + {{ $url := cond (. | not | not) .Params.paige.author.url "" }} - {{ if or $authoremail $authorname $authorurl }} - {{ $authorSchema := newScratch }} + {{ if or $email $name $url }} + {{ $object := newScratch }} - {{ with $authoremail }} - {{ $authorSchema.Set "email" . }} + {{ with $email }} + {{ $object.Set "email" . }} {{ end }} - {{ with $authorname }} - {{ $authorSchema.Set "name" . }} + {{ with $name }} + {{ $object.Set "name" . }} {{ end }} - {{ with $authorurl }} - {{ $authorSchema.Set "url" . }} + {{ with $url }} + {{ $object.Set "url" . }} {{ end }} - {{ $authorSchema.Set "@type" "Person" }} - {{ $authorObjects = $authorObjects | append $authorSchema.Values }} + {{ $object.Set "@type" "Person" }} + {{ $objects = $objects | append $object.Values }} {{ end }} {{ end }} - {{ $schema.Set "author" $authorObjects }} + {{ $schema.Set "author" $objects }} {{ end }} {{ with site.Copyright }} @@ -107,13 +107,13 @@ {{ end }} {{ with $images }} - {{ $imageObjects := slice }} + {{ $objects := slice }} {{ range $images }} - {{ $imageObjects = $imageObjects | append (dict "@type" "ImageObject" "url" .) }} + {{ $objects = $objects | append (dict "@type" "ImageObject" "url" .) }} {{ end }} - {{ $schema.Set "image" $imageObjects }} + {{ $schema.Set "image" $objects }} {{ end }} {{ with site.Language }} @@ -137,18 +137,18 @@ {{ end }} {{ with $videos }} - {{ $videoObjects := slice }} + {{ $objects := slice }} {{ range $videos }} - {{ $videoObjects = $videoObjects | append (dict "@type" "VideoObject" "url" .) }} + {{ $objects = $objects | append (dict "@type" "VideoObject" "url" .) }} {{ end }} - {{ $schema.Set "video" $videoObjects }} + {{ $schema.Set "video" $objects }} {{ end }} {{ with $page.WordCount }} {{ $schema.Set "wordCount" . }} {{ end }} - + {{ end }} diff --git a/layouts/partials/paige/site-header.html b/layouts/partials/paige/site-header.html index 40939809..cae077cc 100644 --- a/layouts/partials/paige/site-header.html +++ b/layouts/partials/paige/site-header.html @@ -1,8 +1,6 @@ {{ $page := . }} -{{ $titleconfig := $page.Param "paige.title" | default site.Title }} - -{{ $basepath := path.Clean (urls.Parse (relLangURL "")).Path }} +{{ $basePath := path.Clean (urls.Parse (relLangURL "")).Path }} {{ $breadcrumbs := $page.Ancestors | and ($page.Param "paige.site.disable_breadcrumbs" | not) }} {{ $description := $page.Param "paige.description" | markdownify | and ($page.Param "paige.site.disable_description" | not) }} {{ $first := templates.Exists "partials/paige/site-header-first.html" }} @@ -11,14 +9,14 @@ {{ $menu := $page.Param "paige.site.disable_menu" | not }} {{ $pills := false }} {{ $tabs := false }} -{{ $title := $titleconfig | markdownify | and ($page.Param "paige.site.disable_title" | not) }} +{{ $title := $page.Param "paige.title" | default site.Title | markdownify | and ($page.Param "paige.site.disable_title" | not) }} {{ $underline := false }} -{{ if eq $basepath "/" }} - {{ $basepath = "" }} +{{ if eq $basePath "/" }} + {{ $basePath = "" }} {{ end }} -{{ $pagepath := strings.TrimPrefix $basepath $page.RelPermalink }} +{{ $pagePath := strings.TrimPrefix $basePath $page.RelPermalink }} {{ with $page.Param "paige.menu_style" }} {{ if eq . "pills" }} @@ -53,13 +51,13 @@