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>
pull/18212/head
Glenn Jocher 2 months ago committed by GitHub
parent b64508338f
commit 626e42ef25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      docs/build_docs.py
  2. 2
      docs/overrides/main.html
  3. 3
      mkdocs.yml

@ -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

@ -30,7 +30,7 @@
<button
onclick="window.open('https://www.ultralytics.com/events/yolovision', '_blank')"
>
Register now
Join now
</button>
</div>
</div>

@ -15,6 +15,7 @@ repo_name: ultralytics/ultralytics
remote_name: https://github.com/ultralytics/docs
docs_dir: "docs/en/" # where to find the markdown files
site_dir: "site/" # where to publish to
use_directory_urls: true # don't display 'index.html' in slugs
# Theme customization
theme:
@ -570,10 +571,10 @@ nav:
- object_counter: reference/solutions/object_counter.md
- parking_management: reference/solutions/parking_management.md
- queue_management: reference/solutions/queue_management.md
- region_counter: reference/solutions/region_counter.md
- solutions: reference/solutions/solutions.md
- speed_estimation: reference/solutions/speed_estimation.md
- streamlit_inference: reference/solutions/streamlit_inference.md
- region_counter: reference/solutions/region_counter.md
- trackzone: reference/solutions/trackzone.md
- trackers:
- basetrack: reference/trackers/basetrack.md

Loading…
Cancel
Save