[go-nuts] Re: How to create reusable HTML components using default html/template package

2019-05-17 Thread Leonel Quinteros
I've created some approach for what you need, but designed to "compile" these templates and reusable components into a static site. Feel free to check the code for ideas to implement your own solution, it shouldn't be hard to do so: https://github.com/leonelquinteros/thtml I guess the code you

[go-nuts] Re: How to create reusable HTML components using default html/template package

2019-05-16 Thread krdesai77
How do I create template within Nextgen? On Sunday, August 7, 2016 at 5:51:05 PM UTC-4, pj.beta...@gmail.com wrote: > > Coming from another language, I'm starting to port a web app to Go using > default packages to test-drive it but I couldn't find any > standard/recommended way of using

[go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-11 Thread Matt Silverlock
Have you looked at template blocks? https://golang.org/pkg/html/template/#example_Template_block My approach is to create a map[string]*template.Template that contains each template (base + layout + blocks for that template), with the map key set to the layout name. On Monday, August 8, 2016

[go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-08 Thread Paulo Janeiro
I'm using html/template already. I'm able to parse my templates dynamically but my approach doesn't seems to be the best to handle dozens of different templates that can be used inside N different combinations, especially because I want to cache them and not to have to parse those combination

Re: [go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-08 Thread Marvin Renich
* Paulo Janeiro [160808 11:14]: > I understand what your point, but I'm just trying to see if this is > something easy to do by myself or if I should start looking into a framework > Nevertheless, I'm using Phoenixframework (Elixir). > Here we could define a layout

[go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-08 Thread Paulo Janeiro
I understand what your point, but I'm just trying to see if this is something easy to do by myself or if I should start looking into a framework Nevertheless, I'm using Phoenixframework (Elixir). Here we could define a layout that is made of componentes (pre-built templates). Data is passed when

[go-nuts] Re: How to create reusable HTML components using default html/template package

2016-08-08 Thread Simon Ritchie
> Specifically, is there a recommended pattern on how to use a component inside another component inside another component passing data to each one in a transparent way? That's not awfully specific. I'm guessing that you are thinking of a particular framework that you have used with another