Why Gastro?
Everything you need for productive server-rendered Go web development. No magic, no surprises.
File-Based Routing
Pages in your pages/ directory automatically become routes. Dynamic parameters with [slug] syntax. No configuration needed — just create a file and it’s live.
Type-Safe Components
Define Props as Go structs. The compiler checks every prop at build time. No runtime surprises.
Go Frontmatter
Server-side Go code and HTML templates live in one file. Uppercase variables are automatically exported.
LSP & Editor Support
Full language server with completions, diagnostics, and go-to-definition. Extensions for VS Code, Neovim, and Zed.
Single Binary Deploy
Templates and static assets are embedded at build time. Zero runtime dependencies. Ship one file anywhere.
SSE & Real-time
Built-in Server-Sent Events with Datastar integration. Type-safe component rendering for SSE handlers.
Idiomatic Go
Standard Go syntax you already know. html/template, net/http, go:embed — no new language to learn, full type-safety throughout.
Quick Start
Get a Gastro project running in under a minute.
Write a component
---
type Props struct {
Title string
Author string
}
p := gastro.Props()
Title := p.Title
Author := p.Author
---
<article>
<h2>{{ .Title }}</h2>
<p>By {{ .Author }}</p>
</article>
Develop
# Start the dev server
gastro dev
# Watches for changes, rebuilds,
# and restarts automatically.
# Template changes are hot-reloaded.
Deploy
# Build a single binary
gastro build
# Templates and static assets are
# embedded. Ship one file anywhere.
./app