This is the documentation site for omegaUp, built with Zensical (Material for MkDocs).
Create a new repository on GitHub (e.g., omegaup-docs or docs). Do NOT initialize it with a README, .gitignore, or license.
cd docs
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git branch -M main
git push -u origin mainReplace YOUR_USERNAME and YOUR_REPO_NAME with your actual GitHub username and repository name.
Update the site_url in zensical.toml to match your GitHub Pages URL:
site_url = "https://YOUR_USERNAME.github.io/YOUR_REPO_NAME"Or if using a custom domain:
site_url = "https://docs.omegaup.com"- Go to your repository on GitHub
- Navigate to Settings → Pages
- Under Source, select GitHub Actions
- The site will automatically deploy when you push to the
mainbranch
This documentation site supports multiple languages (English, Spanish, Portuguese, and Brazilian Portuguese). Follow these steps to set up and run the site locally.
# Create virtual environment
python3 -m venv .venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activatepip install zensicalTo build all language versions at once, use the provided build script:
python3 build_all.pyThis will:
- Clean the existing
site/directory - Build English (
/en/), Spanish (/es/), Portuguese (/pt/), and Brazilian Portuguese (/pt-BR/) versions - Create a root redirect from
/to/en/
To build only one language version:
# English (default)
zensical build --clean --config-file zensical.toml
# Spanish
zensical build --clean --config-file zensical.es.toml
# Portuguese
zensical build --clean --config-file zensical.pt.toml
# Brazilian Portuguese
zensical build --clean --config-file zensical.pt-BR.tomlTo test language switching and view all language versions:
python3 serve_multilang.pyThen open your browser to:
- Root (redirects to English): http://localhost:8000/
- English: http://localhost:8000/en/
- Español: http://localhost:8000/es/
- Português: http://localhost:8000/pt/
- Português (Brasil): http://localhost:8000/pt-BR/
Note: The
serve_multilang.pyscript properly serves all language directories and allows language switching to work correctly.
cd site
python3 -m http.server 8000# This only serves English and won't allow language switching
zensical serve --config-file zensical.toml- Edit the Markdown files in
docs/en/for English content - Rebuild the site:
python3 build_all.py - Refresh your browser to see changes
To translate English content to other languages:
# Translate all files
python3 scripts/translate_docs.py
# Translate specific language only
python3 scripts/translate_docs.py --langs pt
# Translate only specific files (for testing)
python3 scripts/translate_docs.py --only "getting-started"Cause: Using zensical serve which only serves one language directory.
Solution: Use the multi-language server instead:
python3 serve_multilang.pyCause: Browser cache or stale build.
Solution:
# Clean rebuild
python3 build_all.py
# Or manually clear cache
rm -rf .cache siteCause: Zensical not installed or virtual environment not activated.
Solution:
# Activate virtual environment
source .venv/bin/activate # macOS/Linux
# Install/upgrade Zensical
pip install --upgrade zensicaldocs/
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions deployment workflow
├── .venv/ # Virtual environment (gitignored)
├── .cache/ # Build cache (gitignored)
├── site/ # Built site (gitignored)
│ ├── en/ # English version
│ ├── es/ # Spanish version
│ ├── pt/ # Portuguese version
│ ├── pt-BR/ # Brazilian Portuguese version
│ └── index.html # Root redirect to /en/
├── docs/ # Source documentation files
│ ├── en/ # English source (primary)
│ ├── es/ # Spanish translations
│ ├── pt/ # Portuguese translations
│ └── pt-BR/ # Brazilian Portuguese translations
├── scripts/
│ ├── translate_docs.py # Auto-translate from English to other languages
│ └── generate-gsoc-pages.py # GSoC pages generator
├── overrides/ # Theme customizations
├── .gitignore # Git ignore rules
├── zensical.toml # English config
├── zensical.es.toml # Spanish config
├── zensical.pt.toml # Portuguese config
├── zensical.pt-BR.toml # Brazilian Portuguese config
├── build_all.py # Build all language versions
├── serve_multilang.py # Multi-language development server
└── README.md # This file
Each language has its own zensical.*.toml configuration file that specifies:
site_dir: Where to output the built files (e.g.,site/en/,site/pt/)docs_dir: Source directory for that language (e.g.,docs/en/,docs/pt/)language: The language code for theme localizationalternate: Links to other language versions for the language switcher
The site is automatically deployed to GitHub Pages via GitHub Actions when you push to the main branch. The workflow:
- Builds the site using Zensical
- Deploys to GitHub Pages
- Makes the site available at your configured URL
- The
site/directory is gitignored as it's generated during build - The
.cache/directory is gitignored as it contains build cache - The
.nojekyllfile will be automatically generated in thesite/directory during build for GitHub Pages