Currently, a template under the folder "default" is treated magically (the name "default" is stripped, so "site/default" becomes just "site", and you can have "site/default" and "site/empty" live side by side)
However, we can handle this in other ways instead...
1) We already delete templates that are located underneath a project, so we can just create site and put site/empty inside of it.
2) We can add a field to .kobweb-template.yaml, so that we still create site/default but it reads from the template file the name site and uses that instead. No more magic default value.
1 has an advantage that it is backwards compatible. Old CLIs should work just fine. And we can remove all our "default" suffix logic in the code.
2 is clean because it supports sibling templates while still documenting what was previously magic. However, this now requires kobweb create to walk through all projects to find one with a matching name.
I was originally trying to avoid nesting, but it might happen anyway. For example, now I'm considering creating a template called site/empty/multimodule
Currently, a template under the folder "default" is treated magically (the name "default" is stripped, so "site/default" becomes just "site", and you can have "site/default" and "site/empty" live side by side)
However, we can handle this in other ways instead...
1) We already delete templates that are located underneath a project, so we can just create
site
and putsite/empty
inside of it. 2) We can add a field to.kobweb-template.yaml
, so that we still createsite/default
but it reads from the template file the namesite
and uses that instead. No more magicdefault
value.1
has an advantage that it is backwards compatible. Old CLIs should work just fine. And we can remove all our "default" suffix logic in the code.2
is clean because it supports sibling templates while still documenting what was previously magic. However, this now requireskobweb create
to walk through all projects to find one with a matching name.I was originally trying to avoid nesting, but it might happen anyway. For example, now I'm considering creating a template called
site/empty/multimodule