diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/head.html | 12 | ||||
| -rw-r--r-- | layouts/partials/templates/doublinecore.html | 14 | ||||
| -rw-r--r-- | layouts/partials/templates/opengraph.html | 2 |
3 files changed, 17 insertions, 11 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f4303e1..f2ef3ba 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,17 +16,9 @@ <meta name="author" content="{{ (partial "author.html" . ) }}"> {{ hugo.Generator }} - <!-- Dublin Core metadata for Zotero --> - <meta property="dc:title" content="{{ .Title }}"> - <meta property="dc:creator" content="{{ (partial "author.html" . ) }}"> - <meta property="dc:identifier" content="{{ .Permalink }}"> - {{- if .Params.editor }}<meta property="dc:contributor" content="{{ .Params.editor }}">{{ end }} - {{- if .Params.date }}<meta property="dc:date" content="{{ .Params.date }}">{{ end }} - {{- if .Params.rights }}<meta property="dc:rights" content="{{ .Params.rights }}">{{ end }} - <meta property="dc:source" content="{{ if .Params.source }}{{ .Params.source }}{{ else }}{{ site.Title }}{{ end }}"> - {{- /* Misc */}} - {{template "partials/templates/opengraph.html" . }} + {{ template "partials/templates/doublinecore.html" . }} + {{ template "partials/templates/opengraph.html" . }} {{ partial "styles.html" . -}} {{ partial "scripts.html" . -}} diff --git a/layouts/partials/templates/doublinecore.html b/layouts/partials/templates/doublinecore.html new file mode 100644 index 0000000..674d343 --- /dev/null +++ b/layouts/partials/templates/doublinecore.html @@ -0,0 +1,14 @@ + <!-- Dublin Core metadata for Zotero --> + <meta property="dc:title" content="{{ .Title }}"> + <meta property="dc:identifier" content="{{ .Permalink }}"> + <meta property="dc:creator" content="{{ ( partial "author.html" . ) }}"> +{{- with .Params.editor }} + <meta property="dc:contributor" content="{{ . }}"> +{{- end }} +{{- with .Params.rights }} + <meta property="dc:rights" content="{{ . }}"> +{{- end }} + <meta property="dc:source" content="{{ if .Params.source }}{{ .Params.source }}{{ else }}{{ site.Title }}{{ end }}"> +{{- with .Params.date }} + {{ printf "<meta property=\"dc:date\" content=\"%s\">" (.UTC.Format "2006-01-02T15:04:05-07:00") | safeHTML }} +{{- end }} diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index 55bcbe3..e3dad0f 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -1,4 +1,4 @@ -<!-- Open Graph metadata --> + <!-- Open Graph metadata --> <meta property="og:title" content="{{ .Title }}"> <meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"> <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}"> |
