Dynamic components example

Written by Jim Fisk on 12/9/2020

The allLayouts helper object holds references to all svelte templates on your site.

This allows you to load components from your JSON data source without explicitly importing them.

Just remember to use a component signature (e.g. layouts/components/ball.svelte becomes layouts_components_ball_svelte).

Template:
layouts/content/blog.svelte
    
Content:
content/blog/components.json
    

Back home