-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update content-driven dynamic components blog post (#20).
- Loading branch information
Showing
6 changed files
with
64 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
{ | ||
"title": "Dynamic components example", | ||
"body": [ | ||
"You can load components from your JSON data source without explicitly", | ||
"importing each template using the <b>allComponents</b> helper. This is an", | ||
"object that holds a reference to each '.svelte' file in your project. To pull a", | ||
"template out of allComponents, you need to use a <em>component signature</em>.", | ||
"Luckily they are easy to figure out, just convert '/' and '.' characters to '_'", | ||
"in your layout path, so for example layout/components/template.svelte becomes", | ||
"layout_components_template_svelte." | ||
"The <a href=\"https://plenti.co/docs/allComponents\">allComponents</a> 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 <em>component signature</em> (e.g. layout/components/template.svelte becomes layout_components_template_svelte)." | ||
], | ||
"components": [ | ||
{ | ||
"title": "For example we could grab the 'template' component again:", | ||
"component": "layout_components_template_svelte", | ||
"fields": {"type": "index"} | ||
"title": "For example we could grab the 'incrementer':", | ||
"component": "incrementer", | ||
"fields": {} | ||
}, | ||
{ | ||
"title": "Or we could grab the 'incrementer':", | ||
"component": "layout_components_incrementer_svelte", | ||
"title": "The 'decrementer':", | ||
"component": "decrementer", | ||
"fields": {} | ||
}, | ||
{ | ||
"title": "Or even the 'grid':", | ||
"component": "grid", | ||
"fields": {"items": [1, 2, 3]} | ||
} | ||
], | ||
"author": "Jim Fisk", | ||
"date": "8/25/2020" | ||
"date": "12/9/2020" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters