proxy.golang.org : github.com/davidmz/itpl
Package itpl allows to include one Go templates into anothers. This package introduce an 'include' action that works like that: itpl.Load("page.tpl") will load "page.tpl" file, include content of "header.tpl" and "footer.tpl" files at the places of 'include' actions and produce the following template code: Of course any more complex template logic can be used. The Load function returns a combined template as a string that can be parsed and executed used with text/template of html/template package. The include action required one string argument, the relative or absolute path to included file. If relative path is used then it will be resolved relative to file with the include action: This package does not execute templates, it just parses them and combine content of multiple files into one. So the include actions cannot use any dynamic variables or parameters to construct the file path. File path must be a regular quoted string.
Registry
-
Source
- Documentation
- JSON
- codemeta.json
purl: pkg:golang/github.com/davidmz/itpl
License: MIT
Latest release: about 7 years ago
First release: about 7 years ago
Namespace: github.com/davidmz
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 29 days ago