From a46b790a62c75ecfb178ca34e19dbda2d99ef29f Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 31 May 2022 20:48:41 -0700 Subject: [PATCH] Remove microdata from feeds It's useless and invalid in those contexts, and removing it significantly trims the file sizes. Edit a post featuring a microdata code snippet to avoid conflicts. --- content/posts/website-best-practices.md | 2 +- layouts/_default/list.atom.xml | 2 +- layouts/_default/rss.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/posts/website-best-practices.md b/content/posts/website-best-practices.md index 6c8d5af..597013e 100644 --- a/content/posts/website-best-practices.md +++ b/content/posts/website-best-practices.md @@ -1010,7 +1010,7 @@ When setting max line lengths, use a CSS media query to ensure that printed vers padding: 0 3%; } - div[itemprop="articleBody"] { + div[itemprop='articleBody'] { margin: auto; max-width: 36em; } diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 196b50e..ab2f0bf 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -28,7 +28,7 @@ CC-BY-SA 4.0 by Rohan Kumar
- {{ partial "processed-content.html" . | safeHTML }} + {{ partial "processed-content.html" . | replaceRE `(?: )?item(scope|prop|id|ref)="[^"]*"` "" | safeHTML }}
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 5cc2c28..d090aca 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -35,7 +35,7 @@ {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} - {{- .Content | html -}} + {{- .Content | replaceRE `(?: )?item(scope|prop|id|ref)="[^"]*"` "" | html -}} {{ end }} {{ end }}