Skip to content

Latest commit

 

History

History

quicktemplate

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Quicktemplate example

quicktemplate compiles its templates to Go code. The generated code writes into an io.Writer, and the Iris Context is an io.Writer, so a handler calls it directly. No engine of the views package is involved.

Run

The generated *.qtpl.go files are committed, so the example runs as it is:

go run .
curl localhost:8080/
curl localhost:8080/yourname

The test sends the same two requests in memory:

go test .

Changing a template

The templates are the *.qtpl files under templates. After a change, generate the Go code again with the quicktemplate compiler, qtc, and build the program again:

go install github.com/valyala/quicktemplate/qtc@latest
qtc -dir=./templates

The full documentation is at https://github.com/valyala/quicktemplate.