Is it possible to change the content of a mounted module?

Currently I am importing the hugo static folder as a module to keep big files out of the vcs for my site development. Works like a charm. Now I am thinking about mounting the content folder to separate the layout from the content.

As far as I know hugo does not change the static folder, but it may write to the content folder (Example: hugo new Does this work on a folder in the local filesystem? And what is hugo doing, if the content is imported from github or elsewhere on the web?

I think there are only 2 places where Hugo writes to conten 1) hugo new and 2) jekyll import.

If we ignore 2) for now. In 1) we do try to determine the content folder (a logic that may fail, and logic that may be improved), but you have the option to provide the path, e.g. “hugo new content/”.

In short:

  1. You can mount both local and remote folders on top of eachother
  2. I would not worry about this problem. If it is a problem, there are workarounds; if it’s a big problem, we will fix it.

Thank you!

Only to be sure, I do understand your answer correclty:
It is not possible to write into folders, which are mounted as modules. If I want to generate skeletons for new posts via archetypes, I have to use a content folder, which is placed in the standard hugo directory structure. But I can mix both types of content folders, mounted and normal. This is what you meant with, “mount on top of each other”. I only have to check, that there are no duplicate entries, overriding each other. Yes?

As long as they’re local, it is. But I would’nt focus too much on “writing into folder”, as that is a very rare thing in Hugo.

I am not worrying very much, just want to change my workflow with modules and don’t run into unnecessary trouble. I’m using Hugo since 0.18. You are doing a tremendous job. This is and was a very reliable piece of software!