{{- $citationStyle := "apa" }} {{- $partialPath := string (printf "bibliography/%s-style.html" $citationStyle) }} {{/* -------------------- BEGIN Bibliography path -------------------- */}} {{- $bibliographyPath := "" }} {{/* Default: check for a JSON file in the leaf bundle. */}} {{- $pageResource := $.Page.Resources.GetMatch "*bib*.json" -}} {{- if $pageResource }} {{- $constructedBibResource := printf "content/%s%s" $.Page.File.Dir $pageResource.Name }} {{- $bibliographyPath = $constructedBibResource }} {{- end }} {{- /* If a `bibFile` is specified in the page front-matter, it takes precedence over a page resource. */ -}} {{- /* `specifiedBib` must be relative to project root */ -}} {{- if $.Page.Params.bibFile }} {{- $bibliographyPath = $.Page.Params.bibFile -}} {{- end }} {{- $bibliography := getJSON $bibliographyPath -}} {{- /* -------------------- END Bibliography path -------------------- */ -}} {{ $table := .Inner | transform.Unmarshal }} {{ $page := .}}