🎨 Code cleanup

This commit is contained in:
James Panther
2023-12-26 11:22:55 +11:00
parent 4c8e536b64
commit 6415614513
33 changed files with 154 additions and 102 deletions
+4 -4
View File
@@ -6,8 +6,8 @@
{{ $file := $url.Path }}
{{ $img := .Page.Resources.GetMatch $file }}
{{- if and (not $img) .Page.File }}
{{ $path := path.Join .Page.File.Dir $file }}
{{ $img = resources.Get $path }}
{{ $path := path.Join .Page.File.Dir $file }}
{{ $img = resources.Get $path }}
{{ end -}}
{{/* https://github.com/gohugoio/hugo/pull/10666 */}}
@@ -15,14 +15,14 @@
{{- $x2Param := $params.Get "2x" -}}
{{- $x2 := false -}}
{{- if eq $x2Param "true" -}}
{{- $x2 = true -}}
{{- $x2 = true -}}
{{- end -}}
<figure>
{{- with $img -}}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "x2" $x2) }}
{{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}" />
{{- end -}}
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure>