foolin
foolin
You need at reader page define content like this: ```html {{define "content"}} This is content!!!! 123 + 333 = {{call $.add 123 333}} Page render {{end}} ``` See the example:...
Use `block` tag replace `{{template "content" .}}`: ```html {{block "content" .}}Default Content{{end}} ```
Try go.rice? https://github.com/GeertJohan/go.rice https://github.com/foolin/goview/tree/master/_examples/gin-rice
Modify to http.StripPrefix("/**_pbc_**", http.FileServer(box.HTTPBox())) ``` cssFileServer := http.StripPrefix("/pbc", http.FileServer(box.HTTPBox())) http.Handle("/pbc", cssFileServer) ``` The link is: ``` /pbc/assets/app.css ```
See the example: https://github.com/foolin/goview/tree/master/_examples/gin-multiple
Use go.rice or other libraries.
Use include tag: ``` {{include "layouts/footer"}} ``` The path is: ``` $root/layouts/footer.html ```
{{include}} tag is shared the page context arguments, and you don't need passing arguments. So you can just use it.
Example: GO code: ``` //render page use `page.tpl` with '.tpl' will only file template without master layout. http.HandleFunc("/page", func(w http.ResponseWriter, r *http.Request) { err := goview.Render(w, http.StatusOK, "page.tpl", goview.M{ "Title":...
Oh, you wan't the config Partials support for directory or matching specific files, right?