Vuego is a Vue.js-inspired template engine for Go. Render HTML templates with familiar Vue syntax - no JavaScript runtime required.
The engine uses golang.org/x/net/html for HTML parsing and rendering.
Vuego supports the following template features:
- Variable interpolation -
{{ variable }}with nested property access - Template functions - Pipe-based filter chaining
{{ value | upper | trim }} - Custom functions - Define custom template functions (FuncMap)
- Built-in filters - String manipulation, formatting, type conversion
- Attribute binding -
:attr="value"orv-bind:attr="value" - Conditional rendering -
v-iffor showing/hiding elements with function support - List rendering -
v-forto iterate over arrays with optional index - Raw HTML -
v-htmlfor unescaped HTML content - Component composition -
<vuego include>for reusable components - Required props -
:requiredattribute for component validation - Template wrapping -
<template>tag for component boundaries - Full documents - Support for complete HTML documents or fragments
- Automatic escaping - Built-in XSS protection for interpolated values
Try VueGo in your browser! The interactive playground lets you experiment with templates and see results instantly.
You can run the playground locally, and if you pass a folder as the first parameter, you have a workspace.
# go run github.com/titpetric/vuego/cmd/vuego-playground
2025/11/14 20:07:31 VueGo Playground starting on http://localhost:3000The Template Syntax reference covers four main areas:
- Values - Variable interpolation, expressions, and filters
- Directives - Complete reference of all
v-directives - Components -
<vuego>and<template>tags - Advanced - Template functions, custom filters, and full documents
Additional resources:
- FuncMap & Filters - Custom template functions and built-in filters
- Components Guide - Detailed component composition examples
- Testing - Running tests and interpreting results
- CLI Usage - Command-line tool reference
- Concurrency - Thread-safety and concurrent rendering
MIT