Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

fix: redirect the pre-mkdocs project docs page by page - #15

Closed
shenxianpeng wants to merge 1 commit into
mainfrom
fix/redirect-old-project-docs
Closed

shenxianpeng wants to merge 1 commit into
mainfrom
fix/redirect-old-project-docs

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

Why

Before MkDocs, the docs were Sphinx pages at commit-check.github.io/commit-check/<page>.html, published by the commit-check/commit-check repo. That project site isn't published any more, so these paths fall through to this site's 404 fallback, and every reader lands on the commit-check.com home page instead of the page they wanted.

These URLs are still linked from:

  • the README of every release up to v2.12, and therefore from their PyPI pages (example.html ×6, cli_args.html ×3, configuration.html ×2, what-is-new.html ×2, example.html#push-validation-examples)
  • older blog posts and third-party articles

What

  • scripts/build_redirects.py: a separate OLD_PROJECT_DOCS map, one stub per Sphinx page of v2.12.2 plus cli_args.html:

    old new
    /commit-check/ (and index.html), README.html /
    configuration.html /configuration/
    cli_args.html /configuration/#command-line-arguments
    example.html /example/
    migration.html / troubleshoot.html / changelog.html same-named page
    what-is-new.html /changelog/#v200

    Every target, including both anchors, returns 200 on commit-check.com.

  • The stub script now appends the reader's #fragment only when the target doesn't already name a section.

  • netlify.toml: matching real 301s ahead of the catch-all.

  • tests/: every old page gets a stub at its own file path, and the two maps don't overlap.

  • README: one row in the redirect table.

Checked

pytest tests/ -q → 4 passed. That includes the existing check that builds the old MkDocs site and compares its URLs against the map.

Archive status

I unarchived this repository so this PR could be opened. After it merges and the Pages deploy succeeds, the repository should be archived again. Pages keeps serving the last deployed artifact.

Before the mkdocs site, the documentation was Sphinx, published by the
commit-check/commit-check repository at
commit-check.github.io/commit-check/<page>.html. That project site is no
longer published, so GitHub Pages serves those paths from this site, where
they fell through to the 404 fallback and sent every reader to the home page.

They are still linked from the README of every release up to v2.12 (and so
from PyPI), from blog posts and from the Action's docs. Each now gets its own
stub pointing at the page that replaced it (configuration.html ->
/configuration/, cli_args.html -> /configuration/#command-line-arguments,
what-is-new.html -> /changelog/#v200, ...), with matching 301s for Netlify.

The stub script no longer appends the reader's fragment when the target
already names a section, which would have produced a URL with two '#'.
@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for commit-check-github-io ready!

Name Link
🔨 Latest commit c15b609
🔍 Latest deploy log https://app.netlify.com/projects/commit-check-github-io/deploys/6ab635875f50460008b83916
😎 Deploy Preview https://deploy-preview-15--commit-check-github-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@shenxianpeng

Copy link
Copy Markdown
Member Author

Closing: this repository is no longer maintained, and the old Sphinx URLs already land on commit-check.com (the home page) rather than breaking. Not worth unarchiving for.

@shenxianpeng
shenxianpeng deleted the fix/redirect-old-project-docs branch September 25, 2026 08:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant