]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/tplimpl: Trim descriptions rather than just chomp
authorPatrice Chalin <chalin@users.noreply.github.com>
Sat, 12 Oct 2024 20:41:42 +0000 (16:41 -0400)
committerGitHub <noreply@github.com>
Sat, 12 Oct 2024 20:41:42 +0000 (22:41 +0200)
tpl/tplimpl/embedded/templates/opengraph.html
tpl/tplimpl/embedded/templates/schema.html
tpl/tplimpl/embedded/templates/twitter_cards.html

index 59e63d6be56676dd3ddf37397b27be6eaf6adf72..9f40aedf08374803eae2b91749b2cbdefead4c98 100644 (file)
@@ -8,8 +8,8 @@
   <meta property="og:title" content="{{ . }}">
 {{- end }}
 
-{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
-  <meta property="og:description" content="{{ . }}">
+{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
+  <meta property="og:description" content="{{ trim . "\n\r\t " }}">
 {{- end }}
 
 {{- with or .Params.locale site.Language.LanguageCode }}
index 2b3c5425aeb5e7bace28c357c9fd1436177d96cd..36c01178b769493c1f86c281404a198bad024626 100644 (file)
@@ -2,8 +2,8 @@
   <meta itemprop="name" content="{{ . }}">
 {{- end }}
 
-{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
-  <meta itemprop="description" content="{{ . }}">
+{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
+  <meta itemprop="description" content="{{ trim . "\n\r\t " }}">
 {{- end }}
 
 {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
index 6f156c7a7775ecd636a88ecee2405abd30af6034..8af0e986cf5e53a80887df636898c6884b5fe7f4 100644 (file)
@@ -10,8 +10,8 @@
   <meta name="twitter:title" content="{{ . }}">
 {{- end }}
 
-{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
-  <meta name="twitter:description" content="{{ . }}">
+{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
+  <meta name="twitter:description" content="{{ trim . "\n\r\t " }}">
 {{- end }}
 
 {{- $twitterSite := "" }}