fix: drop noindex from category redirect stubs

Redirect stubs for renamed category URLs carried a robots noindex meta, so Search Console filed them under "Excluded by 'noindex' tag" instead of treating the instant meta refresh as a permanent redirect, and the old URLs' ranking was not passed to the new pages.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-10-07 18:36:19 +08:00
co-authored by Claude
parent 0d43bebcef
commit f6c80bf440
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -5,7 +5,6 @@
<link rel="canonical" href="{{ target_url }}">
<script>location="{{ target_url }}"</script>
<meta http-equiv="refresh" content="0; url={{ target_url }}">
<meta name="robots" content="noindex">
<h1>Redirecting&hellip;</h1>
<a href="{{ target_url }}">Click here if you are not redirected.</a>
</html>
+1 -1
View File
@@ -1083,7 +1083,7 @@ class TestBuild:
stub = (site / "categories" / "old-widgets" / "index.html").read_text(encoding="utf-8")
assert '<link rel="canonical" href="https://awesome-python.com/categories/widgets/">' in stub
assert '<meta http-equiv="refresh" content="0; url=https://awesome-python.com/categories/widgets/">' in stub
assert '<meta name="robots" content="noindex">' in stub
assert "noindex" not in stub
assert "old-widgets" not in (site / "sitemap.xml").read_text(encoding="utf-8")
def test_build_renders_category_intro_and_uses_lead_as_meta_description(self, tmp_path):