Front matter has (e.g.):
featured_image: /images/picture.jpg
featured_image_caption: "Image: ImageSource" # quotation marks to allow colon
featured_image_alt: Alt tag for the featured image
Relevant code in the single.html
template is:
{{- if isset .Params "featured_image" }}
<img src="{{ index .Params "featured_image" }}" class="img-fluid featured-image" alt="{{ index .Params "featured_image_alt" }}">
{{- if isset .Params "featured_image_caption" }}
<p class="featured-image-caption">{{ index .Params "featured_image_caption" }}</p>
{{- end }}
{{- end }}
However, HTML output is not including featured_image_alt
:
<img src="/images/picture.jpg" class="img-fluid featured-image" alt="">
…so, obviously, I’m doing something wrong with the featured_image_alt
variable. Interestingly enough, I can substitute featured_image_caption
(or any other front matter variable) for featured_image_alt
and get that variable to appear — just not featured_image_alt
.
Suggestions? Help? Thanks, community.