romsar / gonertia

The Go adapter for Inertia.js
https://pkg.go.dev/github.com/romsar/gonertia
Other
92 stars 5 forks source link

Make more flexible #24

Open ultimateshadsform opened 1 week ago

ultimateshadsform commented 1 week ago

Right now isn't it hardcoded to use html/template?

How can I use something else like templ?

https://templ.guide/

I did make it working by compiling the template as a string and including raw string such as @templ.Raw("{{ .inertiaHead }}") and then passing that to inertia but it would be nice to be able to override the template mechanism so I can use temple directly instead of html/template..

Or can I do this already?

Because i.ShareTemplateFunc assumes you use html/template?

romsar commented 1 week ago

I think we can do this. I will try to allocate time to work on this issue in the near future.

ultimateshadsform commented 1 week ago

Yeah! Would be nice to be able to override the template thing to use a custom one.

romsar commented 1 week ago

I think we should pass something like TemplateProvider interface to the Gonertia constructor like in Fiber: https://docs.gofiber.io/guide/templates/

ultimateshadsform commented 1 week ago

Yeah! I'm actually using gofiber right now so that would be awesome!

ultimateshadsform commented 2 days ago

I think we can push this into the backlog of 3.x I also would like to be able to use any http framework such as gofiber or like golang http etc. I have cloned and I'm starting to see if I can come up with something