adjust for using a subdomain instead.

This commit is contained in:
ed committed 2026-08-25 13:04:32 -04:00
1 parent 0703c7a1fc
commit df49bb41b1
5 files changed
+14 -16

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ Recovered threads and submerged records.
An [Obsidian](https://obsidian.md) vault published with [Quartz 5](https://quartz.jzhao.xyz) to GitHub Pages. The site is a convenient host for Twitter/X threads and other material that is not reliably web-indexed.
Live (after Pages is enabled): https://ed94.github.io/Threadwell
Live (after Pages is enabled): [threadwell.edsabode.dev](https://threadwell.edsabode.dev)
## Post an issue for an inaccuracy
@@ -114,7 +114,7 @@ Open http://localhost:8080
1. Repo Settings → Pages → Source: **GitHub Actions**
2. If an old `github-pages` environment blocks the first deploy, delete it under Settings → Environments. The workflow recreates it.
3. Push `main`. CI clones Quartz into `site/`, applies `publish/quartz.config.yaml`, builds with `-d ..`.
4. Site: `https://ed94.github.io/Threadwell`
4. Site: `https://threadwell.edsabode.dev`
`baseUrl` lives in `publish/quartz.config.yaml`. Change it if you attach a custom domain.
-2
View File
@@ -6,8 +6,6 @@ description: Recovered threads and submerged records.
tags: []
---
<script>if(location.pathname==="/Threadwell")location.replace("/Threadwell/")</script>
An archive of material that is not reliably web-indexed: Twitter/X threads, talks, and other primary sources, plus the notes distilled from them.
- [[archive/index|Archive]] — objective records of threads and other sources
+4 -4
View File
@@ -1,4 +1,4 @@
"""Keep in-site links under the /Threadwell/ path.
"""Keep in-site links under the path from `baseUrl`.
Two stages:
@@ -42,7 +42,7 @@ def read_base_url() -> tuple[str, str]:
if stripped.startswith("baseUrl:"):
host = stripped.split(":", 1)[1].strip()
break
if not host or "/" not in host:
if not host:
raise SystemExit(f"missing baseUrl in {OVERLAY}")
if host.startswith("http://"):
scheme = "http://"
@@ -134,8 +134,8 @@ def patch_spa() -> bool:
def page_dir_href(html_path: Path, public: Path, rel_base: str) -> str:
"""Return the path-absolute directory of a built HTML file.
`public/archive/threads/h/slug/index.html` with rel_base `/Threadwell/`
becomes `/Threadwell/archive/threads/h/slug/`.
`public/archive/threads/h/slug/index.html` with rel_base `/`
becomes `/archive/threads/h/slug/`.
"""
rel = html_path.relative_to(public).as_posix()
if rel.endswith("/index.html"):
+6 -5
View File
@@ -14,7 +14,8 @@ DEEP_SLUG: str = (
"archive/threads/notimothylottes/2025-02-04-gelatinous-pixel-soup/index.html"
)
PAGE_BASE: str = (
"/Threadwell/archive/threads/notimothylottes/2025-02-04-gelatinous-pixel-soup/"
f"{apply.REL_BASE.rstrip('/')}/archive/threads/"
"notimothylottes/2025-02-04-gelatinous-pixel-soup/"
)
SAMPLE: str = (
"<html><head></head><body>"
@@ -57,24 +58,24 @@ class ApplyBaseTests(unittest.TestCase):
match = re.search(r'<base href="([^"]+)">', text)
self.assertIsNotNone(match)
assert match is not None
resolved = urljoin("https://edsabode.dev" + match.group(1), DEEP_REL)
resolved = urljoin(urljoin(apply.ABS_BASE, match.group(1)), DEEP_REL)
self.assertEqual(
resolved,
"https://edsabode.dev/Threadwell/archive/threads/notimothylottes/",
urljoin(apply.ABS_BASE, "archive/threads/notimothylottes/"),
)
def test_homepage_base_is_site_path(self) -> None:
path = _write_public(self.public, "index.html", SAMPLE)
apply.rewrite_html(path)
text = path.read_text(encoding="utf-8")
self.assertIn('<base href="/Threadwell/">', text)
self.assertIn(f'<base href="{apply.REL_BASE}">', text)
def test_title_link_is_site_path_not_domain_root(self) -> None:
path = _write_public(self.public, DEEP_SLUG, SAMPLE)
apply.rewrite_html(path)
text = path.read_text(encoding="utf-8")
self.assertIn(
'<h2 class="page-title"><a href="/Threadwell/">',
f'<h2 class="page-title"><a href="{apply.REL_BASE}">',
text,
)
self.assertNotIn('href="https://edsabode.dev/Threadwell/"', text)
+2 -3
View File
@@ -6,9 +6,8 @@ configuration:
enablePopovers: true
analytics: null
locale: en-US
# Site is served at /Threadwell/ (project Pages + custom domain).
# Without the path, ./archive/ from /Threadwell (no slash) becomes /archive/.
baseUrl: edsabode.dev/Threadwell/
# Site is served at the host root (project Pages custom domain).
baseUrl: threadwell.edsabode.dev
ignorePatterns:
- site
- .github