This is the unified documentation site for SWHID (Software Heritage Identifier), built using MkDocs with the Material theme and a monorepo plugin.
- Unified Documentation: Single site combining specification, governance, and general documentation
- Version Management: Multiple specification versions with easy switching
- Template System: Consistent configuration across all versions using templates
- Material Theme: Modern, responsive design with integrated search functionality
- Pagefind Search: Fast, client-side search with faceted filtering
- Version Selector: Interactive dropdown to switch between specification versions
- Responsive Design: Mobile-optimized search and navigation experience
- Python 3.8+
- Git
- Make (optional, for convenience commands)
# Clone the repository
git clone https://github.com/swhid/swhid.github.io
cd swhid.github.io
# Install dependencies
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
# Bootstrap the site (sets up submodules and generates configs)
make bootstrap
# Create the site and the search index
make build
# Serve locally
make serveThe site will be available at http://127.0.0.1:8000
swhid.github.io/
├── docs/ # Main documentation content
├── sources/ # Submodule content
│ ├── specification/ # Specification submodule
│ ├── specification-v1.0/ # Version 1.0 worktree
│ ├── specification-v1.1/ # Version 1.1 worktree
│ ├── specification-v1.2/ # Version 1.2 worktree
│ ├── specification-vN.M/ # Version N.M worktree (for future versions)
│ ├── specification-dev / # Development worktree
│ └── governance/ # Governance submodule
├── templates/ # Configuration templates
│ ├── mkdocs.yml.template # Main config template
│ └── spec-overlay.yml.template # Specification overlay template
├── scripts/ # Build and maintenance scripts
│ ├── bootstrap.sh # Main bootstrap script
│ ├── bootstrap-versions.sh # Version discovery and generation
│ ├── generate-config.py # Template-based config generator
│ └── cleanup.sh # Cleanup script
├── overrides/ # Material theme customizations
│ ├── main.html # Main template override
│ └── partials/ # Template partials
│ └── version-selector.html # Version selector component
├── .monorepo-overlays/ # Generated overlay configs
├── mkdocs.yml # Main MkDocs configuration (generated)
└── requirements.txt # Python dependencies
The monorepo uses a template-based configuration system to ensure consistency across all versions. See Template System Documentation for details.
- Consistency: All versions use identical configuration
- Maintainability: Changes made once in templates affect all versions
- Automation: New versions automatically get correct configuration
make bootstrap # Initialize submodules and generate configurations
make serve # Start development server
make build # Build static site
make clean # Remove build artifacts
make cleanup # Comprehensive cleanup (removes all generated files and submodules)make clean- Removes build artifacts onlymake cleanup- Complete reset that removes:- All generated configuration files
- Git submodules and worktrees
- Build artifacts and temporary files
- Python virtual environments
- All cached data and git remnants
- Create a new tag in the specification repository
- Run
make bootstrapto discover and set up the new version - The version will automatically appear in the version selector
The version selector appears on all specification pages and allows users to:
- See all available versions
- Switch between versions seamlessly
- Maintain their current page context when switching
- Make changes to documentation files
- The development server will automatically reload
- Test changes across different versions using the version selector
- Edit template files in
templates/ - Run
python3 scripts/generate-config.pyto regenerate configs - Restart the development server
- Update templates as needed
- Modify generation scripts if required
- Test across all versions
- Update documentation
The site is designed to be deployed to GitHub Pages or any static hosting service:
- Run
make buildto generate the static site - Deploy the
site/directory to your hosting service - Ensure all submodules are properly initialized
Version selector not appearing:
- Ensure overlay files use Material theme
- Check that
extra.swhid_spec_versionsis populated - Verify template generation completed successfully
Build failures:
- Run
make cleanupto remove generated files - Run
make bootstrapto regenerate everything - Check that all submodules are initialized
Navigation issues:
- Ensure
nav.ymlis not manually edited - Run
scripts/bootstrap-versions.shto regenerate navigation - Check template syntax in
templates/
- Check the Template System Documentation
- Review the Architecture Documentation
- See the Complete Site Styling Guide for comprehensive customization options
- Look at existing issues in the repository
- Fork the repository
- Create a feature branch
- Make your changes
- Test across all versions
- Submit a pull request
This project is licensed under the same terms as the SWHID specification. See the individual submodules for their specific licenses.