Skip to content

Conversation

bep
Copy link
Member

@bep bep commented May 1, 2025

The implementation here is still early and non-working. So, the role part of this has been thought about a lot (at least by me, e.g. in #519). The versions part of this is a little vaguer, but I think it helps with the end result to add them both in one go.

So,

---
title: Hugo Rocks!
roles: [public]
versions: [v1.2.3, `v2.*`]

Note that the Glob pattern support in v2.* is also new – but I suspect we will need something like that for this.

As for languages, it will be possible to configure a role/version as the default (e.g. the "current version"). I guess it also makes sense to control whether the default should be rendered to a sub folder or not.

As to the order of the prefixes, role needs to come first, I guess.

  • I guess we will also add versions and roles to the file mount config.
  • I'm thinking we could also add some kind of "counter identifier" in content filenames, e.g. content/mybundle/index.§1.md and content/mybundle/index.§2.md to allow having multiple variants of the same content path.

New API

  • Site.Version; a struct with Name, Site ...
  • site.Versions; a slice of Version. Ordered by Weight (if set) ascending, else semver order, newest first.
  • Site.Role; a struct with Name, Site ...
  • site.Roles; a slice of Role.

Note that we currently have Site.Sites, which is, with the above setup coming, a little confusing, so we should possibly also consider to add Site to `Language.

New Config

I've thought about this, and decided to not make up any new clever syntax, but just mimic how we do it for languages.

defaultContentRole = "guest"
defaultContentRoleInSubdir = true
defaultContentVersion = "v2.0.0"
defaultContentVersionInSubdir = true

[roles]
[languages."guest"]
disabled = false
weight = 43
[versions]
[versions."v2.0.0"]
disabled = false
weight = 42

@bep bep force-pushed the feat/roles-versions-5139 branch 6 times, most recently from 864cfcd to 779649e Compare May 6, 2025 13:09
@bep bep force-pushed the feat/roles-versions-5139 branch 3 times, most recently from e914f3f to 6f88a60 Compare May 15, 2025 08:39
@bep bep force-pushed the feat/roles-versions-5139 branch 3 times, most recently from 01f9c33 to cf40195 Compare May 30, 2025 13:31
@bep bep force-pushed the feat/roles-versions-5139 branch 5 times, most recently from 958d82b to f131d38 Compare June 6, 2025 12:50
@bep bep force-pushed the feat/roles-versions-5139 branch 10 times, most recently from 9a2ad51 to 35d3765 Compare June 16, 2025 16:12
@bep bep force-pushed the feat/roles-versions-5139 branch 2 times, most recently from 3228817 to 99dda69 Compare June 19, 2025 10:26
@bep bep force-pushed the feat/roles-versions-5139 branch 2 times, most recently from bee5b9a to 42a0b02 Compare August 30, 2025 09:35
@bep bep force-pushed the feat/roles-versions-5139 branch from 42a0b02 to 1e16307 Compare August 30, 2025 09:40
@bep bep force-pushed the feat/roles-versions-5139 branch from a8c56f5 to c9852ca Compare August 31, 2025 18:08
@bep bep force-pushed the feat/roles-versions-5139 branch from c9852ca to 1b8f38b Compare September 1, 2025 08:46
@bep bep force-pushed the feat/roles-versions-5139 branch 2 times, most recently from 9e611be to 7a22979 Compare September 2, 2025 18:30
@bep bep force-pushed the feat/roles-versions-5139 branch from 7a22979 to 5c87b0f Compare September 3, 2025 15:12
@bep bep force-pushed the feat/roles-versions-5139 branch from 5c87b0f to 671f1d5 Compare September 4, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant