Added openGraph data.

This commit is contained in:
Greenscreener 2019-12-05 17:11:25 +01:00
parent a9b10a1d5c
commit 5f0d23575d
3 changed files with 46 additions and 2 deletions

View File

@ -36,4 +36,7 @@ other = "Nadcházející a proběhlé Talky"
other = "Tagy"
[posts_with_tag]
other = "Přízpěvky s tagem"
other = "Přízpěvky s tagem"
[logo-alt]
other = "Logo Pátku"

View File

@ -31,4 +31,7 @@ other = "Upcoming and past Talks"
other = "Tags"
[posts_with_tag]
other = "Posts with tag"
other = "Posts with tag"
[logo-alt]
other = "Logo of Pátek"

View File

@ -11,6 +11,44 @@
{{ partial "sass.html" "css/main.scss" }}
<meta name="theme-color" content="#0b2a37">
{{- end }}
{{ block "og" . -}}
{{ $favicon := resources.Get "img/favicon.ico" }}
{{ if eq .IsPage true }}
<meta property="og:title" content="{{ .Title }} | {{ .Site.Title }}">
<meta property="og:type" content="article">
<meta property="og:image" content="{{ $favicon.Permalink }}">
<meta property="og:image:alt" content="{{ T "logo-alt" }}" />
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{ .Summary | truncate 120 }}">
<meta property="og:locale" content="{{ .Language.Lang }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
{{ range .Translations }}
<meta property="og:locale:alternative" content="{{ .Lang }}">
{{ end }}
<meta property="og:article:published_date" content="{{ .PublishDate }}">
{{ range .Params.authors }}
<meta property="og:article:author" content="{{ . }}">
{{ end }}
{{ range .Params.tags }}
<meta property="og:article:tag" content="{{ . }}">
{{ end }}
<meta property="og:article:section" content="{{ .Section }}">
{{ end }}
{{ if eq .IsHome true }}
<meta property="og:title" content="Pátek.cz">
<meta property="og:type" content="website">
<meta property="og:image" content="{{ $favicon.Permalink }}">
<meta property="og:image:alt" content="{{ T "logo-alt" }}" />
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{ .Summary }}">
<meta property="og:locale" content="{{ .Language.Lang }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
{{ range .Translations }}
<meta property="og:locale:alternative" content="{{ .Lang }}">
{{ end }}
{{ end }}
{{ end -}}
{{ block "js" . -}}
{{ partial "js.html" "js/header-link.js" }}
{{ partial "js.html" "js/patek-logo-custom-element/patek-logo.js" }}