Hugo, deploy tools and site scaffolds for publishing static sites from Emacs
- Jinja 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DwhnZ8kumqmEpvdRQ5ENQS |
||
| defaults | ||
| files | ||
| meta | ||
| tasks | ||
| templates | ||
| .gitignore | ||
| README.md | ||
hugo-publish
Sets up a machine to build Hugo sites and publish them, so that
M-x brain2-publish works there: installs Hugo and rsync via
Homebrew, and scaffolds each site directory (hugo.toml, archetype,
.gitignore, deploy.sh, theme). The serving side is the
static-sites role on razorback.
What it does not install: Emacs, ox-hugo and the brain2-* commands
come from the dotfiles (emacs/*/init.org), and the Org source is the
~/orgfiles repo.
Requirements
- Homebrew installed (Linuxbrew on Linux).
community.generalcollection.- For publishing: this machine's ssh key authorized on each site's
deploy_host(ssh-copy-id razorback.local, once per machine). The role trusts the host key and warns, without failing, when the login is refused.
Role Variables
| Variable | Default | Description |
|---|---|---|
brew_bin_dir |
/home/linuxbrew/.linuxbrew/bin (Linux), /opt/homebrew/bin (macOS) |
Homebrew bin directory; also put first on deploy.sh's PATH. |
hugo_publish_packages |
[hugo, rsync] |
Homebrew formulae installed. |
hugo_publish_sites_dir |
~/sites |
Parent of the site directories. |
hugo_publish_sites |
brain2 | Sites: {name, config, base_url, deploy_host, deploy_dest, theme, theme_repo, theme_version}; config is a template under templates/sites/. |
Example Playbook
- hosts: anubis
roles:
- role: hugo-publish
Notes
content/is ox-hugo output andpublic/is Hugo output; neither is managed, except for the fixed pages underfiles/sites/<name>/(brain2's search page andnotes/_index.md), which are copied in. Everything else in the site directory is overwritten on each run, so changehugo.tomlhere (templates/sites/), not in place.- The theme is cloned once (
update: no); an existing checkout or git submodule is left at its commit. deploy.shrsyncs with--delete, so the last publish wins. Pull~/orgfilesbefore publishing from another machine.deploy.shhonours<NAME>_HOST,<NAME>_DESTand<NAME>_BASE_URL(e.g.BRAIN2_HOST) to override the site entry.