Skip to content
This repository was archived by the owner on Nov 14, 2026. It is now read-only.
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Plain HTML and CSS in `site/`, with no build step and no dependencies.
- Test: `python3 -I -m unittest discover -s tests -v`
- Deploy: every push to `main` publishes `site/` to GitHub Pages (`.github/workflows/ci.yml`).

`site/shark-ng-table/` redirects the old demo URL to `https://quantas.github.io/shark-ng-table/`.
Project Pages sites under the `Quantas` account used to live at `www.quantasnet.com/<repo>/`. Each one keeps its old address through a redirect page at `site/<repo>/index.html` pointing to `https://quantas.github.io/<repo>/`; add one (and an entry in `PROJECT_REDIRECTS` in the tests) for any new project site.

Licensed under Apache-2.0.
14 changes: 14 additions & 0 deletions site/shark-ng-table-samples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The shark-ng-table samples site has moved</title>
<meta http-equiv="refresh" content="0; url=https://quantas.github.io/shark-ng-table-samples/">
<link rel="canonical" href="https://quantas.github.io/shark-ng-table-samples/">
<meta name="robots" content="noindex">
</head>
<body>
<p>The shark-ng-table samples site is now at <a href="https://quantas.github.io/shark-ng-table-samples/">quantas.github.io/shark-ng-table-samples</a>.</p>
</body>
</html>
14 changes: 14 additions & 0 deletions site/wow-forever-atlas/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WoW Forever Atlas has moved</title>
<meta http-equiv="refresh" content="0; url=https://quantas.github.io/wow-forever-atlas/">
<link rel="canonical" href="https://quantas.github.io/wow-forever-atlas/">
<meta name="robots" content="noindex">
</head>
<body>
<p>WoW Forever Atlas is now at <a href="https://quantas.github.io/wow-forever-atlas/">quantas.github.io/wow-forever-atlas</a>.</p>
</body>
</html>
28 changes: 19 additions & 9 deletions tests/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
]
FORBIDDEN_TEXT = ["Nelnet", "gitshark", "QLAN", "shark-ci-server", "dbUnit", "QuantasNet"]
SHARK_NG_TABLE_DEMO = "https://quantas.github.io/shark-ng-table/"
# Project Pages sites under the Quantas account used to be served at
# www.quantasnet.com/<repo>/ through the old user site's custom domain. Each
# old path keeps working through a redirect stub to the site's github.io URL.
PROJECT_REDIRECTS = {
"shark-ng-table": SHARK_NG_TABLE_DEMO,
"shark-ng-table-samples": "https://quantas.github.io/shark-ng-table-samples/",
"wow-forever-atlas": "https://quantas.github.io/wow-forever-atlas/",
}

# (tag, attribute) pairs that make the browser fetch something.
RESOURCE_ATTRS = {("link", "href"), ("script", "src"), ("img", "src"), ("source", "src")}
Expand Down Expand Up @@ -205,15 +213,17 @@ def test_colors_only_in_tokens(self):
leftover = COLOR_LITERAL.findall(strip_token_blocks(f.read_text(encoding="utf-8")))
self.assertEqual(leftover, [], f.relative_to(SITE))

def test_shark_ng_table_redirect(self):
path = SITE / "shark-ng-table" / "index.html"
self.assertTrue(path.is_file())
page = parse(path)
refresh = [a for a in page.find("meta") if (a.get("http-equiv") or "").lower() == "refresh"]
self.assertEqual(refresh[0].get("content"), f"0; url={SHARK_NG_TABLE_DEMO}")
canonical = [a for a in page.find("link") if a.get("rel") == "canonical"]
self.assertEqual(canonical[0].get("href"), SHARK_NG_TABLE_DEMO)
self.assertIn(SHARK_NG_TABLE_DEMO, {a.get("href") for a in page.find("a")})
def test_project_redirects(self):
for name, target in PROJECT_REDIRECTS.items():
with self.subTest(name=name):
path = SITE / name / "index.html"
self.assertTrue(path.is_file())
page = parse(path)
refresh = [a for a in page.find("meta") if (a.get("http-equiv") or "").lower() == "refresh"]
self.assertEqual(refresh[0].get("content"), f"0; url={target}")
canonical = [a for a in page.find("link") if a.get("rel") == "canonical"]
self.assertEqual(canonical[0].get("href"), target)
self.assertIn(target, {a.get("href") for a in page.find("a")})

def test_404(self):
path = SITE / "404.html"
Expand Down
Loading