Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ The site hosts technical documentation for Ubiquity Robotics robots, covering ha

The documentation is built and deployed automatically using GitHub Actions. The latest version is available at:

<!-- TODO: Change this to the actual website when the repo is switched. -->
**[https://paveljolak.github.io/learn2/](https://paveljolak.github.io/learn2/)**
**[https://learn2.ubiquityrobotics.com/jazzy/](https://learn2.ubiquityrobotics.com/jazzy/)**

## Local Development

To build and run the documentation locally:

<!-- TODO: Add the right links and names for cloning the repository. -->
```bash
git clone https://github.com/Paveljolak/learn2.git
git clone https://github.com/UbiquityRobotics/learn2.git
cd learn2
git fetch --all
git branch -a
Expand Down
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@

# project_name = project.replace(' ', '_')

# IMPORTANT:
# ---------------------------------------------------------------------------------------------
# This part gives error that language does not exists and set it to "None" in the local build process
# DO NOT CHANGE IT: you will break the version management for the deployed documentation
html_context['current_language'] = ''
html_context['language'] = ''
# ---------------------------------------------------------------------------------------------

# -- "Edit on GitHub" links --------------------------------------------------
html_context['display_github'] = True
Expand Down
29 changes: 23 additions & 6 deletions docs/conf.py.orig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sys.path.insert(0, os.path.abspath('../src'))
# -- Project information -----------------------------------------------------
project = 'Ubiquity Robotics Documentation'
copyright = '2025, Ubiquity Robotics'
author = 'Pavel for now'
author = 'Paveljolak'
version = ''
release = '1.0.0'

Expand All @@ -36,6 +36,14 @@ pygments_style = None
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']

html_logo = "_static/logos/UbiquityRobotics_Logo_Full_White.png"

html_css_files = [
'custom.css'
]

html_js_files = ['custom.js']

# -- RTD lower-left menu setup -----------------------------------------------
try:
html_context
Expand All @@ -45,7 +53,8 @@ except NameError:
html_context['display_lower_left'] = True

# Repo and environment info
REPO_NAME = os.environ.get('REPO_NAME', '')
full_repo = os.environ.get('GITHUB_REPOSITORY', '')
REPO_NAME = full_repo.split('/')[-1]
OWNER = os.environ.get('OWNER', '')

# Use ALL_VERSIONS from workflow environment
Expand All @@ -56,10 +65,19 @@ current_version = os.environ.get('CURRENT_BRANCH') or (ALL_VERSIONS[0] if ALL_VE
html_context['current_version'] = current_version
html_context['version'] = current_version


# Base URL for GitHub Pages
GITHUB_PAGES_BASE = f"https://{OWNER}.github.io/{REPO_NAME}"

# Set versions for selector with absolute URLs
# Get the custom domain
CUSTOM_DOMAIN = os.environ.get("CUSTOM_DOMAIN", "")

# If the DOMAIN exists in the workflow then use it
if CUSTOM_DOMAIN:
GITHUB_PAGES_BASE = f"https://{REPO_NAME}.{CUSTOM_DOMAIN}"
else:
GITHUB_PAGES_BASE = f"https://{OWNER}.github.io/{REPO_NAME}"# Set versions for selector with absolute URLs

# Build the absolute URLs for each version
html_context['versions'] = [
(v, f"{GITHUB_PAGES_BASE}/{v}/") for v in ALL_VERSIONS
]
Expand All @@ -71,8 +89,7 @@ html_context['language'] = ''

# -- "Edit on GitHub" links --------------------------------------------------
html_context['display_github'] = True
html_context['github_user'] = ''
html_context['github_user'] = OWNER
html_context['github_repo'] = REPO_NAME
html_context['github_version'] = f'{current_version}/docs/'