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:
parent
b64508338f
commit
626e42ef25
3 changed files with 12 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue