feat: publish unlisted GTIN tool
This commit is contained in:
@@ -40,6 +40,7 @@ from theme import CSS, TOKENS # noqa: E402
|
||||
|
||||
WIDTHS = (480, 768, 1200, 1600)
|
||||
WEBP_QUALITY = 84
|
||||
UNLISTED_HTML = ["gtin/index.html"]
|
||||
|
||||
INK = (23, 20, 15)
|
||||
PAPER = (246, 242, 234)
|
||||
@@ -278,6 +279,9 @@ def build_html(table: dict[str, dict]) -> list[tuple[str, str]]:
|
||||
target.write_text(html, encoding="utf-8")
|
||||
written.append((path, rel))
|
||||
print(f" [html] {rel}")
|
||||
shutil.rmtree(SITE / "gtin", ignore_errors=True)
|
||||
shutil.copytree(SRC / "gtin", SITE / "gtin")
|
||||
print(" [html] gtin/index.html (unlisted browser tool)")
|
||||
not_found = pages.not_found().replace("og-desfoto.jpg", "og-desfoto.jpg")
|
||||
(SITE / "404.html").write_text(not_found, encoding="utf-8")
|
||||
print(" [html] 404.html")
|
||||
@@ -287,7 +291,7 @@ def build_html(table: dict[str, dict]) -> list[tuple[str, str]]:
|
||||
def build_meta_files(routes: list[tuple[str, str]]) -> None:
|
||||
today = dt.date.today().isoformat()
|
||||
urls = []
|
||||
for path, _rel, _f, _x, priority in pages.ROUTES:
|
||||
for path, _rel, _factory, _extra, priority in pages.ROUTES:
|
||||
urls.append(
|
||||
f" <url><loc>{SITE_META['url']}{path}</loc><lastmod>{today}</lastmod>"
|
||||
f"<changefreq>{'weekly' if priority == '1.0' else 'monthly'}</changefreq>"
|
||||
@@ -571,7 +575,11 @@ def prune_stale_pages(routes: list[tuple]) -> None:
|
||||
leave its old HTML (and its retired image srcsets) behind and the link check
|
||||
would keep failing on files nobody serves any more.
|
||||
"""
|
||||
expected = {SITE / route[1] for route in routes} | {SITE / "404.html"}
|
||||
expected = (
|
||||
{SITE / route[1] for route in routes}
|
||||
| {SITE / rel for rel in UNLISTED_HTML}
|
||||
| {SITE / "404.html"}
|
||||
)
|
||||
for html in sorted(SITE.rglob("*.html")):
|
||||
if html in expected:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user