I want to integrate the Open Graph protocol to my blog. This means that I will require to output different meta tag base on the content type.
For example, if I’m building a post, I’ll have the og:title set to the blog post’s title. But if I’m on the index page, I’ll want to set it to my blog’s name. I thought I could use something like that :
{{ if eq .Type "post" }}
<meta property="og:title" content="{{ .Title }}" />
{{ end }}
But got this error:
ERROR: 2015/10/01 template: theme/partials/header.html:27:10: executing “theme/partials/header.html” at <.Type>: Type is not a field of struct type *hugolib.Node in theme/partials/header.html