Hi,
I want to load .astro templates dynamically via URL. (SSR mode is enabled).
For example:
localhost:3000/components/slider
The slider from src/components/Slider.astro, should then appear in the content. With set:html I can do this with .html files from the public folder, but not with .astro files. Does anyone have an idea, how to achieve this?
I want to build a dynamic playground for a web-components design system, to preview how the component is displayed in each project. (domain.tld/[project]/[web-component-name])
Unfortunately I didn't find anything suitable in the documentation and the parts that looked promising, only import the path and not the file contents. Something like this would be nice:
`// not working:
const { filename } = Astro.params;
const Component = await import(../components/${filename}.astro);`
<Component />`
All examples I've found so far, are only related to JSON data or static .html or .md files.
I think this one comes closest, but unfortunately it lacks some context for implementation for me:
#framework message