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,26 +15,45 @@
<text>## Navigation&#10;</text>
<for-each select="document('../content/navigation.xml')/navigation/group">
<for-each select="file">
<text>=&gt; </text>
<value-of select="concat($baseurl, ., '.gmi')"/>
<text> </text>
<choose>
<when test="string-length(@title) = 0">
<value-of select="document(concat('../content/pages/', ., '.xml'))/page/@title"/>
</when>
<otherwise>
<value-of select="@title"/>
</otherwise>
</choose>
<text>&#10;</text>
</for-each>
<apply-templates mode="navitem" select="child::*"/>
<text>&#10;</text>
</for-each>
<text>&#10;</text>
<call-template name="body"/>
</template>
<template mode="navitem" match="file">
<text>=&gt; </text>
<value-of select="concat($baseurl, ., '.gmi')"/>
<text> </text>
<choose>
<when test="string-length(@title) = 0">
<value-of select="document(concat('../content/pages/', ., '.xml'))/page/@title"/>
</when>
<otherwise>
<value-of select="@title"/>
</otherwise>
</choose>
<text>&#10;</text>
</template>
<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]">
<text># </text><value-of select="@pagetitle"/><text> | c3d2.de&#10;</text>