Skip to content

Render the docs site instead of publishing the repository - #46

Merged
t4k merged 2 commits into
caltechlibrary:mainfrom
t4k:new1/adopt-shared-docs-workflow
Sep 1, 2026
Merged

Render the docs site instead of publishing the repository#46
t4k merged 2 commits into
caltechlibrary:mainfrom
t4k:new1/adopt-shared-docs-workflow

Conversation

@t4k

@t4k t4k commented Sep 1, 2026

Copy link
Copy Markdown
Member

static.yml uploads the entire repository as the Pages artifact (path: '.'). This replaces it with an actual build.

Three problems it fixes, all live right now

Repository internals are served publicly. All of these return 200 from software.library.caltech.edu/CL-web-components/ today:

Makefile   codemeta.json   deno.json   page.tmpl

The site is whatever HTML happens to be committed, and it has already drifted. Commit 7f20bdd updated the hostname in INSTALL.md and README.md, but the committed HTML was never regenerated — so the live pages still say caltechlibrary.github.io:

$ curl -s .../INSTALL.html | grep caltechlibrary.github.io
  caltechlibrary.github.io/CL-web-components

Search is broken. search.md and pagefind/ were removed but the generated search.html stayed committed, so the page loads and silently does nothing:

search.html               200
pagefind/pagefind-ui.js   404
pagefind/pagefind.js      404

Rendering from source fixes all three without anyone having to remember anything.

What changed

  • The build is referenced, not copied. It lives in caltechlibrary/workflows at @v1, so a fix there reaches this site — and every other Caltech Library site — on the next run, with nothing written back here.
  • Sources move into docs/. Demo and test pages move with them; they are sources, not output.
  • Search is restored. search.md returns unchanged, the index is rebuilt every run rather than committed, and the nav link is uncommented.
  • pandoc/page.tmpl is kept and passed as an override, because its nav is specific to this project.
  • Both Lua filters are deleted — byte-identical to the shared copies, which the build now supplies.
  • deno.json bundles into dist/ rather than over the repository root, so the site gets freshly built bundles rather than whatever was last committed. (release was already doing this and had drifted from build.)
  • static.yml, website.mak, website.ps1 deleted.

Verified against what is published today

The built site was compared page-by-page with the HTML currently committed:

Byte-identical 38
Changed because I edited the source 1 — DEPLOYMENT.md
Changed because the committed HTML was stale 2 — INSTALL.html, index.html (the hostname above)
Restored 1 — search.html, now with a working index (41 pages)
Not built 1 — about.html

On about.html: about.md was deleted but its generated HTML is still committed, so the site serves a page with no source. It is already commented out of the nav. This stops publishing it. If it should come back, the fix is to restore the Markdown — say the word.

Every other asset is unchanged: bundles, mod.js, LICENSE, css/, src/.

Reviewer notes

  • Requires an admin to keep Settings → Pages → Source on "GitHub Actions". No change needed — static.yml already uses it. The custom domain is a repository setting with no CNAME file, so artifact deploys do not disturb it.
  • README.md and INSTALL.md stay in the root because cmt writes them there and can only write to the root — its generator registry keys on the exact output filename, so cmt codemeta.json docs/about.md exits with unsupported format. extra-sources: "*.md" renders them, so nothing published today stops being published.
  • This calls the build action rather than the docs-pandoc.yml reusable workflow, because the site publishes compiled bundles and a reusable workflow gives the caller nowhere to add a Deno setup step.
  • Pagefind is already current. The shared action pins 1.5.2, the latest release. The accessibility improvements associated with 1.5.0 come from its new Component UI, which that release explicitly makes optional — the Default UI "remains available and supported". Migrating is worth doing once in the shared repository rather than per-site, since this search page is byte-identical across at least three repos: Ship a search page with build-pandoc, using Pagefind's Component UI workflows#1.
  • Sources moving to docs/ means the generated HTML still committed in the root is now unused by the build. Removing it is a separate, purely subtractive change.

🤖 Generated with Claude Code

t4k and others added 2 commits September 1, 2026 10:11
static.yml uploads the entire repository as the Pages artifact
(`path: '.'`). Two consequences, both live right now:

- Repository internals are served publicly. Makefile, codemeta.json,
  deno.json and page.tmpl all return 200 from
  software.library.caltech.edu/CL-web-components/.
- The site is whatever HTML happens to be committed. Nothing renders the
  Markdown, so a documentation change only reaches the site if someone
  remembers to run `make website` and commit the output.

This replaces it with a build. The build logic is not copied into this
repository: it lives in caltechlibrary/workflows and is referenced at @v1, so
a fix there reaches this site -- and every other Caltech Library site -- on
the next run, with nothing written back here.

Sources move into docs/, which is what makes the rest possible: the build no
longer looks at the repository root, so the generated HTML committed there
becomes unused and can be removed separately rather than as part of this
change. Demo and test pages move with them; they are sources, not output.

README.md and INSTALL.md stay in the root because cmt writes them there and
can only write to the root -- its generator registry keys on the exact output
filename, so `cmt codemeta.json docs/about.md` exits with "unsupported
format". `extra-sources: "*.md"` renders them, so every Markdown file that is
published today is still published.

The Pandoc Lua filters are no longer carried here; both are byte-identical to
the shared copies. page.tmpl stays, moved to pandoc/ and passed as an
override, because its nav is specific to this project.

deno.json now bundles into dist/ rather than over the top of the repository
root, so the workflow publishes freshly built bundles rather than whatever was
last committed. The `release` task was already doing this and had drifted from
`build`, which is why release zips and local builds could disagree.

website.mak and website.ps1 are deleted; nothing reads them once the build is
in CI, and leaving them invites someone to run a build that writes HTML back
into the working tree.

No search index is built. search.md and pagefind/ were removed and the Search
link is commented out of the nav, so there is no page to index. Adding search
back is a separate decision.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
search.md and pagefind/ were removed and the Search nav link commented out,
but the generated search.html stayed committed -- so the live site serves a
search page whose assets 404:

    search.html               200
    pagefind/pagefind-ui.js   404
    pagefind/pagefind.js      404

The page loads and silently does nothing.

The index is rebuilt on every run now rather than committed, so it cannot go
stale the way the old one did. search.md returns to docs/ unchanged, including
the two behaviours worth keeping: baseUrl computed from the path, so results
resolve under a project-pages prefix, and ?q= deep-linking via triggerSearch.

The shared action pins Pagefind 1.5.2, which is the current release. The
accessibility improvements people associate with 1.5.0 come from its new
Component UI, which the release notes are explicit is optional -- the Default
UI "remains available and supported" at this version. Migrating to the
Component UI is worth doing but is a separate change, and worth doing once in
the shared repository rather than in each site: this search page is
byte-identical across CL-web-components, CL-Pandoc-filters and etd-workflow,
and near-identical in several more.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@t4k
t4k merged commit c316672 into caltechlibrary:main Sep 1, 2026
2 checks passed
t4k added a commit to t4k/CL-web-components that referenced this pull request Sep 1, 2026
Adopting the MADR format already used in caltechlibrary/alchemist and
caltechlibrary/workflows: docs/decisions/, NNNN-kebab-case.md, immutable once
accepted, rejected options recorded.

Two decisions, chosen on the test in ADR-0001 -- a decision worth recording is
one whose result looks like unnecessary complication to someone who did not
watch it being made, and which a future reader would therefore be tempted to
"simplify" back:

  0002  build the site rather than publishing the repository
  0003  keep sources and generated files in separate namespaces

Both carry the alternatives that were rejected and why, which is the part the
code cannot show. 0002 records that a self-contained workflow was built first
and worked, and was rejected anyway because it is a copy -- and that the
reusable workflow cannot be used here, since a caller cannot add a Deno setup
step to a job it did not write. 0003 records why several Markdown files stay in
the root: cmt writes them there and its generator registry keys on the exact
output filename, so it cannot write to docs/.

The reasoning was in the description of caltechlibrary#46, which stops being read the moment
it merges.

The ADRs are not rendered into the site: the build globs docs/*.md without
recursing, so docs/decisions/ is carried in the repository and read on GitHub.
That suits the audience -- they are for people changing this repository, not
for people using the components.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
t4k added a commit that referenced this pull request Sep 2, 2026
The 28 committed HTML files became orphaned when #46 moved the docs build
to assemble from docs/ rather than filtering the repository root. Nothing
reads them: no kept file links to any of them, and the build globs only
Markdown. Both pages that matter are generated -- README.md becomes
index.html via build-pandoc's --index-from default, and docs/search.md
becomes search.html.

make.ps1 goes with website.ps1 and website.mak, already removed. .nojekyll
was for branch-based Pages; deployment is artifact-based now, so Jekyll
never runs.

INSTALL_NOTES_macOS.md and INSTALL_NOTES_Windows.md document bypassing
Gatekeeper and SmartScreen for unsigned executables. This repository ships
browser JavaScript and has no executables. cmt already excludes both from
--init for deno-webcomponent projects, so removing them applies its design
rather than diverging from it.

Also drops the PowerShell block in docs/building_web_components_with_deno.md,
which invoked the deleted make.ps1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant