]> git.draconx.ca Git - homepage.git/blobdiff - layouts/default.xsl
Add links from generated pages to source code on gitweb.
[homepage.git] / layouts / default.xsl
index 5b9aa42a71118a08556c4da870b033d9b068148c..67b7e9199484f6daf67304c4e8eb28149bcc17a3 100644 (file)
   doctype-system='http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' />
 <xsl:strip-space elements='*' />
 
+<xsl:param name='source-uri'
+  select='"//git.draconx.ca/gitweb/homepage.git/blob/"' />
 <xsl:param name='site-title' select='"The Citrine Citadel"' />
 
 <xsl:template match='node()|@*'>
   <xsl:copy><xsl:apply-templates select='node()|@*' /></xsl:copy>
 </xsl:template>
 
+<xsl:template match='source'>
+  <p>
+    <xsl:text>This document was compiled from </xsl:text>
+    <a href='{concat($source-uri, revision, ":", file)}'>
+      <xsl:value-of select='file' />
+    </a>
+    <xsl:text> on </xsl:text>
+    <xsl:value-of select='compiletime' />
+    <xsl:text>.</xsl:text>
+  </p>
+</xsl:template>
+
 <xsl:template match='/'>
   <html>
     <head>
     <body>
       <xsl:apply-templates select='/document/xhtml:html/@*' />
       <xsl:apply-templates select='/document/xhtml:html/node()' />
+
+      <div id='footer'>
+        <xsl:apply-templates select='/document/source' />
+      </div>
     </body>
   </html>
 </xsl:template>