GitHub Pages Multi-Language Deployment Guide
Quick Start
OpenSynaptic documentation now supports multiple languages on GitHub Pages.
Current Language Support
- English - Original documentation at
/docs/ - 简体中文 (Chinese) - Chinese translations at
/docs/zh/
For Users
Accessing Documentation
- Visit Language Selector: Open Documentation Home in browser
- Switch Languages: Click language cards to navigate
- Direct URLs:
- English:
https://opensynaptic.github.io/ - Chinese:
https://opensynaptic.github.io/zh/
- English:
Language Switcher in Every Page
Each documentation page has language toggle links in the header:
- Shows current language
- Provides link to switch to other language
- Maintains page context (tries to show same page in different language)
For Contributors
Adding New Documentation
-
Create English version in
docs/directory---
layout: default
title: Page Title
language: en
---
# Page content... -
Create Chinese translation in
docs/zh/directory---
layout: default
title: 页面标题
language: zh
---
# 页面内容... -
Add language links:
**Language**: [English](../FILENAME.md) | [中文](FILENAME.md)
File Structure
docs/
├── index.html # Language selector (entry point)
├── _config.yml # Jekyll configuration
├── _layouts/default.html # Base layout with language switcher
├── assets/css/style.css # Shared styles
├── README.md | INDEX.md | *.md # English documentation
└── zh/
├── README.md | INDEX.md # Chinese documentation
└── *.md
Testing Locally
# Install dependencies
cd docs
bundle install # First time only
# Build site
bundle exec jekyll build
# Serve locally
bundle exec jekyll serve
# Visit http://localhost:4000
Deploying
Push changes to main or master branch:
git add docs/
git commit -m "docs: add Chinese translation for XYZ"
git push origin main
GitHub Actions will automatically:
- Build Jekyll site
- Validate markdown
- Deploy to GitHub Pages (if on main branch)
Technical Details
Jekyll Configuration
docs/_config.yml defines:
- Language list with codes
- Theme and plugins
- Build settings
languages:
en:
name: "English"
code: "en"
zh:
name: "简体中文"
code: "zh"
path: "/zh/"
Layout System
docs/_layouts/default.html provides:
- Automatic language switcher
- Context-aware navigation
- Consistent styling across languages
Template variables available:
site.languages- All configured languagespage.language- Current page languagesite.default_language- Fallback language
Styling
docs/assets/css/style.css includes:
- Language switcher styling
- Multi-language responsive design
- Dark mode support
Common Tasks
Update Existing Page
- Edit English version:
docs/FILENAME.md - Sync Chinese version:
docs/zh/FILENAME.md - Push changes
Add New Language
- Update
docs/_config.yml: Add language tolanguagessection - Create language directory:
mkdir docs/[lang-code]/ - Update
docs/index.html: Add language card - Update
docs/_layouts/default.html: Add to language switcher - Start translating docs
Fix Broken Link
- Identify broken file path
- For English: Fix in
docs/*.md - For Chinese: Fix in
docs/zh/*.md - Wait for auto-deploy or test locally first
Troubleshooting
Links Return 404
Cause: Incorrect relative paths
Fix:
- Use
[text](file.md)in/zh/files (same directory) - Use
[text](../en/file.md)for cross-language links
Chinese Not Displaying
Cause: Encoding issue
Fix:
- Ensure file saved as UTF-8
- Check markdown front matter is valid YAML
Pages Not Updating
Cause: Build failure or cache
Fix:
- Check GitHub Actions workflow status
- Clear browser cache
- Wait 5 minutes for deployment
Local Build Fails
Cause: Missing dependencies
Fix:
cd docs
bundle install --path vendor/bundle
bundle exec jekyll build
Reference
- Multi-Language Guide: MULTI_LANGUAGE_GUIDE.md
- Jekyll Docs: https://jekyllrb.com/
- GitHub Pages: https://pages.github.com/
- Markdown Guide: https://www.markdownguide.org/
Questions?
- Check MULTI_LANGUAGE_GUIDE.md for detailed info
- Review example files in
docs/zh/ - Open an issue on GitHub
- Check GitHub Actions logs for deployment errors
Status: ✅ Multi-language support live on GitHub Pages
Last Updated: 2026-04-04