SetContent is a helper function that calls [Page.SetSource] with the "content" subdirectory of the given filesystem.
(content fs.FS)
| 247 | // SetContent is a helper function that calls [Page.SetSource] |
| 248 | // with the "content" subdirectory of the given filesystem. |
| 249 | func (pg *Page) SetContent(content fs.FS) *Page { |
| 250 | return pg.SetSource(fsx.Sub(content, "content")) |
| 251 | } |
| 252 | |
| 253 | // OpenURL sets the content of the page from the given url. If the given URL |
| 254 | // has no scheme (eg: "/about"), then it sets the content of the page to the |