diff options
author | Patrice Chalin <[email protected]> | 2024-10-12 16:41:42 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-12 22:41:42 +0200 |
commit | 039845804fd545de18a3c4f17f8f7b3ad3bf615b (patch) | |
tree | e796c0a0eb16099cd706f453e25d6cb273a4ec5e | |
parent | 9b635522e28e507c49e558e537157c932398981c (diff) | |
download | hugo-039845804fd545de18a3c4f17f8f7b3ad3bf615b.tar.gz hugo-039845804fd545de18a3c4f17f8f7b3ad3bf615b.zip |
tpl/tplimpl: Trim descriptions rather than just chomp
-rw-r--r-- | tpl/tplimpl/embedded/templates/opengraph.html | 4 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/schema.html | 4 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/twitter_cards.html | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html index 59e63d6be..9f40aedf0 100644 --- a/tpl/tplimpl/embedded/templates/opengraph.html +++ b/tpl/tplimpl/embedded/templates/opengraph.html @@ -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 }} diff --git a/tpl/tplimpl/embedded/templates/schema.html b/tpl/tplimpl/embedded/templates/schema.html index 2b3c5425a..36c01178b 100644 --- a/tpl/tplimpl/embedded/templates/schema.html +++ b/tpl/tplimpl/embedded/templates/schema.html @@ -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" }} diff --git a/tpl/tplimpl/embedded/templates/twitter_cards.html b/tpl/tplimpl/embedded/templates/twitter_cards.html index 6f156c7a7..8af0e986c 100644 --- a/tpl/tplimpl/embedded/templates/twitter_cards.html +++ b/tpl/tplimpl/embedded/templates/twitter_cards.html @@ -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 := "" }} |