fixed broken indexing

This commit is contained in:
Oleg Belyaev 2025-03-22 18:32:43 +03:00
parent af97248ef5
commit eba5e849b3

View file

@ -440,7 +440,8 @@ declare %rest:path("{$lang}/dict/{$id}")
%output:method("html")
%output:html-version('5')
function page:by-id($lang, $id) {
let $doc-index := index-of($page:sorted, $page:sorted[@xml:id=`{$id}`])
(: let $doc-index := index-of($page:sorted, $page:sorted[@xml:id=`{$id}`]) :)
let $doc-index := index-where($page:sorted, fn { ./@xml:id=$id })
let $pagenum := ceiling($doc-index div $page:items)
return web:redirect('../dict', {'page': $pagenum}, web:decode-url($id))
};