feed themes from global data

This commit is contained in:
Cory LaViska
2025-06-11 07:49:55 -04:00
parent ad41eac32f
commit 15bbbaeac2
2 changed files with 19 additions and 12 deletions

View File

@@ -47,6 +47,14 @@ export default async function (eleventyConfig) {
flashes: '',
});
//
// Add free themes to preset themes global data
//
// TODO - let's iterate the directory and grab these. We'll need to figure out how to separate free from pro and
// update the pro config as well.
//
eleventyConfig.addGlobalData('freeThemes', ['default', 'awesome', 'shoelace']);
// Template filters - {{ content | filter }}
eleventyConfig.addFilter('inlineMarkdown', content => markdown.renderInline(content || ''));
eleventyConfig.addFilter('markdown', content => markdown.render(content || ''));

View File

@@ -1,15 +1,14 @@
<wa-select appearance="filled" size="small" value="default" pill class="theme-selector">
<wa-icon slot="prefix" name="paintbrush" variant="regular"></wa-icon>
<wa-option value="default">Default</wa-option>
<wa-option value="shoelace">Shoelace</wa-option>
<wa-option value="awesome">Awesome</wa-option>
<wa-divider></wa-divider>
<wa-option value="active">Active</wa-option>
<wa-option value="brutalist">Brutalist</wa-option>
<wa-option value="glossy">Glossy</wa-option>
<wa-option value="matter">Matter</wa-option>
<wa-option value="mellow">Mellow</wa-option>
<wa-option value="playful">Playful</wa-option>
<wa-option value="premium">Premium</wa-option>
<wa-option value="tailspin">Tailspin</wa-option>
{% for theme in freeThemes %}
<wa-option value="{{ theme }}">{{ theme | title }}</wa-option>
{% endfor %}
{% if proThemes.length > 0 %}
<wa-divider></wa-divider>
{% endif %}
{% for theme in proThemes %}
<wa-option value="{{ theme }}">{{ theme | title }}</wa-option>
{% endfor %}
</wa-select>