From a8abce8c5f8286dca0e58d89b409735173e66ea6 Mon Sep 17 00:00:00 2001 From: Sean Dockray Date: Mon, 7 Sep 2020 00:13:59 +1000 Subject: [PATCH] BREAKING CHANGE! allowing for library to be located elsewhere; also changed json catalog's name to catalog --- config/_default/config-local.toml | 1 + config/_default/config.toml | 1 + .../layouts/_default/_markup/render-image.html | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/_default/config-local.toml b/config/_default/config-local.toml index 4caff5a..c30381d 100644 --- a/config/_default/config-local.toml +++ b/config/_default/config-local.toml @@ -11,6 +11,7 @@ disableKinds = ["RSS", "sitemap"] title = "Pirate Care Syllabus" giturl = "http://localhost:3000/gitea/pirate-care-syllabus" home = "syllabus" + catalogprefix = "hyper://18f79903cb7ce4f1f3c05449418505a296bb2c4e851f7dc9444cf87ed45fb194/" [outputFormats] [outputFormats.js] diff --git a/config/_default/config.toml b/config/_default/config.toml index cd8b442..373bb24 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -11,6 +11,7 @@ disableKinds = ["RSS", "sitemap"] title = "Pirate Care Syllabus" giturl = "https://git.memoryoftheworld.org/PirateCare/Syllabus" home = "syllabus" + catalogprefix = "/library/" [outputFormats] [outputFormats.js] diff --git a/themes/sandpoints/layouts/_default/_markup/render-image.html b/themes/sandpoints/layouts/_default/_markup/render-image.html index 5521176..166813e 100644 --- a/themes/sandpoints/layouts/_default/_markup/render-image.html +++ b/themes/sandpoints/layouts/_default/_markup/render-image.html @@ -1,15 +1,16 @@ {{- $text_link := .Text -}} {{- if strings.HasPrefix .Destination "bib:" -}} {{- $destination := (substr .Destination 4) -}} - {{- if index $.Page.Site.Data.books.piratecarecollection $destination -}} - {{- $b := index $.Page.Site.Data.books.piratecarecollection $destination -}} + {{- $c_prefix := .Page.Site.Params.catalogprefix | default "/library/" -}} + {{- if index $.Page.Site.Data.books.catalog $destination -}} + {{- $b := index $.Page.Site.Data.books.catalog $destination -}} {{- if not $text_link -}} -{{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.bib⁄‘{{- $b.title -}}’. {{- with $b.publisher -}}{{- . -}}.{{- end -}} + {{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.bib⁄‘{{- $b.title -}}’. {{- with $b.publisher -}}{{- . -}}.{{- end -}} {{- else -}} - {{- $text_link -}} + {{- $text_link -}} {{- end -}} {{- else -}} - {{- $text_link -}}⦚bib:{{- $destination -}} not found + {{- $text_link -}}⦚bib:{{- $destination -}} not found {{- end -}} {{- else if strings.HasPrefix .Destination "session:" -}} {{- $s_destination := printf "/session/%s" (substr .Destination 8) -}}