From 2c65d93831ec7e15533a5b48cf86574fbfa89924 Mon Sep 17 00:00:00 2001 From: Russell Samora Date: Tue, 20 Aug 2024 14:50:16 -0400 Subject: [PATCH] cms --- src/components/CMS.svelte | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/components/CMS.svelte diff --git a/src/components/CMS.svelte b/src/components/CMS.svelte new file mode 100644 index 0000000..9aebaac --- /dev/null +++ b/src/components/CMS.svelte @@ -0,0 +1,28 @@ + + +{#each body as { section, content }} + {@const id = section.toLowerCase()} + {@const component = components[section]} +
+ {#if component} + + {:else} + {#each content as { type, value }} + {#if components[type]} + + {:else if type === "text"} +

{@html value}

+ {:else} + {#if typeof value === "string"}{@html value}{/if} + {/if} + {/each} + {/if} +
+{/each}