I am trying to build a SPA.
There are some requirements I am desperately trying to achieve. I have an index.html file as a layout which has some templates defined. The rendering of that works as expected through htmx calls.
The issues I am facing are the following:
I researched a lot and tried various different things. I also switched from using gin to echo now as I hoped for the integrated rendering to take care of that stuff but without any luck so far
I went with a workaround as I seem to have reached the limitations of go templ. While injecting content into a rendered template is possible, I faced the issue, that when trying to reach .../item/:id without previously visiting .../items/ the other page contents are not being rendered.
So I stored the data that is being displayed in a session and extract it when redirecting and rendering the new page. That way the user does not notice the reload of the contents that should remain the same when redirecting as I can preload the data from the session storage into the template.