Symlinking to a git submodule

Hey all. We have two separate projects, both running Hugo. I would like to import one as a git submodule and then symlink the content from the submodule into a specific content directory in the parent.

e.g. parent > content > demos —> submodule > content

So navigating to localhost/demos would load the content from the submodule.

Is this possible?

I think so, BUT I would really recommend you have a look at the Hugo Modules documentation, and esp. the part about file mounts.

1 Like

Hey @bep, thanks for that. I’ve just had a thought, would this be possible:

  1. Import the submodule directly into the theme folder
  2. Set the theme to be the new sub module
  3. Have a content directory in both the root and the theme
  4. If the content folder e.g. demos is found in the theme this is loaded
  5. If the content folder e.g. about is found in the root this is loaded

I guess my question is does Hugo look for a content directory first in the theme and then in the root? Can we have multiple content directories? Sorry I’m new to themes, we haven’t used them to date.

Again, I suggest you go read the docs about Hugo Modules.

OK. Thanks.