Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
A Collection is a set of pages that share a base layout, partials, and template funcs
func NewCollection ¶
NewCollection takes a fs.FS containing the template sources. The filesystem is expected to be in the following format:
templates/ ├─ pages/ │ ├─ page1.gohtml │ ├─ page2.gohtml ├─ partials/ │ ├─ nav.gohtml │ ├─ footer.gohtml ├─ base.gohtml
base.gohtml is a required filename and defines the top-level template. It refers to content blocks defined by the partials and pages. The filenames for the partials don't matter, only the names of the templates they define. The pages are referred by their filename in the Render method.
Click to show internal directories.
Click to hide internal directories.