Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tpl/widgets: Clarify widgets' environment variables
The context inside widget templates is now: - `.` can access all classical site variables (normally including `.Content` and so on). `.Content` refers to the actual page content content. - `.Widget` is defined as follows: ``` type Widget struct { Type string Params map[string]interface{} Identifier string Weight int Template *template.Template } ``` In particular, you can access `.Widget.Type` (name of widget type) and `.Widget.Params` (config parameters). - `.WidgetArea` contains the widget collection in the current widget area. - `.Site.Widgets` contains the collection of all widget areas.
- Loading branch information