Hi, is it possible to have one repository in which the Hugo site source is held (without the content, but does include the templates) and another where it’s only what would be under the template folder?
I would want to try to host something like this on Netlify.
I did think of using Git Submodules but they need to be updated on each build, so either an automatic commit to refresh the submodule or (on netlify) running a command to update the submodules.
But then builds don’t automatically launch after something is put into the content repository.
Maybe, perhaps, there is a way to mirror the two repositories somehow? and is this possible at all? (considering I want to open source the content, but not the site source)
(Maybe a better question for the netlify forum, but I wanted to ask here too)
Netlify has a feature called Build Hooks. You can force a re-deploy by sending a POST to an URL. I would create a Github action on the content repository that calls to the Netlify build hook of the “main repository” (the one that loads the content and others as module) on push events to the content repo.
I would write a deploy script that is run instead of the hugo call.
#!/bin/bash
hugo mod get -u ./...
hugo --more --parameters
Instead of the mod get -u you could run your submodule update call. There seems to be no way to force an “empty cache and redeploy”, that’s only possible manually via the website.
I suspect you can avoid a build hook by making the “content repo” the Hugo project you build from. This would then contain content only, but would import other repos (theme etc.).
This way you trigger builds
when the content changes
and when the theme changes (which would update the module version in the content repo)