wrap everything in another div to enable centering of page
[cmcms:cmcms.git] / src / tag.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4 cmcms == CMCMS Content Management System
5 Copyright (C) 2008,2009,2010,2012  Claude Heiland-Allen <claudiusmaximus@goto10.org>
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Affero General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU Affero General Public License for more details.
16
17 You should have received a copy of the GNU Affero General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 -->
21 <xsl:stylesheet version="1.0"
22  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23  xmlns="http://www.w3.org/1999/xhtml">
24 <xsl:output method="xml" indent="no" encoding="UTF-8"
25  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
26  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
27 <xsl:param name="SITENAME" />
28 <xsl:param name="HEADER1" />
29 <xsl:param name="HEADER2" />
30 <xsl:param name="FOOTER" />
31 <xsl:param name="tag" />
32 <xsl:template match="/">
33 <html xml:lang="en" lang="en">
34 <head>
35 <title><xsl:value-of select="$tag" /> :: <xsl:value-of select="$SITENAME" /></title>
36 <link rel="stylesheet" type="text/css" href="cmcms.css" title="cmcms" />
37 <link rel="alternate stylesheet" type="text/css" href="print.css" title="print" />
38 <link rel="alternate" type="application/rss+xml" href="{$tag}.rss" title="{$SITENAME} {$tag} feed" />
39 </head>
40 <body><div class="body">
41 <div class="top">
42 <div class="header">
43 <xsl:copy-of select="document($HEADER1)" />
44 <xsl:copy-of select="document($HEADER2)" />
45 </div>
46 <div class="main">
47 <h2 class="tagname"><xsl:value-of select="$tag" /></h2>
48 <xsl:apply-templates select="pages/page[tag=$tag]" />
49 <div class="separator" />
50 </div>
51 </div>
52 <xsl:copy-of select="document($FOOTER)" />
53 </div></body>
54 </html>
55 </xsl:template>
56 <xsl:template match="page">
57 <xsl:variable name="me" select="file" />
58 <div class="pageref" id="p_{file}">
59 <h3><a class="title" href="{file}.html" title="{title}"><xsl:value-of select="title" /></a></h3>
60 <div class="date"><a href="./#p_{$me}"><xsl:value-of select="date" /></a></div>
61 <ul class="tags">
62 <xsl:for-each select="tag">
63 <li><a class="tag" href="{.}.html#p_{$me}" title="{.}"><xsl:value-of select="." /></a></li>
64 </xsl:for-each>
65 </ul>
66 <div class="summary"><xsl:copy-of select="summary/node()" /></div>
67 </div>
68 </xsl:template>
69 </xsl:stylesheet>