summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2020-02-18 22:53:50 +0100
committerAlexandre Vicenzi <vicenzi.alexandre@gmail.com>2020-02-18 22:53:50 +0100
commitc5c85b0db5306c4798da365618d1028e82da4983 (patch)
tree9bc0658ecb884da755794a9f21ad69d4e9db2b64 /layouts
parentb09886846b000aaea91931d2da6657ae960f2e86 (diff)
Tags and Categories in Open Graph
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/seo.html15
1 files changed, 13 insertions, 2 deletions
diff --git a/layouts/partials/seo.html b/layouts/partials/seo.html
index 46b0c29..347b41c 100644
--- a/layouts/partials/seo.html
+++ b/layouts/partials/seo.html
@@ -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 }}"/>