Includes a Templates struct as a helper to generate templates using an io/fs filesystem interface. This adds options not available in the standard ParseFS provided by the Go standard library. • Only the base name is used for the name of templates. This means you can only look up one themplate by name from two different directories. For example, if directory "a" and directory "b" both have a template index.html, there is no way to specify using index.html for "a" or from "b" • Supports stripping a root directory and trimming a suffix to make importing templates easier Includes two helper functions • AsString takes a template with data and executes the template and returns a strin. • String is like AsString, but will ignore errors
2 lines
19 B
Plaintext
2 lines
19 B
Plaintext
{{ return_error }}
|