From 28a29078d54b7c0ee1342f3c792d288e6a4099f7 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Mon, 24 Oct 2022 12:27:19 -0700 Subject: [PATCH] Fix overly long meta descriptions --- config.toml | 2 +- layouts/partials/head.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index cef82e5..e861c8d 100644 --- a/config.toml +++ b/config.toml @@ -111,7 +111,7 @@ disableKinds = ["taxonomy", "term"] baseName="atom" isPlainText = true mediaType = "application/xml" - + [outputformats.html] mediaType = "application/xhtml+xml" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 9d2ac2e..0270f6f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -42,7 +42,7 @@ {{- else if .IsHome -}} {{- $description = .Site.Params.Description -}} {{- else if .Summary -}} - {{- $description = .Summary | replaceRE `\n` ` ` | replaceRE `\’` `’` | replaceRE `\ ` `\ ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `\­` | replaceRE `‘` `‘` | safeHTML -}} + {{- $description = .Summary | replaceRE `\n` ` ` | replaceRE `\’` `’` | replaceRE `\ ` `\ ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `\­` | replaceRE `‘` `‘` | truncate 160 | replaceRE ` ([^ ]*)?$` `` | safeHTML -}} {{- end -}}