feat(glossy): Return array of pages in theme

Instead of returning an opaque context element with a fixed list of the
pages, return an array of context elements with each a page
(already unique!).
This is conceptually cleaner. Now it's the themes responsability to join
the array of unique pages however it wants. Most times, this will be a
`.join(", ")`, but could be e.g. `.first()` if the theme only wants to
show the page of the first occurance of this term.
Also update the documentation.

Breaking API change in the themes.
No visual differences (tests remain the same), but there are binary
differences.
This commit is contained in:
swaits authored and swaits committed 2025-10-26 16:00:21 -06:00
1 parent 68945132fb
commit 03e8e62c70
10 files changed
+21 -21

No files matched your search

+2 -2
View File
@@ -36,7 +36,7 @@
// - long: Long form of term (optional)
// - description: Term description (optional)
// - label: Term's dictionary label
// - pages: Linked page numbers where term appears
// - pages: Array of linked page numbers where term appears
// index: Zero-based entry index within group
// total: Total entries in group
entry: (entry, index, total) => {
@@ -62,7 +62,7 @@
left: 1em,
bottom: 0.5em,
block(
[#term#entry.label#long-form#description #h(1em) (pp. #entry.pages)]
[#term#entry.label#long-form#description #h(1em) (pp. #entry.pages.join(", "))]
)
)
)