From efd5a5cb9e18316fba5a0028c770c93447a7c22b Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Wed, 6 Apr 2022 08:41:52 +0300 Subject: [PATCH 1/3] Add option to have alternative text for og_image --- _config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_config.yml b/_config.yml index ba2b50db9660..a4d6de58a852 100644 --- a/_config.yml +++ b/_config.yml @@ -85,6 +85,7 @@ facebook: app_id : publisher : og_image : # Open Graph/Twitter default site image +og_image_alt : # Alternative text for Open Graph/Twitter image for screen readers # For specifying social profiles # - https://developers.google.com/structured-data/customize/social-profiles social: From 50736afac89654149dddeda2e23d77597191bb8d Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Wed, 6 Apr 2022 08:44:40 +0300 Subject: [PATCH 2/3] Add Open Graph alt text --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 6cba47ff893c..caa51003b377 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -78,6 +78,7 @@ facebook: app_id : publisher : og_image : "/assets/images/site-logo.png" # Open Graph/Twitter default site image +og_image_alt : "Minimal mistakes logo" # Alternative text for screen readers # For specifying social profiles, used in _includes/seo.html # - https://developers.google.com/structured-data/customize/social-profiles social: From fc601d8c0b608e2d199874eca076bf98574980e4 Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Wed, 6 Apr 2022 08:55:17 +0300 Subject: [PATCH 3/3] Add alt text for OG image --- _includes/seo.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_includes/seo.html b/_includes/seo.html index c9d01e946a60..122192141387 100644 --- a/_includes/seo.html +++ b/_includes/seo.html @@ -41,6 +41,9 @@ {%- assign site_og_image = site.og_image | absolute_url -%} {%- assign site_og_image = site_og_image | escape -%} +{%- assign site_og_image_alt = site.og_image_alt -%} +{%- assign site_og_image_alt = site_og_image_alt | escape -%} + {%- if page.date -%} {%- assign og_type = "article" -%} {%- else -%} @@ -71,6 +74,7 @@ {% elsif page_teaser_image %} + {% endif %} {% if site.twitter.username %} @@ -86,6 +90,7 @@ {% if page_teaser_image %} + {% endif %} {% endif %}