Use camel case for vars
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user