[docs] add deprecation notice banner to legacy documentation site (#23516)
This commit is contained in:
@@ -13,6 +13,12 @@ The documentation has been migrated. Please make documentation updates in the
|
||||
corresponding location under docs_new/ instead.
|
||||
"""
|
||||
|
||||
LEGACY_DOCS_ALLOWLIST = {
|
||||
"docs/_static/css/custom_log.css",
|
||||
"docs/_static/js/deprecation_banner.js",
|
||||
"docs/conf.py",
|
||||
}
|
||||
|
||||
|
||||
def staged_paths() -> list[str]:
|
||||
result = subprocess.run(
|
||||
@@ -33,7 +39,10 @@ def staged_paths() -> list[str]:
|
||||
def main() -> int:
|
||||
paths = sys.argv[1:] or staged_paths()
|
||||
docs_paths = sorted(
|
||||
path for path in paths if path == "docs" or path.startswith("docs/")
|
||||
path
|
||||
for path in paths
|
||||
if (path == "docs" or path.startswith("docs/"))
|
||||
and path not in LEGACY_DOCS_ALLOWLIST
|
||||
)
|
||||
|
||||
if not docs_paths:
|
||||
|
||||
Reference in New Issue
Block a user