From 42c8881d7eb07d3cf703186af9dc4938fff3e415 Mon Sep 17 00:00:00 2001 From: sakrecoer Date: Mon, 3 Aug 2020 00:11:26 +0200 Subject: [PATCH] xml escape SEO --- _includes/seo.html | 168 ++++++++++++++++++++++++++++++++------------- 1 file changed, 122 insertions(+), 46 deletions(-) diff --git a/_includes/seo.html b/_includes/seo.html index da66033..b2aed32 100644 --- a/_includes/seo.html +++ b/_includes/seo.html @@ -28,9 +28,9 @@ {% if page.collection == 'tracks' %} -Play {{ page.common.title }} by {{ page.common.artist }} | {{ site.title }} - - +Play {{ page.common.title | xml_escape }} by {{ page.common.artist | xml_escape }} | {{ site.title | xml_escape }} + + @@ -40,31 +40,31 @@ - + - - + + - - - + + + - + - + - + - + @@ -72,8 +72,8 @@ - - + + @@ -86,9 +86,9 @@ {% capture namelist %}{% for art in album.artists %}{{ art }}{% unless forloop.last %}, {% endunless %}{% endfor %}{% endcapture %} {% capture artist %}{{ namelist }}{% endcapture %} -Play "{{ album.name }}" by {{ artist | uniq }} | {{ site.title }} - - +Play "{{ album.name | xml_escape }}" by {{ artist | xml_escape | uniq }} | {{ site.title | xml_escape }} + + @@ -98,31 +98,31 @@ - + - - + + - - - + + + - + - + - + - + {% for track in album.tracks %}{% endfor %} @@ -131,14 +131,15 @@ - - + + -{% endif %}{% endfor %}{% else %} +{% endif %}{% endfor %} +{% elsif page.category == 'ramblings' %} {{ page.title }} | {{ site.title }} - + @@ -156,32 +157,32 @@ - - + + - - - + + + - + - + - + - + - - + + @@ -192,14 +193,14 @@ { "@context": "http://www.schema.org", "@type": "Organization", - "name": "{{ site.title }}", - "url": "{{ site.url }}", + "name": "{{ site.title | xml_escape }}", + "url": "{{ site.url | xml_escape }}", "sameAs": [ {% for social in site.social.links %}"{{ social }}"{% unless forloop.last %},{% endunless %}{% endfor %} ], "logo": "{{ site.url }}/siteicon.png", "image": "{{ site.url }}{{ page.image }}", - "description": "{{ site.description | strip_html }}", + "description": "{{ site.description | xml_escape }}", "address": { "@type": "PostalAddress", "addressLocality": "{{ site.geo.town }}", @@ -210,6 +211,81 @@ } {% endif %} +{% else %} + + +{{ page.title }} | {{ site.title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% endif %}