Fix Docs relative trailing backlash bug (#18244)

Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-12-15 19:46:56 +01:00 committed by GitHub
parent b64508338f
commit 626e42ef25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View file

@ -24,6 +24,7 @@ Note:
- This script is built to be run in an environment where Python and MkDocs are installed and properly configured.
"""
import json
import os
import re
import shutil
@ -38,6 +39,13 @@ DOCS = Path(__file__).parent.resolve()
SITE = DOCS.parent / "site"
def create_vercel_config():
"""Create vercel.json in the site directory with customized configuration settings."""
config = {"trailingSlash": True}
with open(SITE / "vercel.json", "w") as f:
json.dump(config, f, indent=2)
def prepare_docs_markdown(clone_repos=True):
"""Build docs using mkdocs."""
if SITE.exists():
@ -284,6 +292,7 @@ def main():
print(f"Building docs from {DOCS}")
subprocess.run(f"mkdocs build -f {DOCS.parent}/mkdocs.yml --strict", check=True, shell=True)
remove_macros()
create_vercel_config()
print(f"Site built at {SITE}")
# Update docs HTML pages