2024-02-26 18:22:30 +00:00
|
|
|
{{- $cover := ($.Resources.ByType "image").GetMatch "{*cover*,*thumbnail*,*featured*}" -}}
|
|
|
|
{{ $icon := resources.GetMatch (default "" .Site.Params.icon) -}}
|
2024-06-05 17:27:40 +00:00
|
|
|
{{- $staticIcon := "icon.png" | absURL -}}
|
|
|
|
{{- $author := index ($.GetTerms "authors") 0 -}}
|
2024-02-26 18:22:30 +00:00
|
|
|
|
2024-02-26 11:41:39 +00:00
|
|
|
{{/*=== title ===*/}}
|
|
|
|
{{ "<!-- text -->" | safeHTML }}
|
|
|
|
{{- with .Site.Title }}
|
|
|
|
<meta name="application-name" property="og:site_name" content="{{ . }}" />
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .IsHome}}
|
2024-02-27 08:57:09 +00:00
|
|
|
{{- with or .Params.name .Site.Title }}
|
2024-02-27 08:40:59 +00:00
|
|
|
<title>{{ . }}</title>
|
|
|
|
<meta property="og:title" name="twitter:title" itemprop="name" content="{{ . }}" />
|
2024-02-27 08:57:09 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- else }}
|
2024-06-03 23:22:36 +00:00
|
|
|
<title>{{ or .Params.name (print .Title " - " .Site.Title) }}</title>
|
|
|
|
<meta property="og:title" name="twitter:title" itemprop="name" content="{{ or .Params.name .Title }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*=== description ===*/}}
|
|
|
|
{{- with or .Description .Summary .Site.Params.description }}
|
2024-02-27 08:40:59 +00:00
|
|
|
<meta name="description" itemprop="description" property="og:description" content="{{ . }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
<meta name="twitter:description" content="{{ . }}" />
|
|
|
|
{{- end }}
|
|
|
|
{{ "<!-- url -->" | safeHTML }}
|
|
|
|
{{- with .Permalink | absURL}}
|
2024-02-27 08:40:59 +00:00
|
|
|
<base href="{{ . }}" />
|
|
|
|
<link rel="canonical" href="{{ or $.Params.canonical . }}" />
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta name="url" property="og:url" itemprop="url" content="{{ . }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
<meta name="twitter:url" content="{{ . }}" />
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*=== image ===*/}}
|
|
|
|
{{- with or $cover $icon }}
|
|
|
|
{{ "<!-- image -->" | safeHTML }}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta property="og:image" itemprop="image" content="{{ .Permalink | absURL }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- with .Width }}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta property="og:image:width" content="{{ . }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- with .Height }}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta property="og:image:height" content="{{ . }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end }}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta name="twitter:image" content="{{ .Permalink | absURL }}" />
|
|
|
|
<meta name="twitter:image:src" content="{{ .Permalink | absURL }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- else }}
|
|
|
|
{{ "<!-- image -->" | safeHTML }}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta property="og:image" itemprop="image" content="{{ $staticIcon }}" />
|
|
|
|
<meta name="twitter:image" content="{{ $staticIcon }}" />
|
|
|
|
<meta name="twitter:image:src" content="{{ $staticIcon }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
2024-02-27 09:13:58 +00:00
|
|
|
{{/*=== extra params? ===*/}}
|
|
|
|
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
|
|
|
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
|
|
|
|
{{- with .Params.videos }}{{- range . }}
|
|
|
|
<meta property="og:video" content="{{ . | absURL }}" />
|
2024-06-05 17:27:40 +00:00
|
|
|
{{ end }}{{ end -}}
|
2024-02-26 11:41:39 +00:00
|
|
|
|
|
|
|
{{/*=== section and keywords ===*/}}
|
2024-06-05 17:27:40 +00:00
|
|
|
{{ "<!-- keywords -->" | safeHTML }}
|
|
|
|
{{- with .Params.categories }}
|
|
|
|
{{- range . }}
|
2024-02-26 11:41:39 +00:00
|
|
|
<meta property="article:section" content="{{ . }}" />
|
2024-06-05 17:27:40 +00:00
|
|
|
{{- end }}
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- with .Params.tags }}
|
2024-02-27 09:13:58 +00:00
|
|
|
<meta property="article:tag" itemprop="keywords" name="keywords" content='{{ delimit . " "}}' />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
2024-06-05 17:27:40 +00:00
|
|
|
{{ if .Date }}
|
2024-02-26 11:41:39 +00:00
|
|
|
{{ "<!-- article metadata -->" | safeHTML }}
|
|
|
|
<meta property="og:type" content="article" />
|
2024-06-05 17:27:40 +00:00
|
|
|
{{ with $author -}}
|
|
|
|
<meta name="author" property="article:author" content="{{ .Title }}" />
|
|
|
|
{{- end }}
|
|
|
|
<meta property="article:publisher" content="{{ .Site.BaseURL }}" />
|
|
|
|
{{ with .Date -}}
|
|
|
|
<meta property="article:published_time" itemprop="datePublished" content={{ .Format "2006-01-02T15:04:05Z" | safeHTML }} />
|
|
|
|
{{ end -}}
|
|
|
|
{{ with .Lastmod -}}
|
|
|
|
<meta property="article:modified_time" itemprop="dateModified" content={{ .Format "2006-01-02T15:04:05Z" | safeHTML }} />
|
|
|
|
{{ end -}}
|
2024-02-27 08:40:59 +00:00
|
|
|
<meta itemprop="wordCount" content="{{ .WordCount }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
<script defer type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "Article",
|
2024-06-03 23:22:36 +00:00
|
|
|
"headline": {{ .Title }},
|
2024-06-05 17:27:40 +00:00
|
|
|
{{- with $author }}
|
2024-02-26 11:41:39 +00:00
|
|
|
"author": {
|
|
|
|
"@type": "Person",
|
2024-06-05 17:27:40 +00:00
|
|
|
"name": {{ .Title }},
|
|
|
|
"url": {{ .Permalink }},
|
|
|
|
{{- with .Resources.GetMatch "avatar" }}
|
|
|
|
"image": {
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"url": {{ .Permalink }}
|
|
|
|
}
|
|
|
|
{{- end }}
|
2024-02-26 11:41:39 +00:00
|
|
|
},
|
2024-06-05 17:27:40 +00:00
|
|
|
{{- end }}
|
|
|
|
"datePublished": {{ .Date.UTC.Format "2006-01-02T15:04:05Z" }},
|
2024-02-26 18:22:30 +00:00
|
|
|
"description": {{ (or .Description .Summary) | plainify }},
|
2024-02-26 11:41:39 +00:00
|
|
|
"wordCount": {{ .WordCount }},
|
2024-02-26 16:52:41 +00:00
|
|
|
"mainEntityOfPage": {{.Permalink}},
|
2024-06-05 17:27:40 +00:00
|
|
|
"dateModified": "{{ .Lastmod.UTC.Format "2006-01-02T15:04:05Z" }}",
|
2024-02-26 11:41:39 +00:00
|
|
|
"image": {
|
|
|
|
"@type": "ImageObject",
|
2024-02-26 16:52:41 +00:00
|
|
|
"url": {{ with or $cover $icon }}{{ .Permalink | absURL }}{{ end }}
|
2024-02-26 11:41:39 +00:00
|
|
|
},
|
|
|
|
"publisher": {
|
2024-02-26 16:57:59 +00:00
|
|
|
"@type": "WebSite",
|
|
|
|
"name": {{ .Site.Title }},
|
|
|
|
"url": {{ .Site.BaseURL }},
|
2024-02-27 09:07:00 +00:00
|
|
|
"image": {
|
2024-02-26 11:41:39 +00:00
|
|
|
"@type": "ImageObject",
|
|
|
|
"url": {{with $icon}}{{.Permalink}}{{else}}{{$staticIcon}}{{end}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{- else }}
|
|
|
|
{{ "<!-- webpage metadata -->" | safeHTML }}
|
|
|
|
<meta property="og:type" content="website" />
|
2024-06-05 17:27:40 +00:00
|
|
|
<meta name="author" content="{{ .Site.Params.author.name }}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
<script defer type="application/ld+json">
|
2024-02-26 18:22:30 +00:00
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "WebPage",
|
|
|
|
"name": {{ .Title }},
|
|
|
|
"url": {{ .Permalink }},
|
|
|
|
"description": {{ (or .Description .Summary) | plainify }},
|
2024-02-27 09:07:00 +00:00
|
|
|
"image": {
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"url": {{with $icon}}{{.Permalink}}{{else}}{{$staticIcon}}{{end}}
|
|
|
|
}
|
2024-02-26 18:22:30 +00:00
|
|
|
}
|
2024-02-26 11:41:39 +00:00
|
|
|
</script>
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* auxiliary info */}}
|
|
|
|
{{ "<!-- site presentation -->" | safeHTML }}
|
2024-06-05 17:27:40 +00:00
|
|
|
{{- with $icon }}
|
2024-02-27 08:40:59 +00:00
|
|
|
<link rel="shortcut icon" href='{{ .Permalink }}' sizes="{{.Width}}x{{.Height}}" />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- else -}}
|
2024-06-05 17:27:40 +00:00
|
|
|
<link rel="shortcut icon" href='{{ $staticIcon }}' />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{- end }}
|
|
|
|
<meta name="theme-color" content="#ffffff" />
|
|
|
|
<meta name="msapplication-TileColor" content="#ffffff" />
|
|
|
|
<link rel="sitemap" type="application/xml" title="Sitemap" href="{{ .Site.BaseURL }}sitemap.xml" />
|
|
|
|
{{ with .OutputFormats.Get "RSS" -}}
|
|
|
|
<link href="{{ .Permalink }}" rel="feed alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
|
2024-02-26 16:57:59 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* robots */}}
|
2024-06-05 17:27:40 +00:00
|
|
|
{{- "<!-- robots -->" | safeHTML }}
|
2024-02-26 11:41:39 +00:00
|
|
|
<meta name="robots" content="index,follow" />
|
|
|
|
<meta name="googlebot" content="index,follow" />
|