xsl/gemini.xsl: tidy up
c3d2-web build failure Details
c3d2-gemini deployed Details

This commit is contained in:
Astro 2022-03-08 18:02:04 +01:00
parent 73e22d6a38
commit 5f8400b5aa
1 changed files with 53 additions and 65 deletions

View File

@ -9,50 +9,10 @@
<strip-space elements="page item addendum image event div p ul ol li blockquote"/>
<include href="date.xsl"/>
<template match="/page">
<variable name="title">
<choose>
<when test="/page/portal">
C3D2.de
</when>
<when test="/page/@pagetitle">
<value-of select="normalize-space(/page/@pagetitle)"/>
</when>
<when test="/page/@title">
<value-of select="normalize-space(/page/@title)"/>
</when>
<when test="/page/calendar-summary">
<call-template name="calendar-title"/>
</when>
<otherwise>
<comment><text> missing title </text></comment>
</otherwise>
</choose>
</variable>
<template match="/page[portal]">
<text># c3d2.de&#10;</text>
<text>## &lt;&lt;&lt;/&gt;&gt; Chaos Computer Club Dresden&#10;&#10;</text>
<call-template name="body">
<with-param name="title" select="normalize-space($title)" />
</call-template>
</template>
<template match="/item">
<variable name="title">
<value-of select="/item/@title"/>
</variable>
<call-template name="body">
<with-param name="title" select="$title" />
</call-template>
</template>
<template name="body">
<param name="title" />
<text># </text><value-of select="$title"/><text>&#10;</text>
<text>## &lt;&lt;&lt;/&gt;&gt; Chaos Computer Club Dresden | c3d2&#10;&#10;</text>
<if test="/page/portal">
<text>## Navigation&#10;</text>
<for-each select="document('../content/navigation.xml')/navigation/group">
<for-each select="file">
@ -71,8 +31,23 @@
</for-each>
</for-each>
<text>&#10;</text>
</if>
<call-template name="body"/>
</template>
<template match="/page[@pagetitle]">
<text># </text><value-of select="@pagetitle"/><text> | c3d2.de&#10;</text>
<call-template name="body"/>
</template>
<template match="/page[@title]">
<text># </text><value-of select="@title"/><text> | c3d2.de&#10;</text>
<call-template name="body"/>
</template>
<template name="body">
<apply-templates/>
<text>&#10;&#10;=> </text>
@ -82,6 +57,19 @@
<!-- news -->
<template match="/item">
<text># </text><value-of select="@title"/><text> | c3d2&#10;</text>
<call-template name="get-datestring">
<with-param name="date" select="@date"/>
</call-template>
<text> von </text>
<value-of select="@author"/>
<text>&#10;&#10;</text>
<call-template name="body"/>
</template>
<template match="/page/news">
<for-each select="newsfile">
<sort select="date:seconds(document(concat('../', .))/item/@date)" data-type="number" order="descending" />