Use camel case for vars

master
Will Faught 5 months ago
parent b840f2233a
commit 20798f3a3a

@ -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 `<a%s%s%s>%s</a>` $href $targetattr $title .Text | safeHTML -}}
{{- printf `<a%s%s%s>%s</a>` $href $targetAttr $title .Text | safeHTML -}}

@ -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) " " }}
<!doctype html>
{{ partial "paige/tag-html.html" $page }}
@ -20,7 +20,7 @@
<div class="container">
<div class="row">
<div class="col mt-3" id="paige-site" {{ with $itemattrs }} {{ $itemattrs | safeHTMLAttr }} {{ end }}>
<div class="col mt-3" id="paige-site" {{ with $itemAttrs }} {{ $itemAttrs | safeHTMLAttr }} {{ end }}>
{{ if templates.Exists "partials/paige/site-first.html" }}
{{ partial "paige/site-first.html" $page }}
{{ end }}

@ -98,19 +98,19 @@
{{ range $subpage := $subpages }}
<entry>
{{ $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 `<p><a href="%s" title="%s">%s</a></p>` .Permalink (htmlEscape .Title) $link | safeHTML }}
{{ $footer := printf `<p><a href="%s" title="%s">%s</a></p>` .Permalink (htmlEscape .Title) $text | safeHTML }}
{{ $content = print $content $footer }}
{{ end }}

@ -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 @@
<language>{{ . }}</language>
{{ end }}
{{ with $lastbuilddate }}
{{ with $build }}
<lastBuildDate>{{ . }}</lastBuildDate>
{{ end }}
<link>{{ $link }}</link>
{{ with $managingeditor }}
{{ with $editor }}
<managingEditor>{{ . }}</managingEditor>
{{ end }}
<title>{{ $title }}</title>
{{ with $webmaster }}
{{ with $master }}
<webMaster>{{ . }}</webMaster>
{{ 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 `<p><a href="%s" title="%s">%s</a></p>` .Permalink (htmlEscape $title) $pagelink | safeHTML }}
{{ $footer := printf `<p><a href="%s" title="%s">%s</a></p>` .Permalink (htmlEscape $title) $text | safeHTML }}
{{ $description = print $description $footer }}
{{ end }}
@ -143,7 +143,7 @@
<link>{{ . }}</link>
{{ end }}
{{ with $pubdate }}
{{ with $published }}
<pubDate>{{ . }}</pubDate>
{{ end }}

@ -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
) }}

@ -2,7 +2,7 @@
{{ $content := .InnerDeindent | markdownify }}
{{ $float := .Get "float" }}
{{ $horizontal := .Get "horizontal" | default "center" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $maxWidth := .Get "maxwidth" }}
{{ $number := .Get "number" }}
{{ $numbered := .Get "numbered" }}
{{ $vertical := .Get "vertical" | default "center" }}
@ -12,8 +12,8 @@
{{ errorf "layouts/shortcodes/paige/figure.html: no content" }}
{{ end }}
{{ $showcaption := $caption }}
{{ $sidemargin := "" }}
{{ $showCaption := $caption }}
{{ $sideMargin := "" }}
{{ $table := false }}
{{ $widths := slice }}
@ -21,8 +21,8 @@
{{ $table = true }}
{{ end }}
{{ if $maxwidth }}
{{ $widths = $widths | append (printf "max-width: %v" $maxwidth) }}
{{ if $maxWidth }}
{{ $widths = $widths | append (printf "max-width: %v" $maxWidth) }}
{{ end }}
{{ if $width }}
@ -33,9 +33,9 @@
{{ if $float }}
{{ if eq $float "start" }}
{{ $sidemargin = "me-4" }}
{{ $sideMargin = "me-4" }}
{{ else if eq $float "end" }}
{{ $sidemargin = "ms-4" }}
{{ $sideMargin = "ms-4" }}
{{ else }}
{{ errorf "layouts/shortcodes/paige/figure.html: invalid float: %q" $float }}
{{ end }}
@ -48,20 +48,20 @@
{{ else }}
{{ if $number }}
{{ $caption = printf "%v %v" (i18n "paige_figure") $number }}
{{ $showcaption = true }}
{{ $showCaption = true }}
{{ else if $numbered }}
{{ $showcaption = true }}
{{ $showCaption = true }}
{{ end }}
{{ end }}
{{/* The markup below cannot be indented due to nested shortcodes within Markdown. */}}
<div class="paige-figure {{ if $numbered }} paige-figure-numbered {{ end }}">
<div class="align-items-{{ $vertical }} d-flex {{ with $float }} float-{{ . }} {{ end }} h-100 justify-content-{{ $horizontal }} {{ with $sidemargin }} {{ . }} {{ end }}">
<div class="align-items-{{ $vertical }} d-flex {{ with $float }} float-{{ . }} {{ end }} h-100 justify-content-{{ $horizontal }} {{ with $sideMargin }} {{ . }} {{ end }}">
<figure class="{{ if $table }} d-table {{ end }} mb-0" {{ with $widths }} style="{{ . | safeCSS }}" {{ end }}>
<div class="d-flex justify-content-{{ $horizontal }} text-{{ $horizontal }}">{{ $content }}</div>
{{ if $showcaption }}
{{ if $showCaption }}
<figcaption class="figure-caption mt-2 text-{{ $horizontal }}" {{ if $table }} style="caption-side: bottom; display: table-caption" {{ end }}>{{ $caption }}</figcaption>
{{ end }}
</figure>

@ -2,15 +2,15 @@
{{ $breakpoints := .Get "breakpoints" }}
{{ $class := .Get "class" }}
{{ $densities := .Get "densities" }}
{{ $fetchpriority := .Get "fetchpriority" }}
{{ $height := .Get "height" }}
{{ $images := .Get 0 | default (.Get "images") }}
{{ $justify := .Get "justify" | default "center" }}
{{ $linked := .Get "linked" }}
{{ $loading := .Get "loading" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $maxHeight := .Get "maxheight" }}
{{ $maxWidth := .Get "maxwidth" }}
{{ $page := .Page }}
{{ $priority := .Get "fetchpriority" }}
{{ $process := .Get "process" }}
{{ $style := .Get "style" }}
{{ $type := .Get "type" | default "rows" }}
@ -53,12 +53,12 @@
"breakpoints" $breakpoints
"class" (printf "img-fluid %s" $class)
"densities" $densities
"fetchpriority" $fetchpriority
"fetchpriority" $priority
"height" $height
"linked" $linked
"loading" $loading
"maxheight" $maxheight
"maxwidth" $maxwidth
"maxheight" $maxHeight
"maxwidth" $maxWidth
"page" $page
"process" $process
"resource" .
@ -79,12 +79,12 @@
"breakpoints" $breakpoints
"class" (printf "img-fluid %s" $class)
"densities" $densities
"fetchpriority" $fetchpriority
"fetchpriority" $priority
"height" $height
"linked" $linked
"loading" $loading
"maxheight" $maxheight
"maxwidth" $maxwidth
"maxheight" $maxHeight
"maxwidth" $maxWidth
"page" $page
"process" $process
"resource" .

@ -2,13 +2,13 @@
{{ $breakpoints := .Get "breakpoints" }}
{{ $class := .Get "class" }}
{{ $densities := .Get "densities" }}
{{ $fetchpriority := .Get "fetchpriority" }}
{{ $height := .Get "height" }}
{{ $link := .Get "link" }}
{{ $linked := .Get "linked" }}
{{ $loading := .Get "loading" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $maxHeight := .Get "maxheight" }}
{{ $maxWidth := .Get "maxwidth" }}
{{ $priority := .Get "fetchpriority" }}
{{ $process := .Get "process" }}
{{ $sizes := .Get "sizes" }}
{{ $src := .Get 0 | default (.Get "src") }}
@ -23,13 +23,13 @@
"breakpoints" $breakpoints
"class" (printf "img-fluid %s" $class)
"densities" $densities
"fetchpriority" $fetchpriority
"fetchpriority" $priority
"height" $height
"link" $link
"linked" $linked
"loading" $loading
"maxheight" $maxheight
"maxwidth" $maxwidth
"maxheight" $maxHeight
"maxwidth" $maxWidth
"page" .Page
"process" $process
"sizes" $sizes

@ -1,5 +1,5 @@
{{ $content := chomp .InnerDeindent | markdownify }}
{{ $tabcount := .Page.Scratch.Get "paige-tabs" | default 0 }}
{{ $tabs := .Page.Scratch.Get "paige-tabs" | default 0 }}
{{ if not $content }}
{{ errorf "layouts/shortcodes/paige/tab/button.html: no content" }}
@ -7,10 +7,10 @@
{{ .Page.Scratch.Add "paige-tabs-button" 1 }}
{{ $buttoncount := .Page.Scratch.Get "paige-tabs-button" }}
{{ $buttons := .Page.Scratch.Get "paige-tabs-button" }}
{{ $active := eq $buttoncount 1 }}
{{ $active := eq $buttons 1 }}
<li class="nav-item" role="presentation">
<button aria-controls="paige-tabs-{{ $tabcount }}-pane-{{ $buttoncount }}" aria-selected="{{ $active }}" class="{{ if $active }} active {{ end }} nav-link" data-bs-target="#paige-tabs-{{ $tabcount }}-pane-{{ $buttoncount }}" data-bs-toggle="tab" id="paige-tabs-{{ $tabcount }}-button-{{ $buttoncount }}" role="tab" type="button">{{ $content }}</button>
<button aria-controls="paige-tabs-{{ $tabs }}-pane-{{ $buttons }}" aria-selected="{{ $active }}" class="{{ if $active }} active {{ end }} nav-link" data-bs-target="#paige-tabs-{{ $tabs }}-pane-{{ $buttons }}" data-bs-toggle="tab" id="paige-tabs-{{ $tabs }}-button-{{ $buttons }}" role="tab" type="button">{{ $content }}</button>
</li>

@ -1,5 +1,5 @@
{{ $content := chomp .InnerDeindent | markdownify }}
{{ $tabcount := .Page.Scratch.Get "paige-tabs" | default 0 }}
{{ $tabs := .Page.Scratch.Get "paige-tabs" | default 0 }}
{{ if not $content }}
{{ errorf "layouts/shortcodes/paige/tab/pane.html: no content" }}
@ -7,8 +7,8 @@
{{ .Page.Scratch.Add "paige-tabs-pane" 1 }}
{{ $panecount := .Page.Scratch.Get "paige-tabs-pane" }}
{{ $panes := .Page.Scratch.Get "paige-tabs-pane" }}
{{ $active := eq $panecount 1 }}
{{ $active := eq $panes 1 }}
<div aria-labelledby="paige-tabs-{{ $tabcount }}-button-{{ $panecount }}" class="{{ if $active }} active {{ end }} fade {{ if $active }} show {{ end }} tab-pane" id="paige-tabs-{{ $tabcount }}-pane-{{ $panecount }}" role="tabpanel" tabindex="0">{{ $content }}</div>
<div aria-labelledby="paige-tabs-{{ $tabs }}-button-{{ $panes }}" class="{{ if $active }} active {{ end }} fade {{ if $active }} show {{ end }} tab-pane" id="paige-tabs-{{ $tabs }}-pane-{{ $panes }}" role="tabpanel" tabindex="0">{{ $content }}</div>

@ -1,5 +1,5 @@
{{ $autopause := .Get "autopause" | default true }}
{{ $autoplay := .Get "autoplay" }}
{{ $autoPause := .Get "autopause" | default true }}
{{ $autoPlay := .Get "autoplay" }}
{{ $background := .Get "background" }}
{{ $byline := .Get "byline" }}
{{ $color := .Get "color" }}
@ -10,16 +10,16 @@
{{ $height := .Get "height" }}
{{ $keyboard := .Get "keyboard" | default true }}
{{ $loop := .Get "loop" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $maxHeight := .Get "maxheight" }}
{{ $maxWidth := .Get "maxwidth" }}
{{ $muted := .Get "muted" }}
{{ $pip := .Get "pip" }}
{{ $playsinline := .Get "playsinline" | default true }}
{{ $playsInline := .Get "playsinline" | default true }}
{{ $policy := .Get "referrerpolicy" | default "no-referrer" }}
{{ $portrait := .Get "portrait" }}
{{ $quality := .Get "quality" }}
{{ $referrerpolicy := .Get "referrerpolicy" | default "no-referrer" }}
{{ $speed := .Get "speed" }}
{{ $texttrack := .Get "texttrack" }}
{{ $textTrack := .Get "texttrack" }}
{{ $time := .Get "time" }}
{{ $title := .Get "title" }}
{{ $transparent := .Get "transparent" | default true }}
@ -32,11 +32,11 @@
{{ $params := slice }}
{{ if not $autopause }}
{{ if not $autoPause }}
{{ $params = $params | append "autopause=0" }}
{{ end }}
{{ if $autoplay }}
{{ if $autoPlay }}
{{ $params = $params | append "autoplay=1" }}
{{ end }}
@ -76,7 +76,7 @@
{{ $params = $params | append "pip=1" }}
{{ end }}
{{ if not $playsinline }}
{{ if not $playsInline }}
{{ $params = $params | append "playsinline=0" }}
{{ end }}
@ -92,7 +92,7 @@
{{ $params = $params | append "speed=1" }}
{{ end }}
{{ with $texttrack }}
{{ with $textTrack }}
{{ $params = $params | append (printf "texttrack=%v" .) }}
{{ end }}
@ -120,9 +120,9 @@
{{ partial "paige/video.html" (dict
"fullscreen" $fullscreen
"height" $height
"maxheight" $maxheight
"maxwidth" $maxwidth
"referrerpolicy" $referrerpolicy
"maxheight" $maxHeight
"maxwidth" $maxWidth
"referrerpolicy" $policy
"src" $src
"title" $description
"width" $width

@ -1,4 +1,4 @@
{{ $autoplay := .Get "autoplay" }}
{{ $autoPlay := .Get "autoplay" }}
{{ $controls := .Get "controls" | default true }}
{{ $description := .Get "description" | default "YouTube video" }}
{{ $end := .Get "end" }}
@ -6,10 +6,10 @@
{{ $height := .Get "height" }}
{{ $list := .Get "list" }}
{{ $loop := .Get "loop" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $maxHeight := .Get "maxheight" }}
{{ $maxWidth := .Get "maxwidth" }}
{{ $mute := .Get "mute" }}
{{ $referrerpolicy := .Get "referrerpolicy" | default "no-referrer-when-downgrade" }}
{{ $policy := .Get "referrerpolicy" | default "no-referrer-when-downgrade" }}
{{ $start := .Get "start" }}
{{ $video := .Get 0 | default (.Get "video") | default "dQw4w9WgXcQ" }}
{{ $width := .Get "width" }}
@ -30,7 +30,7 @@
{{ $params := slice (print "hl=" (site.LanguageCode | default site.Language.Lang)) "modestbranding=1" }}
{{ if $autoplay }}
{{ if $autoPlay }}
{{ $params = $params | append "autoplay=1" | append "mute=1" }}
{{ end }}
@ -74,9 +74,9 @@
{{ partial "paige/video.html" (dict
"fullscreen" $fullscreen
"height" $height
"maxheight" $maxheight
"maxwidth" $maxwidth
"referrerpolicy" $referrerpolicy
"maxheight" $maxHeight
"maxwidth" $maxWidth
"referrerpolicy" $policy
"src" $src
"title" $description
"width" $width

Loading…
Cancel
Save