-
Notifications
You must be signed in to change notification settings - Fork 0
/
navigation.xsl
33 lines (28 loc) · 1.03 KB
/
navigation.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="navigation">
<a href="{$root}"><img src="{$workspace}/img/logo.png" alt=""/></a>
<ul class="clearfix">
<xsl:apply-templates select="page"/>
</ul>
</xsl:template>
<xsl:template match="navigation/page">
<li>
<a>
<xsl:choose>
<xsl:when test="types/type = 'index'">
<xsl:attribute name="href"><xsl:value-of select="$root"/>/</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href"><xsl:value-of select="$root"/>/<xsl:value-of select="@handle"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@handle = $current-page">
<xsl:attribute name="current">active</xsl:attribute>
</xsl:if>
<xsl:value-of select="name"/>
</a>
</li>
</xsl:template>
</xsl:stylesheet>