{{ "" | safeHTML -}} {{- $author := cond (and .IsPage .Params.author) .Params.author site.Params.Author.Name }} {{- $siteTitle := or site.Title site.Params.title | plainify }} {{- $permalink := .Permalink }} {{- $title := cond .IsHome $siteTitle (printf "%s | %s" .Title $siteTitle) | plainify }} {{- $desc := or .Params.Subtitle .Params.Description .Description .Summary }} {{- $siteDesc := or site.Params.description site.Params.subtitle }} {{- if and .IsHome $siteDesc }} {{- $desc = $siteDesc }} {{- else if and (not .IsPage) $siteDesc }} {{- $desc = printf "%s | %s" .Kind $siteTitle }} {{- end }} {{- $desc = $desc | plainify | htmlUnescape | truncate 150 }} {{- $cover := partial "page/cover.html" (dict "page" .) }} {{- if and (not $cover) (not .IsPage) }} {{- $cover = or site.Params.images site.Params.socialCard }} {{- end }} {{- $keywords := dict }} {{- $tag := or .Params.keywords .Params.tags }} {{- if .IsHome }} {{- $keywords = slice (i18n "home") }} {{- else if $tag }} {{- $keywords = $tag }} {{- end }} {{ $title }} {{ with $desc -}} {{ end -}} {{ with $keywords -}} {{ end -}} {{ with .Translations -}} {{- range . -}} {{- end }} {{- end }} {{ with .Site.Params.favicon }} {{ end }} {{- $host := partial "partials/fediverse/instance.html" . }} {{- $user := partial "partials/fediverse/username.html" .}} {{ if and $host $user }} {{ end }} {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- $publishDate := .PublishDate.Format $ISO8601 }} {{- $lastMod := .Lastmod.Format $ISO8601 }} {{- $extMeta := or site.Params.extMeta site.Params.socialCard.enable }} {{- if or $extMeta site.Params.socialCard.twitter }} {{ template "twitterCard" (dict "page" . "title" $title "desc" $desc "cover" $cover) }} {{- end }} {{- if or $extMeta site.Params.socialCard.opengraph }} {{ template "openGraph" (dict "page" . "siteTitle" $siteTitle "author" $author "title" $title "desc" $desc "cover" $cover "keywords" $keywords "publishDate" $publishDate "lastMod" $lastMod) }} {{- end }} {{- if site.Params.socialCard.schema }} {{/* no HTMl props at the moment */}} {{- template "schema" (dict "page" . "title" $title "desc" $desc "cover" $cover "keywords" $keywords) }} {{- end }} {{- if site.Params.socialCard.jsonLD }} {{/* permalink needs workaround */}} {{- template "jsonLD" (dict "page" . "siteTitle" $siteTitle "permalink" $permalink "author" $author "title" $title "desc" $desc "cover" $cover "keywords" $keywords "publishDate" $publishDate "lastMod" $lastMod) }} {{- end }} {{- /*---------------------- end of meta.html ----------------------*/}} {{- define "openGraph" }} {{ "" | safeHTML -}} {{- $ISO8601 := "2006-01-02T15:04:05-07:00" }} {{- $facebookAdmin := site.Params.socialCard.facebookAdmin }} {{- $facebookAppID := site.Params.socialCard.facebookAppID }} {{- with .cover }} {{- end }} {{- if .IsPage -}} {{- with .publishDate }} {{- end }} {{ with .lastMod }} {{- end }} {{- with .keywords }} {{- end }} {{- with site.RegularPages.Related . | first 5 }} {{- range . }} {{- if ne $ . }} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }} {{- define "twitterCard" }} {{ "" | safeHTML -}} {{ $twitterCreator := site.Params.socialCard.twitterCreator }} {{ $twitterSite := site.Params.socialCard.twitterSite }} {{- with .cover }} {{- end }} {{- with $twitterSite }} {{- end }} {{- with $twitterCreator }} {{- end }} {{- end }} {{- define "schema" }} {{ "" | safeHTML -}} {{- with .title }} {{- end }} {{- with .desc }} {{- end }} {{- with .PublishDate }} {{- end }} {{- with .Lastmod }} {{- end }} {{- with .page.WordCount }} {{- end }} {{- with .cover }} {{- end }} {{- with .keywords }} {{- end -}} {{- end }} {{- define "jsonLD" }} {{ "" | safeHTML -}} {{- end }}