Tags and Categories in Open Graph

This commit is contained in:
Alexandre Vicenzi 2020-02-18 22:53:50 +01:00
parent b09886846b
commit c5c85b0db5
1 changed files with 13 additions and 2 deletions
layouts/partials

View File

@ -18,8 +18,19 @@
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}"/>
<meta property="article:modified_time" content="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}"/>
<meta property="article:author" content="{{ .Site.Params.author }}">
<!-- <meta property="article:section" content="category"/> -->
<!-- <meta property="article:tag" content="tag"/> -->
{{ with .Params.Categories -}}
{{- range $name := . -}}
<meta property="article:section" content="{{ $name }}"/>
{{ end -}}
{{- end -}}
{{ with .Params.Tags -}}
{{- range $name := . -}}
<meta property="article:tag" content="{{ $name }}"/>
{{ end -}}
{{- end -}}
{{ else }}
<meta property="og:type" content="blog"/>
<meta property="og:site_name" content="{{ .Site.Title }}"/>