Structuring and parsing HTML base views and templates in Go with dstpierre/tpl

Опубликовано: 07 Июнь 2024
на канале: Dominic St-Pierre
113
0

Each time I'm starting a new web application in Go, say something that could have been done in Django or Rails, I can't remember how to structure my templates and how to parse them so that I can have base layout pages and views for the route as well as having re-usable pieces of HTML I want to re-use at different places.

I go tired of this and wrote a simple and lightweight library called dstpierre/tpl that's opiniated and give a solid structure to organize your templates and a way to parse and render them. It also brings multi-lingual options and i18n for dates and currency formatting.

This video give some basics idea of what one gets if they decide to use the library.