Add roles and versions as new dimensions (in addition to language)

See the main issue #13776 for details.

Fixes #519
Fixes #13680
Fixes #13663
Fixes #13776
Fixes #13855
Fixes #13648
Fixes #13996
Fixes #14001
Fixes #14031
Fixes #13818
Fixes #13196
This commit is contained in:
Bjørn Erik Pedersen
2025-11-05 15:52:47 +01:00
parent ff0f67ea7f
commit 264022a75a
209 changed files with 13766 additions and 6019 deletions
+7 -7
View File
@@ -24,8 +24,8 @@ import (
"golang.org/x/net/html"
"github.com/gohugoio/hugo/common/hstrings"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/helpers"
)
const eof = -1
@@ -77,9 +77,9 @@ func (h *HTMLElements) Merge(other HTMLElements) {
h.Classes = append(h.Classes, other.Classes...)
h.IDs = append(h.IDs, other.IDs...)
h.Tags = helpers.UniqueStringsReuse(h.Tags)
h.Classes = helpers.UniqueStringsReuse(h.Classes)
h.IDs = helpers.UniqueStringsReuse(h.IDs)
h.Tags = hstrings.UniqueStringsReuse(h.Tags)
h.Classes = hstrings.UniqueStringsReuse(h.Classes)
h.IDs = hstrings.UniqueStringsReuse(h.IDs)
}
func (h *HTMLElements) Sort() {
@@ -122,9 +122,9 @@ func (c *htmlElementsCollector) getHTMLElements() HTMLElements {
}
}
classes = helpers.UniqueStringsSorted(classes)
ids = helpers.UniqueStringsSorted(ids)
tags = helpers.UniqueStringsSorted(tags)
classes = hstrings.UniqueStringsSorted(classes)
ids = hstrings.UniqueStringsSorted(ids)
tags = hstrings.UniqueStringsSorted(tags)
els := HTMLElements{
Classes: classes,