xsl/gemini.xsl: tidy up
This commit is contained in:
parent
73e22d6a38
commit
5f8400b5aa
102
xsl/gemini.xsl
102
xsl/gemini.xsl
|
@ -9,70 +9,45 @@
|
|||
<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 </text>
|
||||
<text>## <<</>> Chaos Computer Club Dresden </text>
|
||||
|
||||
<call-template name="body">
|
||||
<with-param name="title" select="normalize-space($title)" />
|
||||
</call-template>
|
||||
<text>## Navigation </text>
|
||||
<for-each select="document('../content/navigation.xml')/navigation/group">
|
||||
<for-each select="file">
|
||||
<text>=> </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> </text>
|
||||
</for-each>
|
||||
</for-each>
|
||||
<text> </text>
|
||||
|
||||
<call-template name="body"/>
|
||||
</template>
|
||||
|
||||
<template match="/item">
|
||||
<variable name="title">
|
||||
<value-of select="/item/@title"/>
|
||||
</variable>
|
||||
<template match="/page[@pagetitle]">
|
||||
<text># </text><value-of select="@pagetitle"/><text> | c3d2.de </text>
|
||||
|
||||
<call-template name="body">
|
||||
<with-param name="title" select="$title" />
|
||||
</call-template>
|
||||
<call-template name="body"/>
|
||||
</template>
|
||||
|
||||
<template match="/page[@title]">
|
||||
<text># </text><value-of select="@title"/><text> | c3d2.de </text>
|
||||
|
||||
<call-template name="body"/>
|
||||
</template>
|
||||
|
||||
<template name="body">
|
||||
<param name="title" />
|
||||
|
||||
<text># </text><value-of select="$title"/><text> </text>
|
||||
<text>## <<</>> Chaos Computer Club Dresden | c3d2 </text>
|
||||
|
||||
|
||||
<if test="/page/portal">
|
||||
<text>## Navigation </text>
|
||||
<for-each select="document('../content/navigation.xml')/navigation/group">
|
||||
<for-each select="file">
|
||||
<text>=> </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> </text>
|
||||
</for-each>
|
||||
</for-each>
|
||||
<text> </text>
|
||||
</if>
|
||||
|
||||
<apply-templates/>
|
||||
|
||||
<text> => </text>
|
||||
|
@ -82,6 +57,19 @@
|
|||
|
||||
<!-- news -->
|
||||
|
||||
<template match="/item">
|
||||
<text># </text><value-of select="@title"/><text> | c3d2 </text>
|
||||
|
||||
<call-template name="get-datestring">
|
||||
<with-param name="date" select="@date"/>
|
||||
</call-template>
|
||||
<text> von </text>
|
||||
<value-of select="@author"/>
|
||||
<text> </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" />
|
||||
|
|
Loading…
Reference in New Issue