You can also see my previous project, go-htmx for a previous version of the idea, though its missing some features.
I would make the templates library take a callback function for every public template: func(method, path string, template).
Then the user could add any custom logic to register the route handler and execute the template with any application specific inputs.
Passing the parameters from the handler to the template could be left to the user of the library.
You can also see my previous project, go-htmx for a previous version of the idea, though its missing some features.