plentico / plenti

Static Site Generator with Go backend and Svelte frontend
https://plenti.co
Apache License 2.0
1k stars 48 forks source link

Components Options * Catch All #229

Open hlanderdev opened 1 year ago

hlanderdev commented 1 year ago

Feature Request


Currently a "components" type in _schema.json looks like this:

{
    "components": {
        "type": "components",
        "options": [
            "hero",
            "section",
            "blah"
        ]
}


A * Catch All feature could be useful here especially if you have a good component naming convention. For example, given the components: "resources_hero", "resources_section", and "resources_blah"; You could have a _schema.json file like this:

{
    "components": {
        "type": "components",
        "options": [
            "resources_*"
        ]
}


That would include all of those components, as well as any future components that follow that convention.

hlanderdev commented 1 year ago

Quick Correction: It should be "type": "component" not "type": "components". My mistake.

jimafisk commented 1 year ago

I caught that too, was thinking maybe we want to handle plurals for schema types (in addition to singular). Not sure if it's a bad practice to allow either way to work, but I have to remind myself every time which to use.