This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a commit to branch feat/oink-core-platform
in repository https://gitbox.apache.org/repos/asf/hugegraph-doc.git

commit a50911da9a9882f20d25ee40868f23e3416fcf96
Author: dark <[email protected]>
AuthorDate: Fri Sep 4 20:33:22 2026 +0800

    fix(versioning): mark archive aliases noindex
    
    - add noindex metadata when Hugo alias pages omit robots
    - preserve dedicated nofollow handling for 404 documents
    - fail closed when archive HTML has no head or robots marker
---
 scripts/versioning.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/scripts/versioning.py b/scripts/versioning.py
index c35bd8038..5c902ae68 100644
--- a/scripts/versioning.py
+++ b/scripts/versioning.py
@@ -2113,6 +2113,16 @@ def mark_historical_pages_noindex(output: pathlib.Path) 
-> int:
         rendered, count = ROBOTS_META_RE.subn(
             '<meta name="robots" content="noindex,follow">', source
         )
+        if count == 0:
+            rendered, count = re.subn(
+                r"</head>",
+                '<meta name="robots" content="noindex,follow"></head>',
+                rendered,
+                count=1,
+                flags=re.IGNORECASE,
+            )
+        if count != 1:
+            fail(f"historical page must contain one head/robots marker: 
{path}")
         if count:
             path.write_text(rendered, encoding="utf-8")
             changed += count

Reply via email to