From a6925deb02a258dc0cfbff98d71907581d175a85 Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Wed, 4 Mar 2020 09:27:25 +0100 Subject: [PATCH] [web] Fixed bibliography rendering. --- web/layouts/shortcodes/bib.html | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/web/layouts/shortcodes/bib.html b/web/layouts/shortcodes/bib.html index ec66241ce51..4c9adf6a7d0 100644 --- a/web/layouts/shortcodes/bib.html +++ b/web/layouts/shortcodes/bib.html @@ -1,29 +1,29 @@ {{ if .Site.Data.bibliography }} - <p> - {{ $id := .Get "id" }} - {{ range where .Site.Data.bibliography "id" $id }} + <p> + {{ $id := .Get "id" }} + {{ range where .Site.Data.bibliography "id" $id }} {{ $len := (len .author) }} - {{ range $index, $element := .author }} - {{ $element.family }}, {{ $element.given}} {{ if ne (add $index 1) $len }}and{{ end }} - {{ end }} - ({{ range .issued }} - {{ range . }} - {{ range . }} - {{.}} - {{ end }} - {{ end }} - {{ end }}): - <i>{{ .title }}</i>. - <!-- Workaround for keys with hyphens inside with index-function --> - {{ if isset . "container-title" }}{{ index . "container-title" }}{{ end }} - {{ if isset . "issue" }}{{ .issue }},{{ end }} - {{ if isset . "volume" }}vol. {{ .volume }},{{ end }} - {{ if isset . "page" }}p. {{ .page }},{{ end }} + {{ range $index, $element := .author }} + {{ $element.family }}, {{ $element.given}} {{ if ne (add $index 1) $len }}and{{ end }} + {{ end }} + ({{ range .issued }} + {{ range . }} + {{ range . }} + {{.}} + {{ end }} + {{ end }} + {{ end }}): + <i>{{ .title | safeHTML }}</i>. + <!-- Workaround for keys with hyphens inside with index-function --> + {{ if isset . "container-title" }}{{ index . "container-title" }}{{ end }} + {{ if isset . "issue" }}{{ .issue }},{{ end }} + {{ if isset . "volume" }}vol. {{ .volume }},{{ end }} + {{ if isset . "page" }}p. {{ .page }},{{ end }} {{ if isset . "DOI" }}DOI: <a href="https://doi.org/{{ .DOI }}">{{ .DOI }}</a>,{{ end }} {{ if isset . "ISBN" }}ISBN: {{ .ISBN }},{{ end }} - {{ .publisher }} - {{ end }} - </p> + {{ .publisher }} + {{ end }} + </p> {{ else }} - {{ printf "Warning: Bibliography not converted! Missing bib id: "}}<code>{{.Get "id"}}</code> + {{ printf "Warning: Bibliography not converted! Missing bib id: "}}<code>{{.Get "id"}}</code> {{ end }} -- GitLab