From fd6a9ca5bf95fa7292d9d66456ffd31b5d2eb4ab Mon Sep 17 00:00:00 2001 From: Damon Blais Date: Mon, 16 Nov 2026 02:44:02 -0700 Subject: [PATCH 1/6] fix(pages): keep AGENTS.md and CLAUDE.md off the published site --- .github/workflows/copy-sync.yml | 2 ++ _config.yml | 2 +- scripts/check-unpublished.py | 39 +++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 scripts/check-unpublished.py diff --git a/.github/workflows/copy-sync.yml b/.github/workflows/copy-sync.yml index 53ad660..3d2d95d 100644 --- a/.github/workflows/copy-sync.yml +++ b/.github/workflows/copy-sync.yml @@ -25,3 +25,5 @@ jobs: persist-credentials: false - name: Tagline and cards match the org profile README run: python3 -I scripts/check-copy.py + - name: Built site does not publish AGENTS.md or CLAUDE.md + run: python3 -I scripts/check-unpublished.py diff --git a/_config.yml b/_config.yml index 761004a..136ec5b 100644 --- a/_config.yml +++ b/_config.yml @@ -2,7 +2,7 @@ title: Totative url: https://totative.dev permalink: /writeups/:title/ include: [".well-known"] -exclude: [README.md, scripts, lefthook.yml, .gitleaks.toml, Gemfile, Gemfile.lock, vendor] +exclude: [README.md, scripts, lefthook.yml, .gitleaks.toml, Gemfile, Gemfile.lock, vendor, AGENTS.md, CLAUDE.md] defaults: - scope: path: "" diff --git a/scripts/check-unpublished.py b/scripts/check-unpublished.py new file mode 100644 index 0000000..22de7be --- /dev/null +++ b/scripts/check-unpublished.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +"""Fail if AGENTS.md or CLAUDE.md would ship with the site.""" + +from __future__ import annotations + +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +NAMES = ("AGENTS.md", "CLAUDE.md") + + +def excluded_paths(config: str) -> list[str]: + match = re.search(r"^exclude:\s*\[(.*)\]\s*$", config, re.M) + if match is None: + raise SystemExit("_config.yml has no exclude list") + return [ + part.strip().strip("'\"") for part in match.group(1).split(",") if part.strip() + ] + + +def main() -> int: + excluded = excluded_paths((ROOT / "_config.yml").read_text()) + missing = [name for name in NAMES if name not in excluded] + if missing: + print("exclude lacks " + ", ".join(missing), file=sys.stderr) + return 1 + site = ROOT / "_site" + if site.is_dir(): + published = [name for name in NAMES if (site / name).is_file()] + if published: + print("_site contains " + ", ".join(published), file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) From bd096275db9b6464997704da625b68a96fa7d26b Mon Sep 17 00:00:00 2001 From: Damon Blais Date: Mon, 16 Nov 2026 03:59:38 -0700 Subject: [PATCH 2/6] fix(seo): point pages at the totative.dev canonical --- _layouts/default.html | 1 + scripts/check-copy.py | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 3a5ab8a..64a959b 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -8,6 +8,7 @@ {% if page.title %}{{ page.title }} - {% endif %}Totative + diff --git a/scripts/check-copy.py b/scripts/check-copy.py index d7df68f..6cb0d08 100644 --- a/scripts/check-copy.py +++ b/scripts/check-copy.py @@ -1,4 +1,5 @@ """Fail when the site's tagline, work-area cards or tools list differ from the org profile README's.""" + import re import sys import urllib.request @@ -9,22 +10,35 @@ def profile_copy(md: str) -> tuple[str, list[tuple[str, str]], list[tuple[str, str]]]: tagline = re.search(r'

\s*([^<]+?)\s*

', md).group(1) - tools = re.findall(r"^- \[([^\]]+)\]\(https://github\.com/Totative/[^)]+\): (.+)$", md, re.M) + tools = re.findall( + r"^- \[([^\]]+)\]\(https://github\.com/Totative/[^)]+\): (.+)$", md, re.M + ) return tagline, re.findall(r"([^<]+)
([^<]+)", md), tools def site_copy(html: str) -> tuple[str, list[tuple[str, str]], list[tuple[str, str]]]: tagline = re.search(r"

([^<]+)

", html).group(1) - tools = re.findall(r'
  • ([^<]+): ([^<]+)
  • ', html) + tools = re.findall( + r'
  • ([^<]+): ([^<]+)
  • ', + html, + ) return tagline, re.findall(r"

    ([^<]+)

    ([^<]+)

    ", html), tools +def check_canonical(layout: str) -> None: + if '' not in layout: + raise SystemExit("pages need a totative.dev canonical") + + def main() -> int: + check_canonical(Path("_layouts/default.html").read_text()) md = urllib.request.urlopen(PROFILE, timeout=30).read().decode() want, have = profile_copy(md), site_copy(Path("index.html").read_text()) assert want[1], "no cards found in the profile README" if want == have: - print(f"site copy matches the profile: tagline, {len(have[1])} cards, {len(have[2])} tools") + print( + f"site copy matches the profile: tagline, {len(have[1])} cards, {len(have[2])} tools" + ) return 0 print(f"profile: {want}\nsite: {have}", file=sys.stderr) return 1 From 3e5467a782369a0f8bc2dba279c67f54e6ac0d96 Mon Sep 17 00:00:00 2001 From: Damon Blais Date: Mon, 16 Nov 2026 03:59:58 -0700 Subject: [PATCH 3/6] fix(seo): make the home lede the page heading --- index.html | 2 +- scripts/check-copy.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 4f78be9..d85a541 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ --- layout: default --- -

    Software security research, and the tools we build for it.

    +

    Software security research, and the tools we build for it.

    What we do

    diff --git a/scripts/check-copy.py b/scripts/check-copy.py index 6cb0d08..965cf1c 100644 --- a/scripts/check-copy.py +++ b/scripts/check-copy.py @@ -17,7 +17,7 @@ def profile_copy(md: str) -> tuple[str, list[tuple[str, str]], list[tuple[str, s def site_copy(html: str) -> tuple[str, list[tuple[str, str]], list[tuple[str, str]]]: - tagline = re.search(r"

    ([^<]+)

    ", html).group(1) + tagline = re.search(r"

    ([^<]+)

    ", html).group(1) tools = re.findall( r'
  • ([^<]+): ([^<]+)
  • ', html, @@ -30,10 +30,17 @@ def check_canonical(layout: str) -> None: raise SystemExit("pages need a totative.dev canonical") +def check_home_h1(html: str) -> None: + if re.search(r"^

    [^<]+

    \s*$", html, re.M) is None: + raise SystemExit("home lede must be an h1") + + def main() -> int: check_canonical(Path("_layouts/default.html").read_text()) + index = Path("index.html").read_text() + check_home_h1(index) md = urllib.request.urlopen(PROFILE, timeout=30).read().decode() - want, have = profile_copy(md), site_copy(Path("index.html").read_text()) + want, have = profile_copy(md), site_copy(index) assert want[1], "no cards found in the profile README" if want == have: print( From 6e4ce4b2b7920f3fcfa06f3108f2e551f0217ba1 Mon Sep 17 00:00:00 2001 From: Damon Blais Date: Mon, 16 Nov 2026 04:00:22 -0700 Subject: [PATCH 4/6] fix(seo): noindex the 404 body and skip its canonical --- 404.html | 1 + _layouts/default.html | 5 +++++ scripts/check-copy.py | 20 +++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/404.html b/404.html index 338a45a..d46eb10 100644 --- a/404.html +++ b/404.html @@ -2,6 +2,7 @@ layout: default title: Not found permalink: /404.html +noindex: true ---

    Page not found

    That page does not exist. Go to the home page.

    diff --git a/_layouts/default.html b/_layouts/default.html index 64a959b..a99c234 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -8,7 +8,12 @@ {% if page.title %}{{ page.title }} - {% endif %}Totative +{% if page.noindex %} + +{% else %} +{% endif %} + diff --git a/scripts/check-copy.py b/scripts/check-copy.py index 965cf1c..b5c697d 100644 --- a/scripts/check-copy.py +++ b/scripts/check-copy.py @@ -35,10 +35,28 @@ def check_home_h1(html: str) -> None: raise SystemExit("home lede must be an h1") +def check_404_noindex(layout: str, not_found: str) -> None: + branch = re.search( + r"\{%\s*if page\.noindex\s*%\}(.*)\{%\s*else\s*%\}(.*)\{%\s*endif\s*%\}", + layout, + re.S, + ) + if branch is None: + raise SystemExit("default layout needs a page.noindex branch") + if 'name="robots" content="noindex"' not in branch.group(1): + raise SystemExit("noindex branch missing robots meta") + if 'rel="canonical"' in branch.group(1): + raise SystemExit("noindex branch must not emit canonical") + if re.search(r"^noindex:\s*true\s*$", not_found, re.M) is None: + raise SystemExit("404.html needs noindex: true") + + def main() -> int: - check_canonical(Path("_layouts/default.html").read_text()) + layout = Path("_layouts/default.html").read_text() + check_canonical(layout) index = Path("index.html").read_text() check_home_h1(index) + check_404_noindex(layout, Path("404.html").read_text()) md = urllib.request.urlopen(PROFILE, timeout=30).read().decode() want, have = profile_copy(md), site_copy(index) assert want[1], "no cards found in the profile README" From 1d84ed96024e339c368b99e90e937b18d5162bb8 Mon Sep 17 00:00:00 2001 From: Damon Blais Date: Mon, 16 Nov 2026 04:03:11 -0700 Subject: [PATCH 5/6] fix(seo): give the 404 its own description --- 404.html | 1 + 1 file changed, 1 insertion(+) diff --git a/404.html b/404.html index d46eb10..a008287 100644 --- a/404.html +++ b/404.html @@ -1,6 +1,7 @@ --- layout: default title: Not found +description: That page is not here. Totative's write-ups and brand assets live at totative.dev. permalink: /404.html noindex: true --- From 99b574b1ba742e0977b77584ce43dffd5d14a092 Mon Sep 17 00:00:00 2001 From: Damon Blais Date: Mon, 16 Nov 2026 04:03:29 -0700 Subject: [PATCH 6/6] feat(seo): redirect every page to totative.dev --- _layouts/default.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_layouts/default.html b/_layouts/default.html index a99c234..dc35fe7 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -9,11 +9,13 @@ {% if page.title %}{{ page.title }} - {% endif %}Totative {% if page.noindex %} +{% assign target = '/' %} {% else %} +{% assign target = page.url %} {% endif %} - + @@ -27,6 +29,7 @@
    +

    This site has moved to totative.dev{{ target }}.

    {{ content }}