Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ _site
.sass-cache
.jekyll-metadata
public/
tests/public_test/
node_modules/
_gen/
.hugo_build.lock
Expand Down
3 changes: 0 additions & 3 deletions config/_default/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ ui:
# Sidebar generation is slow otherwise
sidebar_cache_limit: 100

# We have almost 200 attributes; don't truncate the sidebar to max 50 contents.
sidebar_menu_truncate: 0

# Set to true to disable breadcrumb navigation.
breadcrumb_disable: false

Expand Down
50 changes: 50 additions & 0 deletions config/testing/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Hugo testing environment configuration
#
# Used exclusively when running the bibliography JSON-LD test suite:
#
# hugo --environment testing --destination tests/public_test
#
# This environment mounts the test fixtures from tests/fixtures/bibliography/
# alongside the real bibliography content, so the JSON-LD template is exercised
# against controlled data without those pages ever appearing in a production build.
#
# The module.mounts block must re-declare all standard project-level mounts
# because adding any mount replaces Hugo's defaults for the project.
# Theme (Docsy) mounts defined within that module are unaffected.

baseURL: "http://localhost/"

publishDir: tests/public_test

# Broken refs in unrelated content files must not block the test build.
refLinksErrorLevel: WARNING

# Explicit mounts (see module section below) require this to be re-stated
# so that English content URLs do not gain an /en/ prefix.
defaultContentLanguageInSubdir: false

module:
mounts:
# ── Standard project mounts (preserve defaults) ──────────────────────────
# Mount content/en/ directly as the English language content root so that
# URLs are generated without an /en/ prefix (matching production behavior).
- source: content/en
target: content
lang: en
- source: static
target: static
- source: layouts
target: layouts
- source: data
target: data
- source: assets
target: assets
- source: i18n
target: i18n
- source: archetypes
target: archetypes
# ── Test fixtures ─────────────────────────────────────────────────────────
# Mount alongside the real bibliography content for the English language.
- source: tests/fixtures/bibliography
target: content/history/bibliography
lang: en
1 change: 1 addition & 0 deletions content/en/history/bibliography/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ heading: Interlisp Bibliography
type: bibliography
cascade:
type: bibliography
toc_hide: true
weight: 5
aliases:
- /bibliography/
Expand Down
27 changes: 27 additions & 0 deletions layouts/_partials/bibliography-date.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- /*
bibliography-date.html
Resolves a bibliography page's publication date.

The front-matter `date` param is a plain YYYY-MM-DD string produced by
bibSplit.pl. Hugo's built-in .Date can be a full datetime parsed from git
history; this partial prefers the explicit param when it is well-formed.

Accepts: page context (.)
Returns: dict
dateISO – YYYY-MM-DD string; "0001-01-01" when no date is known
hasDate – true when dateISO is not the zero value
dateLabel – .Params.readabledate when present, otherwise dateISO
*/ -}}
{{- $dateTime := .Date -}}
{{- with .Params.date -}}
{{- $iso := trim . " " -}}
{{- if and (ne $iso "") (findRE `^\d{4}-\d{2}-\d{2}$` $iso) -}}
{{- $dateTime = time $iso -}}
{{- end -}}
{{- end -}}
{{- $dateISO := $dateTime.Format "2006-01-02" -}}
{{- return dict
"dateISO" $dateISO
"hasDate" (ne $dateISO "0001-01-01")
"dateLabel" (or .Params.readabledate $dateISO)
-}}
Loading