From 853d809afa33eb54175698889adbbc5260165e0b Mon Sep 17 00:00:00 2001 From: Austin Seraphin Date: Mon, 24 Jul 2017 01:33:28 -0400 Subject: [PATCH 1/2] Added support for an alt tag for the header image This allows using page.header.image_description as the alt tag. It will still default to site.title if unset. --- _includes/page__hero.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_includes/page__hero.html b/_includes/page__hero.html index 24488932ae5f..97090d0721ac 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -45,7 +45,11 @@

{% endif %} {% else %} + {% if page.header.image_description %} + {{ page.header.image_description }} + {% else %} {{ page.title }} + {% endif %} {% endif %} {% if page.header.caption %} {{ page.header.caption | markdownify | remove: "

" | remove: "

" }}
From 04e13c3b2b7ba225bf2f17a030cbaf2f65cd388c Mon Sep 17 00:00:00 2001 From: Austin Seraphin Date: Mon, 24 Jul 2017 01:44:31 -0400 Subject: [PATCH 2/2] Added documentation --- docs/_docs/10-layouts.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/_docs/10-layouts.md b/docs/_docs/10-layouts.md index 5285fcf06cb9..39f8b288f282 100644 --- a/docs/_docs/10-layouts.md +++ b/docs/_docs/10-layouts.md @@ -273,6 +273,14 @@ header: image: http://some-site.com/assets/images/image.jpg ``` +To provide a custom alt tag for screen readers: + +```yaml +header: + image: /assets/images/unsplash-image-1.jpg + image_description: "A description of the image" +``` + To include a caption or attribution for the image: ```yaml