1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00

Fix overly long meta descriptions

This commit is contained in:
Rohan Kumar 2022-10-24 12:27:19 -07:00
parent 8358d7ac27
commit 28a29078d5
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 2 additions and 2 deletions

View file

@ -111,7 +111,7 @@ disableKinds = ["taxonomy", "term"]
baseName="atom" baseName="atom"
isPlainText = true isPlainText = true
mediaType = "application/xml" mediaType = "application/xml"
[outputformats.html] [outputformats.html]
mediaType = "application/xhtml+xml" mediaType = "application/xhtml+xml"

View file

@ -42,7 +42,7 @@
{{- else if .IsHome -}} {{- else if .IsHome -}}
{{- $description = .Site.Params.Description -}} {{- $description = .Site.Params.Description -}}
{{- else if .Summary -}} {{- 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 -}} {{- end -}}
<meta name="description" content="{{ $description }}" /> <meta name="description" content="{{ $description }}" />
<meta name="author" content="{{ .Site.Author.name }}" /> <meta name="author" content="{{ .Site.Author.name }}" />