fix(ci): update workflows and scripts for versioned docs layout

This commit is contained in:
xtheeq 2026-05-26 11:48:10 +05:30
parent 3f11ddda76
commit 9a54f2fa7c
2 changed files with 6 additions and 5 deletions

View file

@ -5,6 +5,7 @@ from pathlib import Path
DOCS_DIR = Path("docs")
WIKI_DIR = Path("wiki-temp")
LATEST_DIR = DOCS_DIR / "(git)"
FRONTMATTER_RE = re.compile(r"\A---\s*\n.*?^---\s*\n", re.DOTALL | re.MULTILINE)
DOCS_LINK_RE = re.compile(r"\[([^\]]+)\]\(/docs/(?:[^/)]+/)*([^/)#]+)(#[^)]+)?\)")
@ -20,10 +21,10 @@ def collect_all_files() -> list[tuple[Path, str]]:
return [directory / f"{p}.md" for p in data.get("pages", []) if (directory / f"{p}.md").exists()]
return sorted(directory.glob("*.md"))
for src in from_dir(DOCS_DIR):
for src in from_dir(LATEST_DIR):
files.append((src, "Home" if src.stem == "index" else src.stem))
for subdir in sorted(DOCS_DIR.iterdir()):
for subdir in sorted(LATEST_DIR.iterdir()):
if subdir.is_dir():
for src in from_dir(subdir):
files.append((src, src.stem))
@ -44,7 +45,7 @@ def main() -> None:
lines: list[str] = []
current_section = None
for src, dest_name in files:
section = "General" if src.parent == DOCS_DIR else src.parent.name.replace("-", " ").title()
section = "General" if src.parent == LATEST_DIR else src.parent.name.replace("-", " ").title()
if section != current_section:
if current_section is not None:
lines.append("")