https://github.com/rosbit/jet-helper
helpers to utilize CloudyKit/jet templates
https://github.com/rosbit/jet-helper
Last synced: 9 months ago
JSON representation
helpers to utilize CloudyKit/jet templates
- Host: GitHub
- URL: https://github.com/rosbit/jet-helper
- Owner: rosbit
- License: mit
- Created: 2023-04-30T14:08:42.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-04T00:29:30.000Z (about 3 years ago)
- Last Synced: 2025-01-16T00:24:46.208Z (over 1 year ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jet-helper
[Jet](https://github.com/CloudyKit/jet) is a template engine developed to be easy to use, powerful, dynamic, yet secure and very fast.
`jet-helper` is a package to utilize Jet similarly to Golang text/template and html/template.
## Usage Sample
```golang
import (
tmpl "github.com/rosbit/jet-helper"
)
// sample 1
tmpls := tmpl.NewTempls(".")
t, err := tmpls.Lookup("index.jet")
if err != nil {
// error processing
}
// t.Funcs(map[string]interface{}{}) // add Funcs like html/template::FuncMap
t.Execute(io.Writer, any)
// sample 2 to Parse text template
t, err := tmpl.Parse("text template as a string")
...
```