diff --git a/README.md b/README.md index 9af3fa4..f3ae274 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,7 @@ Adding a cover image to your post is simple and there are two options when you e * Resulting in `https://www.yourpage.com/path/to/absolute/img.jpg` * Use `cover = "img.jpg"` and `useRelativeCover = true` to link the image relative to the blog post folder * Resulting in `https://www.yourpage.com/posts/blog-entry-xy/img.jpg` +* Use `coverAlt = "description of image"` to add custom alt text to the cover image (defaults to post or page title as alt text) * Use `coverCaption = "Image Credit to [Barry Bluejeans](https://unsplash.com/)"` to add a caption for the cover image. ## How to display the Last Modified Date in your posts diff --git a/layouts/_default/index.html b/layouts/_default/index.html index 739f38c..d349856 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -45,9 +45,9 @@ {{ if .Params.Cover }}
{{ if .Params.UseRelativeCover }} - {{ .Title | plainify | default + {{ .Params.CoverAlt | plainify | default .Title }} {{ else }} - {{ .Title | plainify | default + {{ .Params.CoverAlt | plainify | default .Title }} {{ end }} {{ if .Params.CoverCaption }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 39a6be0..c60d853 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -30,9 +30,9 @@ {{ if .Params.Cover }}
{{ if .Params.UseRelativeCover }} - {{ .Title | plainify | default + {{ .Params.CoverAlt | plainify | default .Title }} {{ else }} - {{ .Title | plainify | default + {{ .Params.CoverAlt | plainify | default .Title }} {{ end }} {{ if .Params.CoverCaption }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1e766ca..e94ef00 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -34,9 +34,9 @@ {{ if .Params.Cover }}
{{ if .Params.UseRelativeCover }} - {{ .Title | plainify | default + {{ .Params.CoverAlt | plainify | default .Title }} {{ else }} - {{ .Title | plainify | default + {{ .Params.CoverAlt | plainify | default .Title }} {{ end }} {{ if .Params.CoverCaption }}