I have a site with mixed static and Live View content.
For the static content, I have common page elements in /components/common
But for the life of me I can’t figure out how to embed these heex templates for use in a live view template.
I am sure this is a dead simple and common use case, but google is sending me down weird rabbit holes, and chat gpt wants me to make function-components that wrap the templates content.
Because I don’t have a module file for these templates, in the static part of the site, I am just using embed_templates "../components/common/*" it doesn’t look like there is a module I can import, and nor do the live view templates resolve that path.
It sounds like you are agreeing with ChatGPT that I need a module and functions for these templates rather than the embed_templates shortcut.
Oh ya, I never do that myself, but I think you can access them via the HTML module? I think you can define a bodyless function to use as components. Sorry I do not know off the top of my head.
For my existing use case, the right answer was to expand the role of the layout, which has access to all the necessary scaffolding to access the components.
For a more general solution, I will return to this only if I need to.