Skip to content

Commit

Permalink
fix broken image titles
Browse files Browse the repository at this point in the history
  • Loading branch information
stebunovd committed Jan 3, 2025
1 parent df98e25 commit 7ea2997
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/}}
{{- partial "image.html" (dict
"Img" (.Page.Resources.Get .Destination)
"Title" .Title
"Alt" .Text
"Width" 698
) }}
</a>
4 changes: 2 additions & 2 deletions layouts/blog/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>Blog</h1>
{{ partial "image.html" (dict
"Img" $thumbnail
"Class" "blog--item-thumbnail"
"Title" $page.Title
"Alt" $page.Title
"Width" 450
) }}
</a>
Expand All @@ -41,7 +41,7 @@ <h1>Blog</h1>
{{ partial "image.html" (dict
"Img" $avatar
"Class" "blog--item-userpic"
"Title" .Params.author
"Alt" .Params.author
"Width" 24
) }}
{{ .Params.author }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/blog/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="article--title">{{ .Title }}</h1>
{{ partial "image.html" (dict
"Img" $avatar
"Class" "article--userpic"
"Title" .Params.author
"Alt" .Params.author
"Width" 24
) }}
</div>
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<picture>
{{- if $preview }}
<source srcset="{{ $previewWebp.RelPermalink }} 1x, {{ $webp.RelPermalink }} 2x" type="image/webp">
{{ $imgTag }} src="{{ $preview.RelPermalink }}" srcset="{{ .Img.RelPermalink }} 2x" alt="{{ .Title }}">
{{ $imgTag }} src="{{ $preview.RelPermalink }}" srcset="{{ .Img.RelPermalink }} 2x" alt="{{ .Alt }}">
{{- else }}
<source srcset="{{ $webp.RelPermalink }}" type="image/webp">
{{ $imgTag }} src="{{ .Img.RelPermalink }}" alt="{{ .Title }}">
{{ $imgTag }} src="{{ .Img.RelPermalink }}" alt="{{ .Alt }}">
{{- end }}
</picture>
{{- else }}
{{ $imgTag }} src="{{ .Img.RelPermalink }}" alt="{{ .Title }}">
{{ $imgTag }} src="{{ .Img.RelPermalink }}" alt="{{ .Alt }}">
{{- end }}

0 comments on commit 7ea2997

Please sign in to comment.