A very simple template system
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
.editorconfig
.gitattributes
.gitignore
.ignore
.travis.yml
Gopkg.lock
Gopkg.toml
LICENSE
README.md
easytpl.go
easytpl_test.go

README.md

Build Status codecov GoDoc

A very simple template system, intended for simple customer-facing templates.

easytpl transforms to Go's template system as follows:

{%var%}                          -> {{Var}}
{%var.val%}                      -> {{Var.Val}}
{%var.val,fallback=some string%} -> {{if .Var.Val}}{{.Var.Val}}{{else}}some string{{end}}
{{var.val}}                      -> {{ "{{var.val}}" }}

That's all :-) It doesn't support if, range, or anything else.