Browse Source

fix alt tags

master
Alexander Avery 2 weeks ago
parent
commit
1fa35357d1
  1. 6
      layouts/_default/list.html
  2. 7
      layouts/_default/single.html
  3. 13
      layouts/authors/terms.html
  4. 6
      layouts/partials/article.html

6
layouts/_default/list.html

@ -16,12 +16,14 @@
<span><a href="{{ .Permalink }}">#{{ .LinkTitle }}</a></span>
{{- end }}
{{- with (.Resources.GetMatch "featured") }}
{{- partial "image.html"
(dict
"image" (.Resources.GetMatch "featured")
"alt" .Params.featured.alt
"image" .
"alt" .Params.alt
"sizes" (slice 320 480 600 800)
"classes" (slice "shadow" "featured")) }}
{{- end }}
{{ .Content }}
<section class="article-group author-articles">
{{- range .Data.Pages }}

7
layouts/_default/single.html

@ -16,13 +16,14 @@
<span><a href="{{ .Permalink }}">#{{ .LinkTitle }}</a></span>
{{- end }}
{{- with (.Resources.GetMatch "featured") }}
{{- partial "image.html"
(dict
"image" (.Resources.GetMatch "featured")
"alt" .Params.featured.alt
"image" .
"alt" .Params.alt
"sizes" (slice 320 480 600 800)
"classes" (slice "shadow" "featured")) }}
{{- end }}
{{ .Content }}
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ end }}

13
layouts/authors/terms.html

@ -2,13 +2,20 @@
<section>
<h1 class="center-text">Authors</h1>
{{- range .Data.Pages }}
{{- $title := .Params.name }}
{{- $summary := .Params.bio }}
{{- with (.Resources.GetMatch "avatar") }}
{{- partial "article-alt.html"
(dict
"image" (.Resources.GetMatch "avatar")
"image" .
"alt" .Params.alt
"title" .Params.name
"summary" .Params.bio
"title" $title
"summary" $summary
"url" (printf "/%s/%s" "authors" (.Params.name | urlize))) }}
{{- end }}
{{- end }}
</section>
{{ end }}

6
layouts/partials/article.html

@ -1,10 +1,8 @@
{{- $alt := .Params.featured.alt }}
{{- $img := .Resources.GetMatch "featured" }}
<article class="index float-on-hover shadow">
<a href=" {{ .Permalink }}">
{{- with $img }}
{{- with (.Resources.GetMatch "featured") }}
{{- $resized := .Resize "256x webp q90" }}
<img src={{ $resized.RelPermalink }} alt="{{ $alt }}">
<img src={{ $resized.RelPermalink }} alt="{{ .Params.alt }}">
{{- end }}
<h3 class="title">{{ .Title | markdownify }}</h3>
</a>

Loading…
Cancel
Save