Closed dnk8n closed 1 year ago
Is there some post-process functionality I am maybe missing? Because then it could be as simple as:
await Deno.rename("_site/styles.css", "static/styles.css");
I just found the relevant piece:
site.addEventListener("afterBuild", (event) => {
Deno.renameSync("_site/styles.css", "static/styles.css");
});
and it appears to be working properly. Apologies. I did go on a bit of a hunt, but failed to make the connection earlier on.
Yes, for your use case the afterBuild
event, to move manually the generated files is the best choice.
Enter your suggestions in details:
I am integrating Lume with Fresh. In my example Lume is responsible for generating styles.css and html. I manually commit files to static/ used both in Fresh and Lume parts of the site.
Here is a diagram to explain
Fresh uses middleware to route to the Lume generated html like this, routes/_middleware.ts:
I would prefer to only route HTML this way. It is a fallback, where contents of static/ directory take priority over html files intercepted by this middleware, all other fresh routes follow.
I would like a way for lume to have html destination be _site (or whatever is configured in Site options) and for CSS (using sass and postcss) to be generated and copied directly to the static/ directory.
I think it would be great for the SiteOptions.dest to be used as a default, but for there to be an override option to allow specific generated content to be placed in directories (relative to SiteOptions.cwd maybe)