Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
# build (and only this one — the test job keeps the local root base)
# compiles with the full Pages URL. Zola 0.23 has no config
# env-var expansion, so the value is rewritten in the pipeline.
run: sed -i 's|^base_url = .*|base_url = "https://openperpetuum.github.io/Wiki"|' config.toml
run: sed -i 's|^base_url = .*|base_url = "https://openperpetuum.github.io/wiki"|' config.toml

- name: Build
# Zola 0.23 builds from the current directory (no -d flag); the
Expand All @@ -189,7 +189,7 @@ jobs:
# The source targets the domain root (base_url "/", so local and the
# test job share the output); Zola 0.23 does not rewrite
# site-absolute links, so prefix them with the /Wiki path here.
run: python3 tools/rewrite_site_base.py public https://openperpetuum.github.io/Wiki
run: python3 tools/rewrite_site_base.py public https://openperpetuum.github.io/wiki

- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # ratchet:actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title = "Open Perpetuum Wiki"
description = "Player and developer reference for the Open Perpetuum server: what you can do in the game, entity stats, zone generation, and stat field semantics."
# Local/test base: the site lives at the domain root. The CI DEPLOY build
# rewrites this to the GitHub Pages project URL (a subpath —
# openperpetuum.github.io/Wiki/), see .github/workflows/wiki.yml; Zola 0.23
# openperpetuum.github.io/wiki/), see .github/workflows/wiki.yml; Zola 0.23
# has no config env-var expansion, so the override happens in the pipeline.
base_url = "/"
generate_feeds = false
Expand Down
4 changes: 2 additions & 2 deletions tools/rewrite_site_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

The site is written against the domain root (base_url = "/") so local
development and the test job see the same output. GitHub Pages serves a
PROJECT site under a subpath (openperpetuum.github.io/Wiki/), and Zola 0.23
PROJECT site under a subpath (openperpetuum.github.io/wiki/), and Zola 0.23
does NOT rewrite site-absolute links ("/style.css", "/zones/...") — only
the sitemap's canonical URLs pick up base_url. This pass prefixes every
href="/..." and src="/..." in the built HTML/SVG with the base's path
part ("/Wiki") so the same build works under the subpath.

Usage: python3 tools/rewrite_site_base.py <site_dir> <base_url>
python3 tools/rewrite_site_base.py public https://openperpetuum.github.io/Wiki
python3 tools/rewrite_site_base.py public https://openperpetuum.github.io/wiki

Idempotent: values already carrying the path part are left alone. Protocol
links ("//cdn..."), data: URIs, hashes and relative links never match.
Expand Down
Loading