2024-02-26 11:41:39 +00:00
|
|
|
{{/*=== title ===*/}}
|
|
|
|
{{ "<!-- text -->" | safeHTML }}
|
|
|
|
{{- with .Site.Title }}
|
|
|
|
<meta name="application-name" property="og:site_name" content="{{ . }}" />
|
|
|
|
{{- end -}}
|
|
|
|
{{- $firstH1 := partial "name.html" . }}
|
|
|
|
{{- $title := or .Title $firstH1 $.File.ContentBaseName }}
|
|
|
|
{{- $name := or .Params.name (print $title " - " .Site.Title) }}
|
|
|
|
{{- if .IsHome}}
|
|
|
|
{{- $name = or .Params.name .Site.Title }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with $name }}
|
|
|
|
<title itemprop="name">{{ . }}</title>
|
|
|
|
<meta property="og:title" name="twitter:title" content="{{ . }}" />
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*=== description ===*/}}
|
|
|
|
{{- with or .Description .Summary .Site.Params.description }}
|
|
|
|
<meta name="description" itemprop="description" property="og:description" content="{{ . }}">
|
|
|
|
<meta name="twitter:description" content="{{ . }}" />
|
|
|
|
{{- end }}
|
|
|
|
{{ "<!-- url -->" | safeHTML }}
|
|
|
|
{{- with .Permalink | absURL}}
|
|
|
|
<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 ===*/}}
|
|
|
|
{{- $cover := ($.Resources.ByType "image").GetMatch "{*cover*,*thumbnail*,*featured*}" -}}
|
|
|
|
{{ $icon := resources.GetMatch (default "" .Site.Params.icon) -}}
|
|
|
|
{{- $staticIcon := "icon.png" | absURL -}}
|
|
|
|
{{- 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 -}}
|
|
|
|
|
|
|
|
{{/*=== author ===*/}}
|
|
|
|
{{ with or .Params.author .Site.Params.author -}}
|
|
|
|
{{ "<!-- author -->" | safeHTML }}
|
|
|
|
<meta property="article:publisher" content="{{ . }}" />
|
|
|
|
<meta property="og:article:author" content="{{ . }}" />
|
|
|
|
<meta property="article:author" content="{{ . }}" />
|
|
|
|
<meta name="author" content="{{ . }}" />
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*=== published and updated ===*/}}
|
2024-02-26 16:52:41 +00:00
|
|
|
{{ "<!-- time -->" | safeHTML -}}
|
2024-02-26 11:41:39 +00:00
|
|
|
{{ with .Date }}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta property="og:article:published_time" content={{ .Format "2006-01-02T03:04:05Z" | safeHTML }} />
|
|
|
|
<meta property="article:published_time" content={{ .Format "2006-01-02T03:04:05Z" | safeHTML }} />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{ end -}}
|
|
|
|
{{ with .Lastmod -}}
|
2024-02-26 16:52:41 +00:00
|
|
|
<meta property="og:updated_time" content={{ .Format "2006-01-02T03:04:05Z" | safeHTML }} />
|
2024-02-26 11:41:39 +00:00
|
|
|
{{ end -}}
|
|
|
|
|
|
|
|
{{/*=== section and keywords ===*/}}
|
|
|
|
{{- "<!-- keywords -->" | safeHTML }}
|
2024-02-26 16:52:41 +00:00
|
|
|
{{ with.Params.category -}}
|
2024-02-26 11:41:39 +00:00
|
|
|
<meta property="article:section" content="{{ . }}" />
|
|
|
|
{{- end -}}
|
|
|
|
{{- with .Params.tags }}
|
|
|
|
<meta name="keywords" content='{{ delimit . " "}}'>
|
|
|
|
{{- end -}}
|
|
|
|
|
2024-02-26 16:52:41 +00:00
|
|
|
{{- if isset .Params "date" }}
|
2024-02-26 11:41:39 +00:00
|
|
|
{{ "<!-- article metadata -->" | safeHTML }}
|
|
|
|
<meta property="og:type" content="article" />
|
|
|
|
<script defer type="application/ld+json">
|
|
|
|
{
|
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "Article",
|
|
|
|
"headline": {{ $title }},
|
|
|
|
"author": {
|
|
|
|
"@type": "Person",
|
2024-02-26 16:52:41 +00:00
|
|
|
"name": {{ or .Params.author .Site.Params.author }},
|
2024-02-26 16:57:59 +00:00
|
|
|
"url": {{ .Site.BaseURL }}
|
2024-02-26 11:41:39 +00:00
|
|
|
},
|
2024-02-26 16:52:41 +00:00
|
|
|
"datePublished": {{ .Date.UTC.Format "2006-01-02T03:04:05Z" }},
|
2024-02-26 11:41:39 +00:00
|
|
|
"description": {{ or .Description .Summary }},
|
|
|
|
"wordCount": {{ .WordCount }},
|
2024-02-26 16:52:41 +00:00
|
|
|
"mainEntityOfPage": {{.Permalink}},
|
|
|
|
"dateModified": "{{ .Lastmod.UTC.Format "2006-01-02T03: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-26 11:41:39 +00:00
|
|
|
"logo": {
|
|
|
|
"@type": "ImageObject",
|
|
|
|
"url": {{with $icon}}{{.Permalink}}{{else}}{{$staticIcon}}{{end}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{- else }}
|
|
|
|
{{ "<!-- webpage metadata -->" | safeHTML }}
|
|
|
|
<meta property="og:type" content="website" />
|
|
|
|
<script defer type="application/ld+json">
|
|
|
|
{
|
2024-02-26 16:52:41 +00:00
|
|
|
"@context": "http://schema.org",
|
|
|
|
"@type": "WebPage",
|
|
|
|
"name": "{{ .Title }}",
|
|
|
|
"url": {{ .Permalink }},
|
2024-02-26 17:01:52 +00:00
|
|
|
"description": "{{ or .Description .Summary }}",
|
|
|
|
"logo": {{with $icon}}{{.Permalink}}{{else}}{{$staticIcon}}{{end}}
|
2024-02-26 11:41:39 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* auxiliary info */}}
|
|
|
|
{{ "<!-- site presentation -->" | safeHTML }}
|
|
|
|
{{ with $icon }}
|
|
|
|
<link rel="shortcut icon" href='{{ .Permalink }}' sizes="{{.Width}}x{{.Height}}">
|
|
|
|
{{- else -}}
|
|
|
|
<link rel="shortcut icon" href='{{ $staticIcon }}' sizes="512x512">
|
|
|
|
{{- 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 */}}
|
|
|
|
{{- "<!-- robots -->" | safeHTML }}
|
2024-02-26 11:41:39 +00:00
|
|
|
<meta name="robots" content="index,follow" />
|
|
|
|
<meta name="googlebot" content="index,follow" />
|