A YAML-driven web server written in Go that generates complete HTML pages from structured YAML and Markdown definitions. Write YAML, get HTML — with virtual hosting, automatic HTTPS, and zero boilerplate.
Website: bserver.info
bserver uses a pipeline of YAML definitions to build complete HTML pages. You only define main: — everything else is inherited:
html.yaml ← starting point (provides <html lang="en">)
├── head.yaml ← <head> with meta, title, styles
└── body.yaml ← <body> wrapping:
├── header.yaml ← navbar
├── main ← YOUR CONTENT (from index.yaml)
└── footer.yaml ← footer text
Names resolve by searching upward through directories — your site's navlinks.yaml overrides the default, but inherited definitions like navbar.yaml are shared across all sites. Files are read on every request, so changes take effect immediately with no restart.
.md files render with full site chrome (navbar, header, footer, styles)^name prefix, with variable substitutionindex.yamldefault/ fallbacknobody+name prefix?debug to any URL (e.g., http://localhost/?debug) for HTML comment tracingRequires Go 1.24 or later.
git clone https://github.com/stgnet/bserver.git
cd bserver
go build
./bserver
Then visit localhost (port 80 or as shown on startup) to see the built-in documentation site.
A minimal page needs just an index.yaml in www/example.com:
main:
- h1: "Hello World"
- p: "Welcome to my site."
This produces:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bserver</title>
...
</head>
<body>
<header>...</header>
<main>
<h1>Hello World</h1>
<p>Welcome to my site.</p>
</main>
<footer>...</footer>
</body>
</html>
Go source files live in the project root. Web content lives in www/, mirroring the /var/www convention:
bserver/
├── *.go # Go source code
├── www/ # Web content root (-base flag)
│ ├── default/ # Fallback for unmapped hosts
│ │ ├── index.yaml # Home page
│ │ ├── header.yaml # Site header
│ │ ├── footer.yaml # Site footer
│ │ └── style.yaml # Site styles
│ ├── example.com/ # Virtual host
│ │ ├── index.yaml
│ │ └── about.md
│ ├── html.yaml # Base document structure (inherited)
│ ├── bootstrap5.yaml # Bootstrap 5 CDN (inherited)
│ ├── navbar.yaml # Navigation component (inherited)
│ └── cert-cache/ # TLS certificates (auto-created)
└── ...
The shared YAML definitions in www/ are readable and can be copied into any virtual host directory to customize behavior.
git clone https://github.com/stgnet/bserver.git
cd bserver
go build
sudo ./install-service.sh
Installs and starts bserver as a system service using systemd (Linux) or launchd (macOS). The service starts automatically and is enabled on boot.
To update and restart after pulling new changes:
git pull
go build
sudo ./install-service.sh restart
To uninstall:
sudo ./install-service.sh remove
main: and named definitions work^name prefixLicensed under the Apache License 2.0. See LICENSE for details.