🎨 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>
@@ -14,4 +14,5 @@
{{ end -}}
{{ end -}}
{{ end -}}
<!-- prettier-ignore -->
<a href="{{ $link | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $isRemote }} target="_blank" rel="noreferrer"{{ end }}>{{- .Text | safeHTML -}}</a>
+1 -1
View File
@@ -1,6 +1,6 @@
{{- partial "partials/functions/warnings.html" .Site -}}
{{- partial "partials/functions/init.html" . -}}
<!DOCTYPE html>
<!doctype html>
<html
lang="{{- site.Language.LanguageCode | default "" -}}"
dir="{{- site.Language.LanguageDirection | default "ltr" -}}"
+2 -1
View File
@@ -9,6 +9,7 @@
"summary" (.Summary | emojify | safeJS)
"content" (.Plain | emojify | safeJS)
"permalink" .RelPermalink
) -}}
)
-}}
{{- end -}}
{{- $index | jsonify -}}