Add roles and versions as new dimensions (in addition to language) #13679
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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). Theversions
part of this is a little vaguer, but I think it helps with the end result to add them both in one go.So,
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.versions
androles
to the file mount config.content/mybundle/index.§1.md
andcontent/mybundle/index.§2.md
to allow having multiple variants of the same content path.New API
Site.Version
; a struct withName
,Site
...site.Versions
; a slice ofVersion
. Ordered byWeight
(if set) ascending, else semver order, newest first.Site.Role
; a struct withName
,Site
...site.Roles
; a slice ofRole
.Note that we currently have
Site.Sites
, which is, with the above setup coming, a little confusing, so we should possibly also consider to addSite
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.