chore: unify variable naming conventions

This commit is contained in:
ZhenShuo Leo
2025-05-26 00:21:37 +08:00
parent 6ab1964e22
commit 86fa25f27f
+8 -8
View File
@@ -1,8 +1,8 @@
{{ define "inline-image-simple" -}} {{ define "RenderImageSimple" -}}
<img class="my-0 rounded-md" loading="lazy" alt="{{ .alt }}" src="{{ .src }}" /> <img class="my-0 rounded-md" loading="lazy" alt="{{ .alt }}" src="{{ .src }}" />
{{- end }} {{- end }}
{{ define "inline-image-responsive" -}} {{ define "RenderImageResponsive" -}}
<img <img
class="my-0 rounded-md" loading="lazy" decoding="async" fetchpriority="low" alt="{{ .alt }}" class="my-0 rounded-md" loading="lazy" decoding="async" fetchpriority="low" alt="{{ .alt }}"
srcset=" srcset="
@@ -14,7 +14,7 @@
/> />
{{- end }} {{- end }}
{{ define "inline-image-caption" -}} {{ define "RenderImageCaption" -}}
{{- with .caption }} {{- with .caption }}
<figcaption>{{ . | markdownify }}</figcaption> <figcaption>{{ . | markdownify }}</figcaption>
{{- end }} {{- end }}
@@ -33,18 +33,18 @@
<figure> <figure>
{{- if $isRemote }} {{- if $isRemote }}
{{ template "inline-image-simple" (dict "src" $url.String "alt" $altText) }} {{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}
{{- else if $resource }} {{- else if $resource }}
{{- $isSVG := eq $resource.MediaType.SubType "svg" }} {{- $isSVG := eq $resource.MediaType.SubType "svg" }}
{{- $shouldOptimize := and (not $disableImageOptimization) (not $isSVG) }} {{- $shouldOptimize := and (not $disableImageOptimization) (not $isSVG) }}
{{- if $shouldOptimize }} {{- if $shouldOptimize }}
{{ template "inline-image-responsive" (dict "resource" $resource "alt" $altText) }} {{ template "RenderImageResponsive" (dict "resource" $resource "alt" $altText) }}
{{- else }} {{- else }}
{{ template "inline-image-simple" (dict "src" $resource.RelPermalink "alt" $altText) }} {{ template "RenderImageSimple" (dict "src" $resource.RelPermalink "alt" $altText) }}
{{- end }} {{- end }}
{{- else }} {{- else }}
{{ template "inline-image-simple" (dict "src" $url.String "alt" $altText) }} {{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}
{{- end }} {{- end }}
{{ template "inline-image-caption" (dict "caption" $caption) }} {{ template "RenderImageCaption" (dict "caption" $caption) }}
</figure> </figure>