mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
chore(imageJSON.html): add alt attribute to images in imageJSON partial to improve accessibility
This commit is contained in:
@@ -6,4 +6,6 @@ menu:
|
||||
main:
|
||||
weight: 3
|
||||
identifier: Erwitt
|
||||
title: Erwitt
|
||||
unifiedAlt: '© Elliott Erwitt'
|
||||
---
|
||||
|
||||
@@ -6,4 +6,6 @@ menu:
|
||||
main:
|
||||
weight: 1
|
||||
identifier: Gruyaert
|
||||
title: Gruyaert
|
||||
unifiedAlt: '© Harry Gruyaert'
|
||||
---
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
---
|
||||
type: _default
|
||||
layout: single
|
||||
url: /info/
|
||||
url: /Info/
|
||||
menu:
|
||||
main:
|
||||
weight: 4
|
||||
identifier: Info
|
||||
title: Info
|
||||
unifiedAlt: ''
|
||||
---
|
||||
|
||||
Bridget is a _minimal_ Hugo theme designed for photographers / visual artists.
|
||||
@@ -6,4 +6,6 @@ menu:
|
||||
main:
|
||||
weight: 2
|
||||
identifier: Webb
|
||||
title: Webb
|
||||
unifiedAlt: '© Alex Webb'
|
||||
---
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
{{- $Page := .Page -}}
|
||||
{{- $params := .Page.Params | merge .Site.Params.Page -}}
|
||||
|
||||
{{ $gallery := site.GetPage .Path }}
|
||||
{{ with $gallery.Resources.ByType "image" }}
|
||||
{{ $index := len . }}
|
||||
{{ $Page.Scratch.Add "img" slice }}
|
||||
{{ range . }}
|
||||
{{ $index = sub $index 1 }}
|
||||
{{ $lores := .Resize "800x webp Lanczos q60" }}
|
||||
{{ $hires := .Resize "2500x webp Lanczos q75" }}
|
||||
{{ $Page.Scratch.Add "img" (dict
|
||||
{{- $gallery := site.GetPage .Path -}}
|
||||
{{- with $gallery.Resources.ByType "image" -}}
|
||||
{{- $index := len . -}}
|
||||
{{- $Page.Scratch.Add "img" slice -}}
|
||||
{{- range sort . "Name" "desc" -}}
|
||||
{{- $image := . -}}
|
||||
{{- $index = sub $index 1 -}}
|
||||
{{- $alt := .Name -}}
|
||||
{{- with $params.unifiedAlt -}}
|
||||
{{- $alt = . -}}
|
||||
{{- end -}}
|
||||
{{- $lores := .Resize "800x webp Lanczos q60" -}}
|
||||
{{- $hires := .Resize "2500x webp Lanczos q75" -}}
|
||||
{{- $Page.Scratch.Add "img" (dict
|
||||
"index" (int $index)
|
||||
"alt" (string $alt)
|
||||
"loUrl" (string $lores.RelPermalink)
|
||||
"loImgH" (int $lores.Height)
|
||||
"loImgW" (int $lores.Width)
|
||||
@@ -17,7 +24,7 @@
|
||||
"hiImgH" (int $hires.Height)
|
||||
"hiImgW" (int $hires.Width)
|
||||
)
|
||||
}}
|
||||
-}}
|
||||
{{- end -}}
|
||||
<script id="imagesSource" type="application/json">{{ $Page.Scratch.Get "img" | jsonify | safeJS }}</script>
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user