partial
1. Mounted Configuration Directory: Added /srv/configs as a mount point in
/srv/dev/hugo/wiki/config/_default/hugo.toml. This allows Hugo's readFile and fileExists functions to
access your Docker Compose and other configuration files within the virtual filesystem.
2. Improved include Partial: Rewrote /srv/dev/hugo/wiki/layouts/partials/include.html with the following
enhancements:
* Path Mapping: It now automatically maps absolute paths like /srv/configs/... to the new configs/ mount
and /srv/docs/private/... to the existing content/private/ mount.
* Raw Content Support: If the included file is not a Markdown file (e.g., .yaml, .env, .sh), it now
outputs the raw content instead of attempting to render it as Markdown. This ensures that your Docker
Compose files are included exactly as they are when wrapped in a code block.
* Robust Lookups: Added better path variation checking to handle both absolute and relative paths more
gracefully.
Project: Hugo Documentation Framework (Blowfish)
This repository manages the Hugo build environment (config, themes, and layouts) for both the Public and Private Wikis.
🏗️ Architecture
To allow for seamless Dev vs. Prod workflows, the architecture is split into three repositories:
- Framework (
/srv/dev/hugo/wiki): This repository (hugo-framework). Contains the Hugo engine, themes (Blowfish), and the default configuration. - Public Content (
/srv/docs/public): A separate repository (docs-public). - Private Content (
/srv/docs/private): A separate repository (docs-private).
Dynamic Configuration Merging:
The Framework defines the base styling in config/_default/params.toml.
However, the Content repositories can dynamically override:
- Menus: By providing a
config/_default/menus.en.tomlfile. - Theme Settings (Edit Links): Injected via Environment Variables (
HUGO_PARAMS_ARTICLE_EDITURL) during the CI/CD pipeline to avoid destroying the framework's default arrays.
💻 Local Development ("Live Link")
To write documentation with real-time previews, you use symbolic links on your host machine:
- Establish Symlinks:
cd /srv/dev/hugo/wiki rm -rf content static ln -s /srv/docs/public content ln -s /srv/docs/public/static static - Preview Changes:
hugo server --bind 0.0.0.0 --appendPort=false --baseURL="/"
🚀 CI/CD Pipeline
Deployment is fully automated through Gitea Actions stored in the Content repositories (e.g., docs-public/.gitea/workflows/deploy.yaml).
During a build, the Runner dynamically clones this Framework via HTTPS, injects the Markdown files from the triggering repository, applies the editURL overrides, builds the site, and deploys directly into the Nginx web server volume (/srv/caddy/sites).
(Note: The volume name /srv/caddy is a legacy name; the servers actually running are lightweight nginx:alpine containers defined in gitea/docker-compose.yaml).