Contributing to the Garden Linux Documentation
Garden Linux documentation is published at https://gardenlinux-docs.netlify.app/ and combines content from multiple repositories into a unified documentation site.
Source Repository: gardenlinux/docs-ng
Quick Edits — The Easy Way
The easiest way to improve the documentation is directly from the published site:
- Navigate to any page on https://gardenlinux-docs.netlify.app/
- Scroll to the bottom of the page
- Click "Edit this page on GitHub" — this opens the source file in the correct repository
- Make your edits using GitHub's web editor
- Submit a pull request — the changes will be automatically aggregated into the documentation site
Why This Works
The "Edit this page on GitHub" button is intelligent and takes you to the correct source location:
- For content from the main gardenlinux repository, it links to
gardenlinux/gardenlinux/docs/... - For content from the builder repository, it links to
gardenlinux/builder/docs/... - For content from the python-gardenlinux-lib repository, it links to
gardenlinux/python-gardenlinux-lib/docs/... - For documentation-specific pages, it links to
gardenlinux/docs-ng/docs/...
You don't need to understand the aggregation system to contribute! The system automatically detects changes in source repositories and rebuilds the unified documentation site.
This works because the VitePress configuration uses frontmatter metadata (github_org, github_repo, github_source_path, github_branch) embedded in each page to resolve the correct source location.
This approach is perfect for:
- Fixing typos
- Clarifying explanations
- Adding missing information
- Updating outdated content
Documentation Aggregation System
The documentation aggregation system powers the unified Garden Linux documentation site. It aggregates content from multiple source repositories (gardenlinux, builder, python-gardenlinux-lib) into a cohesive VitePress site.
Key Features
- Targeted Documentation: Files with
github_target_pathfrontmatter are automatically placed into the correct Diataxis categories - Project Mirroring: Complete repository documentation mirrored under
docs/projects/<repo-name>/ - Commit Locking: Reproducible builds with locked commit hashes
- Media Handling: Automatic discovery and copying of media directories
- Link Rewriting: Automatic link transformation for cross-repository references
Documentation Paths
The system supports two complementary documentation paths:
- Targeted Documentation — Files with
github_target_pathfrontmatter →docs/tutorials/,docs/how-to/, etc. - Project Mirror — All repo docs mirrored under
docs/projects/<repo-name>/
Architecture Overview
Source Repos → Fetch (git/local) → Transform → docs/ → VitePressThe aggregation pipeline consists of four main stages:
- Fetch —
src/aggregation/fetcher.pypulls docs via git sparse checkout or local copy - Transform —
src/aggregation/transformer.pyrewrites links, fixes frontmatter - Structure —
src/aggregation/structure.pyreorganizes directories and copies media - Output — VitePress builds the site
Working with the Documentation System Locally
For more substantial changes — like adding new pages, restructuring content, or working on the aggregation system itself — you'll want to set up the documentation system locally.
Prerequisites
- Python 3.x
- pnpm (for VitePress)
- Git
Step 1: Clone the Repository
git clone https://github.com/gardenlinux/docs-ng.git
cd docs-ngStep 2: Install Dependencies
pnpm installThis installs VitePress and other Node.js dependencies needed to build the documentation site.
Step 3: Aggregate Documentation
From Remote Repositories (Production)
Aggregate from locked commits in repos-config.json:
make aggregateThis fetches documentation from the configured repositories at their locked commit hashes.
From Local Repositories (Development)
For local development, use repos-config.local.json with file:// URLs:
make aggregate-localThis copies documentation from local repositories without using git.
Step 4: Start the Development Server
make devThe documentation site will be available at http://localhost:5173.
Step 5: Make Changes
As you work on documentation in source repositories:
- Make changes to markdown files in source repos
- Run
make aggregate-localto update the aggregated docs - The dev server will hot-reload automatically
Step 6: Build for Production
When ready to deploy:
make buildThis creates a production build in docs/.vitepress/dist/.
Common Workflows
Updating a Single Repository
make aggregate-repo REPO=gardenlinuxUpdating Lock Files
To fetch the latest commits and update repos-config.json:
make aggregate-updateRunning Tests
make testProject Structure
Repository Structure (docs-ng)
docs-ng/
├── repos-config.json # Repository configuration
├── repos-config.local.json # Local development config
├── src/ # Source code
│ ├── aggregate.py # CLI entry point
│ └── aggregation/ # Core package
├── tests/ # Test suite
└── docs/ # Generated documentation
├── projects/ # Mirrored repository docs
├── tutorials/ # Aggregated tutorials
├── how-to/ # Aggregated guides
├── explanation/ # Aggregated explanations
└── reference/ # Aggregated reference docsAfter Aggregation
After running the aggregation, your docs directory will look like:
docs/
├── projects/ # Mirrored repository docs
│ ├── gardenlinux/
│ ├── builder/
│ └── python-gardenlinux-lib/
├── tutorials/ # Aggregated tutorials
├── how-to/ # Aggregated guides
├── explanation/ # Aggregated explanations
├── reference/ # Aggregated reference
└── contributing/ # Aggregated contributing docsTroubleshooting
Clean Build
If you encounter issues, try a clean build:
make clean
make aggregate
make devCheck Dependencies
Ensure all dependencies are installed:
pnpm install
python3 --version # Should be 3.xVerify Configuration
Check that repos-config.json or repos-config.local.json is properly configured. See the configuration reference for details.
Next Steps
- Adding Repositories — How to add new repositories to the aggregation
- Technical Reference — Source code and API documentation
- Configuration Reference — Complete configuration options
- Architecture Explanation — Deep dive into how the documentation aggregation system works