mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2026-05-21 11:05:49 +00:00
87de3fb024
* feat(layouts): move all files in layouts/_default up to the layouts/ root. * feat(layouts): rename layouts/partials folder to layouts/_partials * feat(layouts): rename layouts/shortcodes folder to layouts/_shortcodes * feat(taxonomy): add new taxonomy layout template A template named taxonomy.html used to be a candidate for both Page kind term and taxonomy, now it’s only considered for taxonomy.
38 lines
1.2 KiB
HTML
38 lines
1.2 KiB
HTML
{{- if .Params.cover.image -}}
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
{{- if (ne $.Params.cover.relative true) }}
|
|
<meta name="twitter:image" content="{{ .Params.cover.image | absURL }}">
|
|
{{- else }}
|
|
<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 }}
|
|
{{- 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 }}
|
|
<meta name="twitter:description" content="{{ trim . "\n\r\t " }}">
|
|
{{- end }}
|
|
|
|
{{- $twitterSite := "" }}
|
|
{{- with site.Params.social }}
|
|
{{- if reflect.IsMap . }}
|
|
{{- with .twitter }}
|
|
{{- $content := . }}
|
|
{{- if not (strings.HasPrefix . "@") }}
|
|
{{- $content = printf "@%v" . }}
|
|
{{- end }}
|
|
<meta name="twitter:site" content="{{ $content }}">
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|