statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.65k stars 235 forks source link

Blog post assets output folder #894

Open daveaglick opened 4 years ago

daveaglick commented 4 years ago

If the destination path is being modified globally (I.e. for blog posts to output at a dated slug path), then any assets should also use the same path logic. That way if a blog post uses a relative link to an image in the same folder, the image outputs at the same relative path to the post. See https://github.com/11ty/eleventy/issues/1140 for a better description and where I originally found this feature concept.

This won't work today because the Assets pipeline uses the CopyFiles module which always assumes the same relative output path. Seems like this could be pretty easily addressed by either allowing the CopyFiles module to set destination paths similar to the SetDestination module or making assets use a pair of ReadFiles/WriteFiles modules with a SetDestination in-between.