getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.33k stars 933 forks source link

multipy "static" directory like pathes #499

Closed mash-graz closed 3 years ago

mash-graz commented 5 years ago

gutenberg only supports one single directory, which has to be named "static" for the inclusion of media assets and similar stuff.

if you utilize via git web frontends like GitLab, this doesn't work very well, because the image src locations resp. path relations in the source tree are never the same as in the final generated pages. on local machines you can work around this issue by utilizing symbolic links, but this approach doesn't work very well with multiplatform oriented git CI/CD workflows. in this case you have to utilize very inefficient and unpleasant copy instructions in the CI scripts as a last resort.

a configuration option to specify additional source/target directory pairs, which will work otherwise just like the static directory mechanism, would provide a much nicer solution to make e.g. the /images location accessible even in the source tree just like in the finally generated pages.

Keats commented 5 years ago

You can have assets next to content: https://www.getgutenberg.io/documentation/content/overview/#assets-colocation

mash-graz commented 5 years ago

yes -- that's another workaround, which i was thinking about, but it doesn't work very well for tools like netlify-cms, which want to upload all assets to one location.

Keats commented 5 years ago

but it doesn't work very well for tools like netlify-cms, which want to upload all assets to one location.

That looks like a limitation of netlify-cms, but Hugo has a similar one folder static and I expect netlify-cms work with it?

mash-graz commented 5 years ago

netlify-cms allows two variants of media_folder setup:

although the latter variant works well, if you only want to use netlify-cms web-frontent, it isn't compatible with markdown previews/rendering in GitLab and similar setups, because of the changing path reference. i think, that's also the reason, why most popular GitHub SGGs prefer the other variant.

the third variant -- i.e. puting the images inside the content folder --, doesn't work with netlify-cms if you use more than one collection (=section).

well -- it's indeed only a minor issue, because it's rather easy to utilize GitLabs CI system capabilities or other batch processing scripts to copy pictures around or create links etc. before finally calling gutenberg, but a simple configuration option for this purpose, still looks like a more desirable solution to me.

JadedBlueEyes commented 5 years ago

My issue is that I have a giant pile of image files, from RFG, that need to go into my project root. I don’t want these cluttering up my static directory. When I used Jekyll, I created a collection called favicons, and changed some majic config to copy it to the root. It’d be nice if there was some way to configure copying one folder of static files to a specific position in the output.

Keats commented 3 years ago

Probably not going to happen in the short term and doesn't seem like a feature requested by many.