Skip to content
Snippets Groups Projects
Verified Commit a6925deb authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Fixed bibliography rendering.

parent 0d8e918f
No related branches found
No related tags found
No related merge requests found
{{ if .Site.Data.bibliography }} {{ if .Site.Data.bibliography }}
<p> <p>
{{ $id := .Get "id" }} {{ $id := .Get "id" }}
{{ range where .Site.Data.bibliography "id" $id }} {{ range where .Site.Data.bibliography "id" $id }}
{{ $len := (len .author) }} {{ $len := (len .author) }}
{{ range $index, $element := .author }} {{ range $index, $element := .author }}
{{ $element.family }}, {{ $element.given}} {{ if ne (add $index 1) $len }}and{{ end }} {{ $element.family }}, {{ $element.given}} {{ if ne (add $index 1) $len }}and{{ end }}
{{ end }} {{ end }}
({{ range .issued }} ({{ range .issued }}
{{ range . }} {{ range . }}
{{ range . }} {{ range . }}
{{.}} {{.}}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }}): {{ end }}):
<i>{{ .title }}</i>. <i>{{ .title | safeHTML }}</i>.
<!-- Workaround for keys with hyphens inside with index-function --> <!-- Workaround for keys with hyphens inside with index-function -->
{{ if isset . "container-title" }}{{ index . "container-title" }}{{ end }} {{ if isset . "container-title" }}{{ index . "container-title" }}{{ end }}
{{ if isset . "issue" }}{{ .issue }},{{ end }} {{ if isset . "issue" }}{{ .issue }},{{ end }}
{{ if isset . "volume" }}vol. {{ .volume }},{{ end }} {{ if isset . "volume" }}vol. {{ .volume }},{{ end }}
{{ if isset . "page" }}p. {{ .page }},{{ end }} {{ if isset . "page" }}p. {{ .page }},{{ end }}
{{ if isset . "DOI" }}DOI: <a href="https://doi.org/{{ .DOI }}">{{ .DOI }}</a>,{{ end }} {{ if isset . "DOI" }}DOI: <a href="https://doi.org/{{ .DOI }}">{{ .DOI }}</a>,{{ end }}
{{ if isset . "ISBN" }}ISBN: {{ .ISBN }},{{ end }} {{ if isset . "ISBN" }}ISBN: {{ .ISBN }},{{ end }}
{{ .publisher }} {{ .publisher }}
{{ end }} {{ end }}
</p> </p>
{{ else }} {{ 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 }} {{ end }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment