xsl/gemini: add support for <link> in navigation.xml
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Astro 2024-03-08 00:42:18 +01:00
parent d4b1e972bd
commit e201eb2f6e
1 changed files with 34 additions and 15 deletions

View File

@ -15,7 +15,14 @@
<text>## Navigation&#10;</text>
<for-each select="document('../content/navigation.xml')/navigation/group">
<for-each select="file">
<apply-templates mode="navitem" select="child::*"/>
<text>&#10;</text>
</for-each>
<call-template name="body"/>
</template>
<template mode="navitem" match="file">
<text>=&gt; </text>
<value-of select="concat($baseurl, ., '.gmi')"/>
<text> </text>
@ -28,11 +35,23 @@
</otherwise>
</choose>
<text>&#10;</text>
</for-each>
</for-each>
<text>&#10;</text>
</template>
<call-template name="body"/>
<template mode="navitem" match="link">
<text>=> </text>
<call-template name="make-href">
<with-param name="href">
<choose>
<when test="@href"><value-of select="@href"/></when>
<otherwise><value-of select="."/></otherwise>
</choose>
</with-param>
</call-template>
<text> </text>
<call-template name="normalize-paragraph">
<with-param name="text" select="normalize-space(.)"/>
</call-template>
<text>&#10;</text>
</template>
<template match="/page[@pagetitle]">