-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
See https://discourse.gohugo.io/t/mounting-different-branches-tags-from-the-same-repository/55849
That discussion isn't new, and looking at it in the light of the upcoming new version and role dimensions in Hugo (in addition to the existing language), having a way to mount multiple minor versions of a module in the same project would be super useful.
I have certainly spent some time thinking about this before, but I suspect I haven't thought "simple" enough.
So, Go Modules support multiple major versions of the same module (e.g. github.com/bep/mymod and github.com/bep/mymod/v2), but I don't think there's a practical way to do multiple minor versions directly with Go Modules.
But I think we could add a concept of fixed version module imports (with a commit hash or a version tag added to the config), so we get:
- A set of module imports that follows the version life cycle of Go Modules (with Minimum Version Selection (MVS) and version upgrades via
hugo mod getetc.). This is typically the current working branch of content modules you're working on, shortcode/JavaScript/CSS modules etc. - A set of module imports with a fixed version set in
hugo.toml. These will not show up ingo.modorgo.sum(we probably need to add ahugo.sumfor these), and they will not be upgradable viahugo mod get(you need to edit the config), but other than that they should work as the "others" (and we would certainly use Go's tooling to do this).
I will spend a couple of hours tomorrow morning (when my head is fresh) to see if the above is viable.