mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2026-05-21 19:09:02 +00:00
[PATCH] tpl/tplimpl: Plainify title and description in twitter_cards.html
from https://github.com/gohugoio/hugo/commit/74ab839ccb397ea9df1c96d71c5347f49f2b231a
This commit is contained in:
committed by
Aditya Telange
parent
59984fa98f
commit
3f20d3cd77
@@ -6,16 +6,22 @@
|
||||
<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}">
|
||||
{{- end}}
|
||||
{{- else }}
|
||||
{{- $images := partial "templates/_funcs/get-page-images" . -}}
|
||||
{{- with index $images 0 -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ .Permalink }}">
|
||||
{{- else -}}
|
||||
<meta name="twitter:card" content="summary">
|
||||
{{- end -}}
|
||||
{{- $images := partial "templates/_funcs/get-page-images" . }}
|
||||
{{- with index $images 0 }}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ .Permalink }}">
|
||||
{{- else }}
|
||||
<meta name="twitter:card" content="summary">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with or .Title site.Title site.Params.title | plainify }}
|
||||
<meta name="twitter:title" content="{{ . }}">
|
||||
{{- end }}
|
||||
|
||||
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
|
||||
<meta name="twitter:description" content="{{ . }}">
|
||||
{{- end }}
|
||||
<meta name="twitter:title" content="{{ .Title }}">
|
||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">
|
||||
|
||||
{{- $twitterSite := "" }}
|
||||
{{- with site.Params.social }}
|
||||
|
||||
Reference in New Issue
Block a user