extemplate alternatives and similar packages
Based on the "Template Engines" category.
Alternatively, view extemplate alternatives based on common mentions on social networks and blogs.
-
quicktemplate
Fast, powerful, yet easy to use template engine. Converts templates into Go code and then compiles it. -
amber
Amber is an elegant templating engine for Go Programming Language It is inspired from HAML and Jade. -
Plush
Plush is the templating system that Go both needs and deserves. Powerful, flexible, and extendable, Plush is there to make writing your templates that much easier. -
fasttemplate
Simple and fast template engine. Substitutes template placeholders up to 10x faster than text/template. -
ego
A lightweight templating language that lets you write templates in Go. Templates are translated into Go and compiled. -
maroto
A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple. -
goview
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. -
grender
small wrapper around html/template for file-based templates that support extending other template files -
damsel
Markup language featuring html outlining via css-selectors, extensible via pkg html/template and others. -
gospin
Article spinning and spintax/spinning syntax engine, useful for A/B, testing pieces of text/articles and creating more natural conversations.
Get performance insights in less than 4 minutes
Do you think we are missing an alternative of extemplate or a related project?
Popular Comparisons
README
Extemplate

Extemplate is a small wrapper package around html/template to allow for easy file-based template inheritance.
File: templates/parent.tmpl
<html>
<head>
<title>{{ block "title" }}Default title{{ end }}</title>
</head>
<body>
{{ block "content" }}Default content{{ end }}
</body>
</html>
File: templates/child.tmpl
{{ extends "parent.tmpl" }}
{{ define "title" }}Child title{{ end }}
{{ define "content" }}Hello world!{{ end }}
File: main.go
xt := extemplate.New()
xt.ParseDir("templates/", []string{".tmpl"})
_ = xt.ExecuteTemplate(os.Stdout, "child.tmpl", "no data needed")
// Output: <html>.... Hello world! ....</html>
Extemplate recursively walks all files in the given directory and will parse the files matching the given extensions as a template. Templates are named by path and filename, relative to the root directory.
For example, calling ParseDir("templates/", []string{".tmpl"})
on the following directory structure:
templates/
|__ admin/
| |__ index.tmpl
| |__ edit.tmpl
|__ index.tmpl
Will result in the following templates:
admin/index.tmpl
admin/edit.tmpl
index.tmpl
Check out the tests and examples directory for more examples.
Benchmarks
You will most likely never have to worry about performance, when using this package properly. The benchmarks are purely listed here so we have a place to keep track of progress.
BenchmarkExtemplateGetLayoutForTemplate-8 2000000 923 ns/op 104 B/op 3 allocs/op
BenchmarkExtemplateParseDir-8 5000 227898 ns/op 34864 B/op 325 allocs/op
License
MIT
*Note that all licence references and agreements mentioned in the extemplate README section above
are relevant to that project's source code only.