Use camel case for vars
This commit is contained in:
@@ -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 }}
|
||||
|
@@ -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 }}
|
||||
|
@@ -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 @@
|
||||
|
||||
<div class="{{ $class }}">
|
||||
{{ with $title }}
|
||||
<p class="paige-row-narrow paige-title text-center"><a href="{{ $titlelink }}">{{ . }}</a></p>
|
||||
<p class="paige-row-narrow paige-title text-center"><a href="{{ $link }}">{{ . }}</a></p>
|
||||
{{ end }}
|
||||
|
||||
{{ with $description }}
|
||||
@@ -65,7 +65,7 @@
|
||||
{{- $kind = "tag" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $textkeywords -}}
|
||||
{{- if $normal -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
|
||||
@@ -100,11 +100,11 @@
|
||||
|
||||
{{ with $date }}
|
||||
<p class="paige-date text-center paige-row-narrow text-secondary">
|
||||
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>
|
||||
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $format . }}</time>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ with $readingtime }}
|
||||
{{ with $time }}
|
||||
<p class="paige-reading-time paige-row-narrow text-center text-secondary">{{ . }} {{ i18n "paige_minutes" . }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@@ -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 `<nav id="TableOfContents"></nav>`) | 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 }}
|
||||
<header class="mw-100" id="paige-page-header">
|
||||
<div class="align-items-center d-flex flex-column">
|
||||
{{ if $first }}
|
||||
@@ -34,10 +34,10 @@
|
||||
<p class="lead paige-row-wide" id="paige-page-description" {{ if $microdata }} itemprop="alternativeHeadline description" {{ end }}>{{ . }}</p>
|
||||
{{ end }}
|
||||
|
||||
{{ if or $authors $date $keywords $readingtime $series }}
|
||||
{{ if or $authors $date $keywords $time $series }}
|
||||
<div id="paige-metadata">
|
||||
{{ with $keywords }}
|
||||
<p class="{{ if $textkeywords }} paige-row-narrow {{ end }} text-center {{ if $textkeywords }} text-secondary {{ end }}" id="paige-keywords">
|
||||
<p class="{{ if $normal }} paige-row-narrow {{ end }} text-center {{ if $normal }} text-secondary {{ end }}" id="paige-keywords">
|
||||
{{ range $i, $term := . -}}
|
||||
{{- $kind := false -}}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
{{- $kind = "tag" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $textkeywords -}}
|
||||
{{- if $normal -}}
|
||||
{{- if gt $i 0 }} · {{ end -}}
|
||||
|
||||
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .Title }}</a>
|
||||
@@ -82,11 +82,11 @@
|
||||
|
||||
{{ with $date }}
|
||||
<p class="paige-row-narrow text-center text-secondary" id="paige-date">
|
||||
<time datetime="{{ .Format `2006-01-02` }}" {{ if $microdata }} itemprop="datePublished" {{ end }}>{{ time.Format $dateformat . }}</time>
|
||||
<time datetime="{{ .Format `2006-01-02` }}" {{ if $microdata }} itemprop="datePublished" {{ end }}>{{ time.Format $format . }}</time>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ with $readingtime }}
|
||||
{{ with $time }}
|
||||
<p class="paige-row-narrow text-center text-secondary" id="paige-reading-time" {{ if $microdata }} itemprop="timeRequired" {{ end }}>{{ . }} {{ i18n "paige_minutes" . }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@@ -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" }}
|
||||
<script type="application/ld+json">{{ merge $sitebase . | jsonify | safeJS }}</script>
|
||||
<script type="application/ld+json">{{ merge $siteBase . | jsonify | safeJS }}</script>
|
||||
{{ end }}
|
||||
|
||||
{{ range $page.Param "paige.page.schemas" }}
|
||||
<script type="application/ld+json">{{ merge $pagebase . | jsonify | safeJS }}</script>
|
||||
<script type="application/ld+json">{{ merge $pageBase . | jsonify | safeJS }}</script>
|
||||
{{ 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 }}
|
||||
|
||||
<script type="application/ld+json">{{ merge $pagebase $schema.Values | jsonify | safeJS }}</script>
|
||||
<script type="application/ld+json">{{ merge $pageBase $schema.Values | jsonify | safeJS }}</script>
|
||||
{{ end }}
|
||||
|
@@ -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 @@
|
||||
<nav aria-label="{{ i18n `paige_menu` }}" class="paige-row-wide" id="paige-menu">
|
||||
<ul class="align-items-center justify-content-center nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ else if $underline }} nav-underline {{ end }}">
|
||||
{{ range . }}
|
||||
{{ $menupath := strings.TrimPrefix $basepath .URL }}
|
||||
{{ $menuPath := strings.TrimPrefix $basePath .URL }}
|
||||
|
||||
{{ $home := and (eq $menupath "/") (eq $page.Section "") }}
|
||||
{{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }}
|
||||
{{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }}
|
||||
{{ $home := and (eq $menuPath "/") (eq $page.Section "") }}
|
||||
{{ $menu := and (ne $menuPath "/") (hasPrefix $pagePath $menuPath) }}
|
||||
{{ $section := and (ne $menuPath "/") (hasPrefix $menuPath (printf "/%s/" $page.Section)) }}
|
||||
|
||||
{{ $active := or $home $menuprefix $sectionprefix }}
|
||||
{{ $active := or $home $menu $section }}
|
||||
|
||||
<li class="nav-item {{ if .Children }} dropdown {{ end }}">
|
||||
<a {{ if $active }} aria-current="page" {{ end }} {{ if .Children }} aria-expanded="false" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} {{ if .Params.paige.disabled }} disabled {{ end }} nav-link {{ if .Children }} dropdown-toggle {{ end }} {{ if $links }} text-decoration-underline {{ end }}" {{ if .Children }} data-bs-toggle="dropdown" {{ end }} href="{{ if not .Children -}} {{- .URL | safeURL -}} {{- end }}" {{ if .Children }} role="button" {{ end }} {{ if not .Children }} {{ with partial "paige/func-target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }} {{ end }}>{{ .Name | markdownify }}</a>
|
||||
@@ -114,22 +112,22 @@
|
||||
|
||||
<nav aria-label="{{ i18n `paige_menu` }}" class="paige-row-wide" id="paige-menu">
|
||||
<ul class="align-items-center justify-content-center nav {{ if $pills }} nav-pills {{ else if $tabs }} nav-tabs {{ else if $underline }} nav-underline {{ end }}">
|
||||
{{ with $titleconfig }}
|
||||
{{ $homemenuactive := eq $page.Section "" }}
|
||||
{{ with $title }}
|
||||
{{ $active := eq $page.Section "" }}
|
||||
|
||||
<li class="nav-item">
|
||||
<a {{ if $homemenuactive }} aria-current="page" {{ end }} class="{{ if $homemenuactive }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="/">{{ . }}</a>
|
||||
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="/">{{ . }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ range $pages }}
|
||||
{{ $menupath := strings.TrimPrefix $basepath .RelPermalink }}
|
||||
{{ $menuPath := strings.TrimPrefix $basePath .RelPermalink }}
|
||||
|
||||
{{ $home := and (eq $menupath "/") (eq $page.Section "") }}
|
||||
{{ $menuprefix := and (ne $menupath "/") (hasPrefix $pagepath $menupath) }}
|
||||
{{ $sectionprefix := and (ne $menupath "/") (hasPrefix $menupath (printf "/%s/" $page.Section)) }}
|
||||
{{ $home := and (eq $menuPath "/") (eq $page.Section "") }}
|
||||
{{ $menu := and (ne $menuPath "/") (hasPrefix $pagePath $menuPath) }}
|
||||
{{ $section := and (ne $menuPath "/") (hasPrefix $menuPath (printf "/%s/" $page.Section)) }}
|
||||
|
||||
{{ $active := or $home $menuprefix $sectionprefix }}
|
||||
{{ $active := or $home $menu $section }}
|
||||
|
||||
<li class="nav-item">
|
||||
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="{{ .RelPermalink | safeURL }}" {{ with partial "paige/func-target.html" (dict "page" $page "url" .RelPermalink) }} target="{{ . }}" {{ end }}>{{ .Title }}</a>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $fullscreen := $params.fullscreen }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $title := $params.title }}
|
||||
|
||||
<iframe {{ if $fullscreen }} allowfullscreen {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} {{ with $src }} src="{{ . | safeURL }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }}></iframe>
|
||||
<iframe {{ if $fullscreen }} allowfullscreen {{ end }} {{ with $policy }} referrerpolicy="{{ . }}" {{ end }} {{ with $src }} src="{{ . | safeURL }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }}></iframe>
|
||||
|
@@ -2,11 +2,11 @@
|
||||
|
||||
{{ $alt := $params.alt }}
|
||||
{{ $class := $params.class }}
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $fetchpriority := $params.fetchpriority }}
|
||||
{{ $height := $params.height }}
|
||||
{{ $loading := $params.loading | default "eager" }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $origin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $priority := $params.fetchpriority }}
|
||||
{{ $sizes := $params.sizes }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $srcset := $params.srcset }}
|
||||
@@ -14,4 +14,4 @@
|
||||
{{ $title := $params.title }}
|
||||
{{ $width := $params.width }}
|
||||
|
||||
<img {{ with $alt }} alt="{{ . }}" {{ end }} {{ with $class }} class="{{ . }}" {{ end }} crossorigin="{{ $crossorigin }}" {{ if and $fetchpriority (ne $fetchpriority "auto") }} fetchpriority="{{ $fetchpriority }}" {{ end }} {{ with $height }} height="{{ . }}" {{ end }} {{ if ne $loading "eager" }} loading="{{ $loading }}" {{ end }} referrerpolicy="{{ $referrerpolicy }}" {{ with $sizes }} sizes="{{ . }}" {{ end }} src="{{ $src }}" {{ with $srcset }} {{ printf `srcset="%s"` . | safeHTMLAttr }} {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}>
|
||||
<img {{ with $alt }} alt="{{ . }}" {{ end }} {{ with $class }} class="{{ . }}" {{ end }} crossorigin="{{ $origin }}" {{ if and $priority (ne $priority "auto") }} fetchpriority="{{ $priority }}" {{ end }} {{ with $height }} height="{{ . }}" {{ end }} {{ if ne $loading "eager" }} loading="{{ $loading }}" {{ end }} referrerpolicy="{{ $policy }}" {{ with $sizes }} sizes="{{ . }}" {{ end }} src="{{ $src }}" {{ with $srcset }} {{ printf `srcset="%s"` . | safeHTMLAttr }} {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}>
|
||||
|
@@ -1,14 +1,14 @@
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $context := $params.context }}
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $enablesourcemap := not hugo.IsProduction }}
|
||||
{{ $href := $params.href }}
|
||||
{{ $includepaths := $params.includepaths }}
|
||||
{{ $integrity := $params.integrity }}
|
||||
{{ $origin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $outputstyle := cond hugo.IsProduction "compressed" "" }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $paths := $params.includepaths }}
|
||||
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $sass := $params.sass }}
|
||||
{{ $template := $params.template }}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
{{ if $sass }}
|
||||
{{/* TODO: Remove the silenceDeprecations option when Bootstrap is updated beyond v5.3.3. */}}
|
||||
|
||||
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $includepaths "outputStyle" $outputstyle "silenceDeprecations" (slice "color-functions" "global-builtin" "import" "mixed-decls") "transpiler" "dartsass") }}
|
||||
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $paths "outputStyle" $outputstyle "silenceDeprecations" (slice "color-functions" "global-builtin" "import" "mixed-decls") "transpiler" "dartsass") }}
|
||||
{{ end }}
|
||||
|
||||
{{ $resource = $resource | minify | fingerprint }}
|
||||
@@ -38,4 +38,4 @@
|
||||
{{ $href = relLangURL $href }}
|
||||
{{ end }}
|
||||
|
||||
<link {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} href="{{ $href | safeURL }}" {{ with $integrity }} integrity="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} rel="stylesheet">
|
||||
<link {{ with $origin }} crossorigin="{{ . }}" {{ end }} href="{{ $href | safeURL }}" {{ with $integrity }} integrity="{{ . }}" {{ end }} {{ with $policy }} referrerpolicy="{{ . }}" {{ end }} rel="stylesheet">
|
||||
|
@@ -1,11 +1,11 @@
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $crossorigin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $defer := $params.defer | default "defer" }}
|
||||
{{ $integrity := $params.integrity }}
|
||||
{{ $onload := $params.onload | safeJS }}
|
||||
{{ $origin := $params.crossorigin | default "anonymous" }}
|
||||
{{ $page := $params.page }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $type := $params.type }}
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
{{ $src = relLangURL $src }}
|
||||
{{ end }}
|
||||
|
||||
<script {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} {{ with $defer }} defer {{ end }} integrity="{{ $integrity }}" {{ with $onload }} onload="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} src="{{ $src | safeURL }}" {{ with $type }} {{ printf `type="%v"` . | safeHTMLAttr }} {{ end }}></script>
|
||||
<script {{ with $origin }} crossorigin="{{ . }}" {{ end }} {{ with $defer }} defer {{ end }} integrity="{{ $integrity }}" {{ with $onload }} onload="{{ . }}" {{ end }} {{ with $policy }} referrerpolicy="{{ . }}" {{ end }} src="{{ $src | safeURL }}" {{ with $type }} {{ printf `type="%v"` . | safeHTMLAttr }} {{ end }}></script>
|
||||
|
@@ -3,9 +3,9 @@
|
||||
{{ $class := $params.class | default "paige-video ratio ratio-16x9" }}
|
||||
{{ $fullscreen := $params.fullscreen }}
|
||||
{{ $height := $params.height }}
|
||||
{{ $maxheight := $params.maxheight }}
|
||||
{{ $maxwidth := $params.maxwidth }}
|
||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $maxHeight := $params.maxheight }}
|
||||
{{ $maxWidth := $params.maxwidth }}
|
||||
{{ $policy := $params.referrerpolicy | default "no-referrer" }}
|
||||
{{ $src := $params.src }}
|
||||
{{ $title := $params.title }}
|
||||
{{ $width := $params.width }}
|
||||
@@ -16,12 +16,12 @@
|
||||
{{ $styles = $styles | append (print "height: " $height) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $maxheight }}
|
||||
{{ $styles = $styles | append (print "max-height: " $maxheight) }}
|
||||
{{ if $maxHeight }}
|
||||
{{ $styles = $styles | append (print "max-height: " $maxHeight) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $maxwidth }}
|
||||
{{ $styles = $styles | append (print "max-width: " $maxwidth) }}
|
||||
{{ if $maxWidth }}
|
||||
{{ $styles = $styles | append (print "max-width: " $maxWidth) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $width }}
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="{{ $class }}" {{ with $styles }} style="{{ . | safeCSS }}" {{ end }}>
|
||||
{{ partial "paige/tag-iframe.html" (dict
|
||||
"fullscreen" $fullscreen
|
||||
"referrerpolicy" $referrerpolicy
|
||||
"referrerpolicy" $policy
|
||||
"src" $src
|
||||
"title" $title
|
||||
) }}
|
||||
|
Reference in New Issue
Block a user