From 70e0a6a01a1960877214f49420b0d75df23ba974 Mon Sep 17 00:00:00 2001 From: James Ives Date: Sun, 24 Feb 2019 19:02:52 -0500 Subject: [PATCH 1/2] Adds Description Tag --- _includes/header.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_includes/header.html b/_includes/header.html index 77ee9a1..47a4df8 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -10,10 +10,17 @@ {% assign user = site.github.owner %} +{% if page.path contains '_posts' %} + {% assign meta_description = page.content | strip_html | strip_newlines | truncate: 300 %} +{% else %} + {% assign meta_description = user.bio | strip_html | strip_newlines | truncate: 300 %} +{% endif %} + + {{ user.name }} From 528fa94d3b6854f8583e333a418d5f94c7ad1a2c Mon Sep 17 00:00:00 2001 From: James Ives Date: Mon, 25 Feb 2019 10:10:33 -0500 Subject: [PATCH 2/2] Escaping XML --- _includes/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/header.html b/_includes/header.html index 47a4df8..73f38b0 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -11,9 +11,9 @@ {% assign user = site.github.owner %} {% if page.path contains '_posts' %} - {% assign meta_description = page.content | strip_html | strip_newlines | truncate: 300 %} + {% assign meta_description = page.content | strip_html | strip_newlines | xml_escape | truncate: 300 %} {% else %} - {% assign meta_description = user.bio | strip_html | strip_newlines | truncate: 300 %} + {% assign meta_description = user.bio | strip_html | strip_newlines | xml_escape | truncate: 300 %} {% endif %}