No description
- CSS 63.5%
- HTML 22.2%
- JavaScript 13.1%
- Makefile 0.8%
- Shell 0.4%
| content | ||
| themes/nexus-docs | ||
| .gitignore | ||
| deploy.sh | ||
| hugo.yaml | ||
| Makefile | ||
| README.md | ||
Nexus GSLB Documentation
Hugo-based documentation site for Nexus GSLB.
Quick start
# Development
make server
# → http://localhost:1313
# Full build (Hugo + Pagefind search index)
make index
# Serve built site locally
cd public && python3 -m http.server 8000
# → http://localhost:8000
Requirements
- Hugo v0.160.1+ (extended version recommended for SCSS support)
- Pagefind (for search — installed separately via
npm install -g pagefind)
Build commands
| Command | Description |
|---|---|
make build |
Hugo build only (hugo --gc --minify) |
make index |
Hugo build + Pagefind search index |
make server |
Hugo dev server with live reload |
make clean |
Remove public/ build output |
Search
Search is powered by Pagefind. The search index is generated at build time via make index. You must rebuild and reindex after any content changes for search to work.
Deployment
Server setup
# 1. Clone the repo
git clone https://code.rbnsn.uk/joroson/nexus-gslb-documentation.git /root/nexus-gslb-documentation
cd /root/nexus-gslb-documentation
# 2. Install Hugo extended
wget https://github.com/gohugoio/hugo/releases/download/v0.160.1/hugo_extended_0.160.1_linux-amd64.tar.gz
tar -xzf hugo_extended_0.160.1_linux-amd64.tar.gz
sudo mv hugo /usr/local/bin/
# 3. Install Pagefind
npm install -g pagefind
# 4. Initial build
make index
# 5. Reload Caddy
sudo systemctl reload caddy
Caddy configuration
docs.gslb.nexus {
root * /var/www/docs.gslb.nexus/public
encode gzip
file_server
@static {
path .js .css .woff2 .svg .png .gz
}
handle @static {
header Cache-Control "public, max-age=31536000, immutable"
}
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin"
}
}
Updating the site
cd /root/nexus-gslb-documentation
./deploy.sh
This script pulls the latest changes, rebuilds the Hugo site, and re-indexes search. No downtime — Caddy continues serving the old build while the new one is written, then swaps instantly.
Project structure
.
├── Makefile # Build automation
├── deploy.sh # Server deploy script
├── hugo.yaml # Hugo config
├── content/ # Documentation source
│ ├── user/ # User guides
│ └── reference/ # API/reference docs
├── themes/ # Custom Hugo theme
│ └── nexus-docs/
└── public/ # Build output (gitignored)
Search index notes
Pagefind indexes the built HTML in public/. The index lives at public/pagefind/. If you serve public/ directly (no --serve flag), search works immediately. If you use a dev server that doesn't write to public/, the index won't be present and search won't function.
Always run make index (not just make build) when deploying.