Server-side component
rendering for Go
Write reusable HTML components in .vue files.
Render them server-side in Go — no Node.js, no JavaScript runtime, no virtual DOM.
go install github.com/dhamidi/htmlc/cmd/htmlc@latest
Templates evaluate once per request and produce plain HTML. No hydration, no virtual DOM, no client bundles.
Author components using the same .vue format you already know — v-if, v-for, v-bind, slots, scoped styles.
Use the htmlc CLI for static sites or import the Go package to render components inside any HTTP handler.
<style scoped> rewrites selectors and injects scope attributes automatically — styles never leak between components.
htmlc build walks a pages directory and renders every .vue file to a matching .html file. Props come from sibling JSON files.
Pass -debug and the output is annotated with HTML comments showing which component rendered each subtree.
Up and running in minutes
Install the CLI, write a component, render it.
go install github.com/dhamidi/htmlc/cmd/htmlc@latest
<!-- templates/Greeting.vue -->
<template>
<p>Hello, {{ name }}!</p>
</template>
$ htmlc render -dir ./templates Greeting \
-props '{"name":"world"}'
<p>Hello, world!</p>
$ htmlc build \
-dir ./templates \
-pages ./pages \
-out ./dist
Build complete: 12 pages, 0 errors.