added permalink and stacked icons to the left

This commit is contained in:
Oleg Belyaev 2025-03-24 01:03:05 +03:00
parent ad87bf327e
commit fe72db6c49
2 changed files with 24 additions and 8 deletions

View file

@ -535,3 +535,10 @@ span.abv-text-sc {
This file evolved from Natural Selection: This file evolved from Natural Selection:
https://github.com/frontaid/natural-selection https://github.com/frontaid/natural-selection
*/ */
.icons{
text-align: center;
width: 1.5em;
float: left;
padding-right: 0.5vw;
}

View file

@ -521,14 +521,23 @@ declare %rest:path("{$lang}/dict")
let $html := if ($xpath != '' and $entry = $doc/@xml:id) let $html := if ($xpath != '' and $entry = $doc/@xml:id)
then abv-m:mark-element(doc(`abaevdict_{$lang}/xml/{$doc/@xml:id}.xml`),$xpath) => abv-m:make-html($lang) then abv-m:mark-element(doc(`abaevdict_{$lang}/xml/{$doc/@xml:id}.xml`),$xpath) => abv-m:make-html($lang)
else doc(`abaevdict_{$lang}/html/{$doc/@xml:id}.html`) else doc(`abaevdict_{$lang}/html/{$doc/@xml:id}.html`)
return if (doc('abaevdict_index/mentioned_en.xml')/ return (
lang-index/lang[@id != 'os' and (: Block with icons to the left of entry (floating) :)
not(starts-with(@id,'os-'))]/word/entry[@id=string($doc/@xml:id)]) then <div class="icons">
$html transform with {insert nodes (<br/>, {
<a class="abv-map" data-abv-entry="{$doc/@xml:id}"> <a href="dict/{$doc/@xml:id}">
<img src="/static/map.png"></img></a>) as last <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16">
into ./article[1]/h6[1]} <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>
else $html <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z"/>
</svg>
</a>,
if (doc('abaevdict_index/mentioned_en.xml')/lang-index
/lang[@id != 'os' and
not(starts-with(@id,'os-'))]/word/entry[@id=string($doc/@xml:id)])
then <a class="abv-map" data-abv-entry="{$doc/@xml:id}">
<img src="/static/map.png"></img>
</a>}</div>,
$html)
} }
</main> </main>