Skip to content

enhancing multi template and rendering #58

@madhums

Description

@madhums

Hi, first of all thanks for the awesome library. One of the things most people struggle when starting with gin (directly hopping from communities like rails, express, django) is templates and rendering.

From usability p.o.v, one of the things that struck me while using gin/multitemplate was, the following needs to be changed every time you add a new template or delete one of them. Which is not too handy and becomes repetitive to do in each handler when you are building a large application.

r.AddFromFiles("article", "base.html", "article.html")
r.AddFromFiles("login", "base.html", "login.html")
// ...

So based on multi template and the article I put some effort in enhancing the abilities. I would like to ask your opinion on it and decide if it can be used in multi template or make another package multitemplate-extras or drop it.

Here's the gist https://gist.github.com/madhums/4340cbeb36871e227905 (It contains a readme and a .go file. It also contains link to a full demo, new comers may find it useful)

@manucorporat your feedback is highly appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions