webtides / luna-js

MIT License
8 stars 0 forks source link

Feature/improve entries for static export #103

Closed eddyloewen closed 2 years ago

eddyloewen commented 2 years ago

This is still a draft for now because it is based on #102

Currently when exporting static sites vie the luna cli it is either automatically finding all routes for you or manually defining all routes via the entries property in config.export.

If you need to add some more routes because you have dynamic routes for example you have to redefine all other (static) routes manually again.

With this change we can now accept all static routes as parameter for the entries callback.

entries: async (routes) => {
    const dynamicRoutes = [...]
    return [...routes, ...dynamicRoutes];
},

Also I would like to discuss the naming of "entries" here 😆 . I think "routes" or "pages" would be better?! What do you think? @quarkus @lukas-schardt

lukas-schardt commented 2 years ago

@eddyloewen I think pages would fit. It was meant like entryPoints, but i think pages would really be better

eddyloewen commented 2 years ago

@lukas-schardt I renamed the "entries" key for the export config to "pages"