module namespace page = 'http://ossetic-studies.org/ns/abaevdict-site'; declare namespace tei = "http://www.tei-c.org/ns/1.0"; import module namespace abv-m = 'http://ossetic-studies.org/ns/abaevdict-mod' at '../abv-mod.xqm'; import module namespace shared = 'http://ossetic-studies.org/ns/abaevdict-site/shared' at './shared/shared.xq'; (: COMPONENTS :) (: To make the codebase more manageable, components are split into separate files included as modules. :) import module namespace home = 'http://ossetic-studies.org/ns/abaevdict-site/home' at './components/home.xq'; import module namespace dict = 'http://ossetic-studies.org/ns/abaevdict-site/dictionary' at './components/dictionary.xq'; import module namespace index = 'http://ossetic-studies.org/ns/abaevdict-site/index' at './components/index.xq'; (: =============================================================== :) (: ============================ FAVICON ========================== :) (: =============================================================== :) declare %rest:path("/favicon.ico") %rest:GET function page:favicon() { fetch:binary('../../static/favicon.ico') }; (: =============================================================== :) (: ======================= HOMEPAGE ============================== :) (: =============================================================== :) declare %rest:path("{$lang}") %output:method("html") %output:html-version('5') function page:zero($lang) { page:home($lang) }; declare %rest:path("/") %output:method("html") %output:html-version('5') function page:zero() { page:zero('en') }; declare %rest:path("{$lang}/home") %output:method("html") %output:html-version('5') function page:home($lang) { {shared:head(if ($lang='ru') then 'ИЭСОЯ — Главная' else 'Abaevdict — Home',())}
{shared:header($lang,`../{shared:invert-lang($lang)}/home`)}