Skip to content

Commit

Permalink
🛠 fix: Syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
tomy0000000 committed May 26, 2023
1 parent 88c73a3 commit 0d4fe03
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{{ $url := urls.Parse .Destination }}
{{ $altText := .Text }}
{{ $caption := .Title }}
{{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ if findRE "^https?" $url.Scheme }}
<figure>
<img
class="mx-auto my-0 rounded-md"
src="{{ $url.String }}"
alt="{{ $altText }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
Expand Down Expand Up @@ -39,7 +40,7 @@
{{ end }}
{{ end }}
alt="{{ $altText }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
Expand All @@ -51,7 +52,7 @@
class="mx-auto my-0 rounded-md"
src="{{ $url.String }}"
alt="{{ $altText }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ end }}
{{ end }}
alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/article-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
160w, {{- (.Fill "320x240 smart").RelPermalink }} 2x"
src="{{ (.Fill "160x120 smart").RelPermalink }}"
{{ end }}
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
height="96"
alt="{{ $.Site.Author.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/home/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
height="144"
alt="{{ $.Site.Author.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
Expand Down

0 comments on commit 0d4fe03

Please sign in to comment.