Skip to content

build_site.py: publish each page at its own repo path, not under labs/labs/ - #38

Merged
litkhai merged 1 commit into
mainfrom
site-lab-paths
Sep 29, 2026
Merged

litkhai merged 1 commit into
mainfrom
site-lab-paths

Conversation

@litkhai

@litkhai litkhai commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Closes #37.

Every lab page was published one directory deeper than the builder's own docstring claimed:

/labs/labs/elastic-migration/index.html   200
/labs/elastic-migration/index.html        404

The labs/ prefix was a namespace applied to every page, so workshops/ escaped it
(/labs/workshops/...) while anything under labs/ collided with it. Nothing was broken —
the index linked the doubled path and it resolved — every URL was just one segment uglier
than intended.

Dropping the namespace makes each URL mirror its repo path exactly, which is the property
the docstring described:

Repo path Before After
labs/elastic-migration /labs/labs/elastic-migration/ /labs/elastic-migration/
workshops/o11y-vector-ai /labs/workshops/o11y-vector-ai/ /workshops/o11y-vector-ai/
otel-profiles /labs/otel-profiles/ /otel-profiles/

Done now rather than later because the site went up today and nothing links to it yet.
Once a URL has been given to anyone outside this repository, changing it means keeping a
redirect for the old shape — and write_redirect() already exists for exactly that kind of
debt.

The prefix was hardcoded in six places that each had to move together: the page's depth
(which feeds the asset and breadcrumb paths), the prev/next pager, the index links, the
index-table link rewriter, the MOVED.md redirect targets and the sitemap.

Verified

Built the site and resolved every relative href and src against the filesystem: 43
relative links across 7 pages, none broken
. Sitemap now lists /labs/elastic-migration/,
/workshops/…, /otel-profiles/, /clickstack-config/.

The old /labs/labs/… URLs will 404 after this deploys, which is the point of doing it
before anyone has them.

🤖 Generated with Claude Code

…/labs/

The builder prefixed a literal `labs/` to a path that already starts with
`labs/` for anything under labs/, so every lab page was one directory deeper
than its docstring claimed:

  /labs/labs/elastic-migration/index.html   200
  /labs/elastic-migration/index.html        404

The site was internally consistent -- the index linked the doubled path and it
resolved -- so nothing was broken and every URL was one segment uglier than
intended. The prefix was a namespace, which is why workshops/ escaped it
(/labs/workshops/...) while labs/ collided with it.

Dropping the namespace makes a page's URL mirror its repo path exactly, which
is the property the docstring described and the one worth having: /labs/...,
/workshops/..., /otel-profiles/..., /clickstack-config/.

Done now rather than later because the site went up today and nothing links to
it yet. Once a URL has been given to anyone outside this repository, changing
it means keeping a redirect for the old shape.

Also fixes the page depth that fed the asset and crumb paths (a page is now
exactly as deep as its repo path), the prev/next pager, the index links, the
MOVED.md redirect targets and the sitemap -- all of which had the prefix
hardcoded separately.

Verified by building the site and resolving every relative href and src
against the filesystem: 43 relative links across 7 pages, none broken.

Closes #37

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@litkhai
litkhai merged commit f9f912b into main Sep 29, 2026
6 checks passed
@litkhai
litkhai deleted the site-lab-paths branch September 29, 2026 11:57
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.

build_site.py: every lab page is published under labs/labs/ instead of labs/

1 participant