From c21b85ad7b45c3cf30bb3c7c28850ad18335157f Mon Sep 17 00:00:00 2001
From: Bill Stumbo
Date: Sat, 1 Nov 2025 23:18:02 -0400
Subject: [PATCH 1/3] Bs1 bibliography (#295)
* Initial attempt to create individual pages for the Bibliography entries.
1. The "main" Bibliography page is not (yet) modified to reference these.
2. This fails when hugo tries to render the html for the generated .md files.
The error from Hugo (it reports 4 then seems to hang):
ERROR render of "/home/matt/Interlisp/Interlisp.github.io/content/en/history/bibliography/2LJ5ITDD.md" failed: "/home/matt/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.10.0/layouts/docs/single.html:2:3": execute of template failed: template: docs/single.html:2:3: executing "main" at <.Render>: error calling Render: failed to execute template content.html: "/home/matt/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/google/docsy@v0.10.0/layouts/_default/content.html:10:4": execute of template failed: template: content.html:10:4: executing "content.html" at <.Content>: error calling Content: "/home/matt/Interlisp/Interlisp.github.io/content/en/history/bibliography/2LJ5ITDD.md:8:1": failed to render shortcode "bibItem": failed to process shortcode: "/home/matt/Interlisp/Interlisp.github.io/layouts/shortcodes/bibItem.html:168:23": execute of template failed: template: _shortcodes/bibitem.html:168:23: executing "_shortcodes/bibitem.html" at <.params.bibItem>: can't evaluate field params in type *hugolib.ShortcodeWithPage
* Improved, but still work in progress.
This now creates the files but has some difficulties.
The main Bibliography page hasn't been changed.
* Update github action to set bibSplit.pl executable
* Publications Page -- work in progress
* WIP
* WIP
* Bibliography WIP
Crude listing generated in /pulications folder.
* Initial implementation of list of all bibliography entries
Primitive first pass. Provides a chronological list of all
bibliography entires providing titles, authors, date and an
abbreviated start of the abstract (limted to 24 words). In
addition, a link is enclosed that goes to the markdown file
that represents the bibliography entry.
Currently, there is nothing implemented to show the contents of
the md file.
There is no bibliography css implemented to format the list items.
This provides an initial proof of concept. A simple framework that
can be extended and styled to get us where we want to go.
* Initial implementation of list of all bibliography entries
Primitive first pass. Provides a chronological list of all
bibliography entires providing titles, authors, date and an
abbreviated start of the abstract (limted to 24 words). In
addition, a link is enclosed that goes to the markdown file
that represents the bibliography entry.
Currently, there is nothing implemented to show the contents of
the md file.
There is no bibliography css implemented to format the list items.
This provides an initial proof of concept. A simple framework that
can be extended and styled to get us where we want to go.
* Updates to bibliography page
The bibliography md files are build using the update_bibliography.sh
script. bib-fns.jq provides functions to reformat the Zotero JSON.
bibSplit.pl creates the md file and a data file containing the JSON
for each page. Future work will remove the JSON data files once all the
content is encompassed in the md file.
Added new document type bibliography to generate the list of
bibliography entries. layouts/bibliography/list.html provides this
functionality. It also currently includes some light css to format the
output. The css will eventually be moved into a standalone file within
the Hugo ecosystem.
Removed the original publication type and its associated files in
layouts.
Removed some HugoBlox files. They were left over from an early attempt
to create a bibliography using HugoBlox as a template.
Updated gh-pages.yml, the GHA, to cache the md pages and JSON files.
Rewrote the caching to make it more efficient and easier to follow.
* Update bibliography entry to link to Zotero
The Read Me link now points to the Zotero entry for
each item.
* Add missing edits.
* Update Zotero link wording and open in new tab
* Fixed a few Hugo syntax errors.
Changed the de-html & re-html encoding to remove unnecessary encoding of html entities.
bibSplit.pl errors go to STDERR
update_bibliography.sh redirects those errors to bibSplit.err file.
I cannot find Hugo documentation showing why _ in truncated abstract renders as ellipsis.
* Updates to author tags
Authors are now stored as a list of strings in the YAML, one author per
line in the list.
Previously all the authors were consolidated into a single string.
* Start of building out individual bibliography pages
Create baseof.html - framework for bibliography screen single.html - layout of individual entry Updated list.html - with baseof, s added at beginning of file are no longer needed. Updated bibSplit.pl specify each page as a bibliography page.
* Continued work on creating individual entries.
Build out parsing of json to get needed items
and putting the items into the generated pages.
* Finish individual bibliography entry creation
Individual bibliography entries are created for
all document types. Customized the entries shown
based on Zotero entries. Added url, left placeholder
for citation.
Updated list of bibliography entries to link to
individual entries.
* Taxonomy initial work. Still WIP
* Some edge case cleanups.
A hack for bulleted list in Abstracts.
Some rearranging for consistency between the list and single views.
Other tweaks for my preferences.
* Taxonomy support for filtering bibliographical entries
Add bibliographical support for item_type (the type of
bibliographic entry) and author.
Provide support for filtering bibliographic list by both
types of tags.
* Turn off saving of the 00-rawItems.json and tags.json files.
* Added command line processing to avoid needing to edit the file while debugging changes.
Included usage information.
The previous behavior (no command line options) is unchanged.
(No modification to invocation required.)
* Remove storing of individual .json files and unused files.
Clean out some old files js & scss from earlier bibliography work.
* Cleanup versions in go.sum
* Remove cite placeholder.
---------
Co-authored-by: Matt Heffron
---
.github/workflows/gh-pages.yml | 48 +--
.gitignore | 6 +
config/_default/hugo.yaml | 6 +-
config/_default/languages.yaml | 9 +-
config/_default/module.yaml | 2 +-
config/_default/params.yaml | 25 +-
config/_default/permalinks.yaml | 7 +-
config/_default/services.yaml | 5 +
config/_default/taxonomies.yaml | 4 +
content/en/history/bibliography/_index.md | 10 +-
go.sum | 5 +-
layouts/bibliography/baseof.html | 34 ++
layouts/bibliography/list.html | 156 ++++++++
layouts/bibliography/single.html | 220 ++++++++++++
layouts/partials/taxonomy_terms_cloud.html | 21 ++
.../{bibTable.html => bibItem.html} | 188 ++++++----
scripts/bib-fns.jq | 64 ++++
scripts/bibSplit.pl | 174 +++++++++
scripts/update_bibliography.sh | 334 ++++++++++++++----
static/data/bibItems/.gitkeep | 0
20 files changed, 1138 insertions(+), 180 deletions(-)
create mode 100644 config/_default/services.yaml
create mode 100644 config/_default/taxonomies.yaml
create mode 100644 layouts/bibliography/baseof.html
create mode 100644 layouts/bibliography/list.html
create mode 100644 layouts/bibliography/single.html
create mode 100644 layouts/partials/taxonomy_terms_cloud.html
rename layouts/shortcodes/{bibTable.html => bibItem.html} (50%)
create mode 100755 scripts/bibSplit.pl
create mode 100644 static/data/bibItems/.gitkeep
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 5d97b115a..6e85f957c 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -57,27 +57,25 @@ jobs:
cacheHit: ${{ steps.cache-zotero-bib.outputs.cache-hit }}
runs-on: ubuntu-latest
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Get Zotero Version Information
id: zoteroVersion
uses: fjogeleit/http-request-action@v1
with:
- url: "https://api.zotero.org/groups/2914042/items?format=versions"
- method: "GET"
+ url: https://api.zotero.org/groups/2914042/items?format=versions
+ method: GET
- name: Cache Zotero Bibliography
- id: cache-zotero-bib
- uses: actions/cache@v4
- env:
- cache-name: cache-zotero_bib
+ id: cache-zotero
+ uses: actions/cache/restore@v4
with:
- path: ~/data
- key: ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
- restore-keys: |
- ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
+ lookup-only: true
+ path: |
+ static/data/bibliography.json
+ static/data/bibItems
+ content/en/history/bibliography
+ key: bib-${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }}
# ----------------------------------------------------------------------------
# Build the website. This job is conditional, we will always run it on a
@@ -94,31 +92,23 @@ jobs:
fetch-depth: 0
- name: Cache Zotero Bibliography
- id: cache-zotero-bib
+ id: cache-bib
uses: actions/cache@v4
- env:
- cache-name: cache-zotero_bib
with:
- path: ~/data
- key: ${{ needs.check.outputs.zoteroVersion }}
- restore-keys: |
- ${{ needs.check.outputs.zoteroVersion }}
+ path: |
+ static/data/bibliography.json
+ static/data/bibItems
+ content/en/history/bibliography
+ key: bib-${{ needs.check.outputs.zoteroVersion }}
- name: Install Bibliography
- env:
- CACHE_HIT: ${{ steps.cache-zotero-bib.outputs.cache-hit }}
+ if: steps.cache-bib.outputs.cache-hit != 'true'
run: |
- if [[ "$CACHE_HIT" == 'true' ]]; then
- echo "Use Cache"
- sudo cp --recursive ~/data ${GITHUB_WORKSPACE}/static
- ls -la ${GITHUB_WORKSPACE}/static/data
- else
echo "Retrieve bibliography"
cd scripts
chmod +x ./update_bibliography.sh
+ chmod +x ./bibSplit.pl
./update_bibliography.sh
- sudo cp --recursive ${GITHUB_WORKSPACE}/static/data ~/data
- fi
# Install Hugo Extended
#
@@ -162,4 +152,4 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
-
\ No newline at end of file
+
diff --git a/.gitignore b/.gitignore
index b41f2aa34..e44d45333 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,9 @@ _gen/
.hugo_build.lock
.idea
data/bibliography.json
+static/data/bibliography.json
+static/data/bibItems/
+/docs
+/scripts/*.json
+/content/en/history/bibliography/**
+!/content/en/history/bibliography/_index.md
diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml
index 7ce1140d5..1eb6da3c7 100644
--- a/config/_default/hugo.yaml
+++ b/config/_default/hugo.yaml
@@ -35,9 +35,9 @@ defaultContentLanguageInSubdir: false
enableMissingTranslationPlaceholders: true
# Disable rendering of the specified page kinds
-disableKinds:
- - taxonomy
- - term
+#disableKinds:
+# - term
+# Note terms are needed for taxonomies to work
outputs:
home:
diff --git a/config/_default/languages.yaml b/config/_default/languages.yaml
index 1f0069b6b..6d1441a07 100644
--- a/config/_default/languages.yaml
+++ b/config/_default/languages.yaml
@@ -5,9 +5,14 @@
# See: https://gohugo.io/content-management/multilingual/
#
en:
- languageName: English"
+ languageName: English
+ languageCode: en-us
# Weight used for sorting.
weight: 1
contentDir: content/en
params:
- description: "Dedicated to restoring and preserving the Interlisp experience"
\ No newline at end of file
+ description: "Dedicated to restoring and preserving the Interlisp experience"
+
+ # Languages
+# Create a section for each of your site's languages.
+# Documentation: https://docs.hugoblox.com/reference/language/
diff --git a/config/_default/module.yaml b/config/_default/module.yaml
index 1a537f509..d6c27e0b3 100644
--- a/config/_default/module.yaml
+++ b/config/_default/module.yaml
@@ -8,4 +8,4 @@
- path: "github.com/google/docsy"
disable: false
- path: "github.com/google/docsy/dependencies"
- disable: false
+ disable: false
\ No newline at end of file
diff --git a/config/_default/params.yaml b/config/_default/params.yaml
index 45b3f1a9f..e188cb6ec 100644
--- a/config/_default/params.yaml
+++ b/config/_default/params.yaml
@@ -108,7 +108,27 @@ links:
# icon: "fa fa-envelope"
# desc: "Discuss development issues around the project"
-taxonomies:
+taxonomy:
+ taxonomyCloud:
+ - authors
+ taxonomyCloudTitle:
+ - Authors
+ taxonomyPageHeader:
+ - authors
+ - item_type
+
+#related:
+# threshold: 80
+# includeNewer: true
+# toLower: true
+# indices:
+# - name: item_type
+# weight: 5
+# - name: tags
+# weight: 100
+# - name: categories
+# weight: 70
+
# Nothing defined
# User Interface Configuration options
@@ -154,7 +174,7 @@ ui:
sidebar_cache_limit: 100
# We have almost 200 attributes; don't truncate the sidebar to max 50 contents.
- sidebar_menu_truncate: 1000
+ sidebar_menu_truncate: 0
# Set to true to disable breadcrumb navigation.
breadcrumb_disable: false
@@ -167,3 +187,4 @@ ui:
# Identify the custom css files
custom_css:
- "css/custom.css"
+
diff --git a/config/_default/permalinks.yaml b/config/_default/permalinks.yaml
index b6b31af21..3e427038d 100644
--- a/config/_default/permalinks.yaml
+++ b/config/_default/permalinks.yaml
@@ -6,4 +6,9 @@
#
# see: https://gohugo.io/content-management/urls/#permalinks
#
-blog: /:section/:year/:month/:day/:slug/
\ No newline at end of file
+blog: '/:section/:year/:month/:day/:slug/'
+
+authors: '/author/:slug/'
+tags: '/tag/:slug/'
+categories: '/category/:slug/'
+publication_types: '/publication-type/:slug/'
\ No newline at end of file
diff --git a/config/_default/services.yaml b/config/_default/services.yaml
new file mode 100644
index 000000000..91a80a6a3
--- /dev/null
+++ b/config/_default/services.yaml
@@ -0,0 +1,5 @@
+rss:
+ limit: -1
+ title: "Interlisp.org RSS Feed"
+ description: "The latest news from Interlisp.org"
+ link: "https://interlisp.org"
\ No newline at end of file
diff --git a/config/_default/taxonomies.yaml b/config/_default/taxonomies.yaml
new file mode 100644
index 000000000..b6bb7949c
--- /dev/null
+++ b/config/_default/taxonomies.yaml
@@ -0,0 +1,4 @@
+tag: tags
+category: categories
+author: authors
+item_type: item_type
\ No newline at end of file
diff --git a/content/en/history/bibliography/_index.md b/content/en/history/bibliography/_index.md
index 376de97f8..af682331c 100644
--- a/content/en/history/bibliography/_index.md
+++ b/content/en/history/bibliography/_index.md
@@ -1,14 +1,12 @@
---
title: Bibliography
+heading: Interlisp Bibliography
+type: bibliography
+cascade:
+ type: bibliography
weight: 5
-type: docs
aliases:
- /bibliography/
---
-
-## Interlisp Bibliography
-
(This bibliography is kept in sync with our [Zotero](https://www.zotero.org/) collection [Library](https://www.zotero.org/groups/2914042/interlisp/library).
-
-{{< bibTable >}}
diff --git a/go.sum b/go.sum
index 22e30c371..25f0e2cb7 100644
--- a/go.sum
+++ b/go.sum
@@ -1,13 +1,12 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
-github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984=
-github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U=
+github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
-github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE=
github.com/google/docsy/dependencies v0.7.2 h1:+t5ufoADQAj4XneFphz4A+UU0ICAxmNaRHVWtMYXPSI=
github.com/google/docsy/dependencies v0.7.2/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4=
github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
+github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
diff --git a/layouts/bibliography/baseof.html b/layouts/bibliography/baseof.html
new file mode 100644
index 000000000..ebd44c94b
--- /dev/null
+++ b/layouts/bibliography/baseof.html
@@ -0,0 +1,34 @@
+
+
+
+ {{ partial "head.html" . }}
+
+
+
+ {{ partial "navbar.html" . }}
+
+
+
+
+
+
+ {{ partial "version-banner.html" . }}
+ {{ if not (.Param "ui.breadcrumb_disable") -}}
+ {{ partial "breadcrumb.html" . -}}
+ {{ end -}}
+ {{ block "main" . }}{{ end }}
+
+
+
+ {{ partial "footer.html" . }}
+
+ {{ partial "scripts.html" . }}
+
+
\ No newline at end of file
diff --git a/layouts/bibliography/list.html b/layouts/bibliography/list.html
new file mode 100644
index 000000000..46abbca3f
--- /dev/null
+++ b/layouts/bibliography/list.html
@@ -0,0 +1,156 @@
+{{ define "sidebar" }}{{ end }}
+{{ define "main" }}
+
+
+
{{ or .Params.heading .Title }}
+
+
+
+
+
+
+
+{{ .Content }}
+
+
+
+ {{- $previewWordLimit := 24 -}}
+
+ {{- /* Get all regular pages in this section */ -}}
+ {{ $pages := .RegularPages }}
+ {{- /* Sort by date descending, then title ascending */ -}}
+ {{- $pages = sort $pages "Date" "desc" -}}
+ {{- $pages = sort $pages "Title" "asc" -}}
+
+ {{- /* Render the list of publications */ -}}
+
+
+ {{ range $pages }}
+ {{- /* Collect item_type terms as a comma-separated, lowercased string */ -}}
+ {{- $types := "" -}}
+ {{- with .Params.item_type -}}
+ {{- if reflect.IsSlice . -}}
+ {{- $types = delimit (apply . "lower" ".") "," -}}
+ {{- else -}}
+ {{- $types = (lower .) -}}
+ {{- end -}}
+ {{- end -}}
+
+
{{ if .url }}{{ .title }}{{ else }}{{ .title }}{{ end }}
- {{ if or .author .editor }}
{{ if not .author }}Edited by: {{ end }}{{ range $naE, $auEd := or .author .editor }}{{ if $naE }}; {{ end }}{{ if $auEd.literal }}{{ $auEd.literal }}{{ else if and $auEd.family $auEd.given }}{{ $auEd.family }}, {{ $auEd.given }}{{ else }}{{ $auEd.family }}{{ $auEd.given }}{{ end }}{{ end }}
-
{{ end }}
- {{ if .abstract }}{{ end }}
- {{ if and false .note }}
- {{ $notes := split (plainify .note) "\n" }}
-
Notes
-
- {{ range $nn, $note := $notes }}
- {{if strings.ContainsNonSpace $note }}
- {{ if $nn }} {{ end }}
- {{ print (safeJS (replace (replace (htmlUnescape $note) "-" $nonBreakingHyphen) " " " ")) }}
- {{ end }}
- {{ end }}