summaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-04-23 22:30:52 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-04-23 22:30:52 +0200
commit1536c43e1a24f8e01d80aba9cf8dff49fd3b5026 (patch)
tree7c7b83ade8e0a6ec2116cdb3a495736d5b5c4267 /layouts/partials
parentee7faef370442c5c91f0ba322bdcb4796aff3c29 (diff)
downloadgohugo-theme-ed-1536c43e1a24f8e01d80aba9cf8dff49fd3b5026.tar.gz
Add Dublin Core metadata for Zotero
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/head.html25
1 files changed, 21 insertions, 4 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index bb7e793..57784e8 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,15 +1,32 @@
<head prefix="og: http://ogp.me/ns#; dc: http://purl.org/dc/terms/#">
- {{ $resource_url := print .Site.BaseURL | safeURL }}
+ {{- $resource_url := print .Site.BaseURL | safeURL -}}
+
+ {{- $title := print .Title -}}
+ {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
+
+ {{- $description := print .Description -}}
+ {{ if .IsHome }}{{ $description = .Site.Params.Description }}{{ end }}
+
+ {{- $author := print .Site.Author.name -}}
+ {{- if .Params.author -}}{{ $author = .Params.author }}{{- end -}}
+
<!-- Basic meta elements -->
<meta charset="utf-8">
<!-- Enable responsiveness on mobile devices -->
- <meta name="viewport" content="width=device-width,initial-scale=1.0,shrink-to-fit=no" />
+ <meta name="viewport" content="width=device-width,initial-scale=1.0,shrink-to-fit=no">
<!-- Canonical link to help search engines -->
<link rel="canonical" href="{{ $resource_url }}">
- {{ $title := print .Site.Title " | " .Title }}
- {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
<title>{{ $title }}</title>
+
+ <!-- Dublin Core metadata for Zotero -->
+ <meta property="dc:title" content="{{ $title }}">
+ <meta property="dc:creator" content="{{ $author }}">
+ <meta property="dc:identifier" content="{{ $resource_url }}">
+ {{ if .Params.editor }}<meta property="dc:contributor" content="{{ .Params.editor }}">{{ end }}
+ {{ if .Params.pub_date }}<meta property="dc:date" content="{{ .Params.pub_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 }}">
</head>