Configuration
[taxonomies]
tag = 'tags'
[[related.indices]]
name = 'tags'
weight = 100
Content structure
content/
├── books/
│ ├── book-1.md <-- tags = a, b, c
│ ├── book-2.md <-- tags = a, b, c
│ ├── book-3.md <-- tags = a, b
│ └── book-4.md <-- tags = a
└── films/
├── film-1.md <-- tags = a
├── film-2.md <-- tags = a, b
└── film-3.md <-- tags = a, b, c
Code
{{ with site.RegularPages.Related . }}
Current outcome when viewing book-1, in this sort order
Film 3 tags = a, b, c
Book 2 tags = a, b, c
Film 2 tags = a, b
Book 3 tags = a, b
Film 1 tags = a
Book 4 tags = a
N.B. All pages have different dates, and the date affects the sort order among items with matching tags.
I tried to give the date zero weight, in case that might override the default behavior:
[[related.indices]]
name = 'date'
weight = 0
Desired outcome when viewing book-1, in this sort order, regardless of date
Book 2 tags = a, b, c
Film 3 tags = a, b, c
Book 3 tags = a, b
Film 2 tags = a, b
Book 4 tags = a
Film 1 tags = a
Approach
I think this could be accomplished by adding .Type and/or .Section to the available indices.
Example
git clone --single-branch -b hugo-forum-topic-42762 https://github.com/jmooring/hugo-testing hugo-forum-topic-42762
cd hugo-forum-topic-42762
hugo server