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

7
layouts/_default/single.html

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

13
layouts/authors/terms.html

@ -2,13 +2,20 @@
<section> <section>
<h1 class="center-text">Authors</h1> <h1 class="center-text">Authors</h1>
{{- range .Data.Pages }} {{- range .Data.Pages }}
{{- $title := .Params.name }}
{{- $summary := .Params.bio }}
{{- with (.Resources.GetMatch "avatar") }}
{{- partial "article-alt.html" {{- partial "article-alt.html"
(dict (dict
"image" (.Resources.GetMatch "avatar") "image" .
"alt" .Params.alt "alt" .Params.alt
"title" .Params.name "title" $title
"summary" .Params.bio "summary" $summary
"url" (printf "/%s/%s" "authors" (.Params.name | urlize))) }} "url" (printf "/%s/%s" "authors" (.Params.name | urlize))) }}
{{- end }} {{- end }}
{{- end }}
</section> </section>
{{ end }} {{ 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"> <article class="index float-on-hover shadow">
<a href=" {{ .Permalink }}"> <a href=" {{ .Permalink }}">
{{- with $img }} {{- with (.Resources.GetMatch "featured") }}
{{- $resized := .Resize "256x webp q90" }} {{- $resized := .Resize "256x webp q90" }}
<img src={{ $resized.RelPermalink }} alt="{{ $alt }}"> <img src={{ $resized.RelPermalink }} alt="{{ .Params.alt }}">
{{- end }} {{- end }}
<h3 class="title">{{ .Title | markdownify }}</h3> <h3 class="title">{{ .Title | markdownify }}</h3>
</a> </a>

Loading…
Cancel
Save