1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-20 21:21:16 -04:00

strip any markdown in page titles from meta/social tags in head

This commit is contained in:
2020-08-10 10:58:22 -04:00
parent 9b5a29be7b
commit 0f9de4d350
12 changed files with 40 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
{{ partial "functions/meta-scratch" . -}}
{{ partial "head/meta" . -}}
{{ partial "functions/social-images" . -}}
{{ partial "head/open-graph" . -}}
{{ partialCached "head/mobile" . -}}
{{ partialCached "head/preload" . -}}

View File

@@ -1,6 +1,6 @@
<meta charset="utf-8">
{{ hugo.Generator }}
<title>{{ .Title }}{{ if not .IsHome }}  {{ .Site.Title }}{{ else }} 👨‍💻{{ end }}</title>
<title>{{ .Scratch.Get "plainTitle" }}{{ if not .IsHome }}  {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
{{ with .Site.Author.name }}<meta name="author" content="{{ . }}">{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@@ -1,4 +1,4 @@
<meta property="og:title" content="{{ .Title }}">
<meta property="og:title" content="{{ .Scratch.Get "plainTitle" }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:type" content="{{ if and .IsPage (eq .Type .Site.Params.mainSection) }}article{{ else }}website{{ end }}">
<meta property="og:locale" content="en_US">
@@ -10,7 +10,7 @@
<meta property="og:image:type" content="{{ .MediaType }}">
<meta property="og:image:width" content="{{ .Width }}">
<meta property="og:image:height" content="{{ .Height }}">
<meta property="og:image:alt" content="{{ $.Title }}">
<meta property="og:image:alt" content="{{ $.Scratch.Get "plainTitle" }}">
{{ end -}}
{{- if and .IsPage (eq .Type .Site.Params.mainSection) }}

View File

@@ -4,8 +4,8 @@
"@type": "BlogPosting",
"url": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
"mainEntityOfPage": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
"name": {{ .Title }},
"headline": {{ .Title }},
"name": {{ .Scratch.Get "plainTitle" }},
"headline": {{ .Scratch.Get "plainTitle" }},
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
"dateModified": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
"keywords": {{ with .Params.tags }}{{ delimit . ", " }}{{ end }},