Personal website built with Emacs Org-mode, managed with Nix, and auto-deployed via GitHub Actions.
This project uses a git worktree setup with automated deployment:
mainbranch - Source files (org files, build scripts, Nix config)gh-pagesbranch - Generated HTML (deployed via GitHub Actions)public/directory - Git worktree pointing togh-pagesbranch
# Enter development environment
nix develop
# Build the site
./build.sh
# Build and serve locally on http://localhost:8000
nix run .#serve
# Build site to ./result (for deployment)
nix build# Install dependencies
# - emacs-nox (or emacs)
# - python3 (for local server)
# Build the site
./build.sh
# Serve locally
cd public
python -m http.server 8000Edit org files in content/:
emacs content/blog.org
emacs content/index.org# Build
./build.sh
# Serve and preview
nix run .#serve
# or manually:
cd public && python -m http.server 8000Open http://localhost:8000 in your browser.
# Commit source changes to main branch
git add content/blog.org
git commit -m "feat: add new blog post"
git push origin mainGitHub Actions automatically builds and deploys to gh-pages!
If you need to manually deploy from your local machine:
# Build the site
./build.sh
# Commit generated HTML to gh-pages (via worktree)
cd public
git add .
git commit -m "build: manual deployment"
git push origin gh-pages
cd ..simple-org-mode-website/
├── .github/
│ └── workflows/
│ └── deploy.yml # Auto-deployment workflow
├── content/ # Org-mode source files
│ ├── blog.org
│ ├── index.org
│ ├── sitemap.org
│ └── static/ # CSS, images, CV, etc.
├── public/ # Generated HTML (git worktree → gh-pages)
├── build-site.el # Org-publish configuration
├── build.sh # Build wrapper script
├── flake.nix # Nix development environment
└── README.md # This file
The public/ directory is a git worktree that points to the gh-pages branch:
# View worktrees
git worktree list
# Output:
# /path/to/project <commit> [main]
# /path/to/project/public <commit> [gh-pages]This allows you to:
- Keep source and deployment code in separate branches
- Test builds locally before pushing
- Manually deploy if needed
On every push to main:
- GitHub Actions checks out your source code
- Installs Emacs and dependencies
- Runs
./build.shto generate HTML - Pushes the
public/directory togh-pagesbranch - GitHub Pages serves the site from
gh-pages
The flake.nix provides:
nix develop- Development shell with Emacs, Python, Gitnix run .#serve- Build and serve locallynix run .#build- Build the sitenix build- Build site to./result/(for deployment)
- Go to your repository settings
- Navigate to Pages
- Set Source to
gh-pagesbranch - Save
Your site will be available at https://<username>.github.io/<repo-name>
Edit files in content/:
index.org- Homepageblog.org- Blog postsstatic/- CSS, images, CV, etc.
Edit build-site.el:
- Change CSS framework
- Customize HTML output
- Add org-publish projects
Edit .github/workflows/deploy.yml:
- Change trigger branches
- Add build steps
- Customize deployment settings
# Clean cache and rebuild
rm -rf .packages/
./build.sh# List worktrees
git worktree list
# Remove and recreate public/ worktree
git worktree remove public
git worktree add public gh-pages- Check workflow runs in the Actions tab
- Verify
gh-pagesbranch exists - Ensure GitHub Pages is enabled in settings
- Check permissions in
.github/workflows/deploy.yml
[Your License Here]