diff --git a/web/layouts/shortcodes/bib.html b/web/layouts/shortcodes/bib.html index ec66241ce51a8ff313703175f90ef0f1761158bb..4c9adf6a7d05175f5dd76089b5eb151a0372da11 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 }}