aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/index.xsl67
1 files changed, 67 insertions, 0 deletions
diff --git a/templates/index.xsl b/templates/index.xsl
new file mode 100644
index 0000000..ee60c72
--- /dev/null
+++ b/templates/index.xsl
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" encoding="UTF-8"
+ doctype-system="about:legacy-compat"/>
+
+ <xsl:variable name="site-name">
+ <xsl:choose>
+ <xsl:when test="/page/@site-name">
+ <xsl:value-of select="/page/@site-name"/>
+ </xsl:when>
+ <xsl:otherwise>Pleasant SSO</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:template match="/page">
+ <html xml:lang="en" lang="en">
+ <head>
+ <title>
+ <xsl:if test="@title">
+ <xsl:value-of select="@title"/>
+ —
+ </xsl:if>
+ <xsl:value-of select="$site-name"/>
+ </title>
+ <meta name="viewport" content="width=device-width,initial-scale=1"/>
+ <link rel="stylesheet" href="/static/style.css"/>
+ </head>
+ <body>
+ <xsl:call-template name="page-header"/>
+ <main>
+ <xsl:if test="@title">
+ <h1><xsl:value-of select="@title"/></h1>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </main>
+ <xsl:call-template name="page-footer"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="page-header">
+ <header>
+ <site-name><xsl:value-of select="$site-name"/></site-name>
+ </header>
+ </xsl:template>
+
+ <xsl:template name="page-footer">
+ <footer>
+ <a><xsl:attribute name="href">
+ <xsl:value-of select="/page/@source"/>
+ </xsl:attribute>
+ Source code</a>
+ </footer>
+ </xsl:template>
+
+ <xsl:template match="content">
+ <xsl:copy-of select="*"/>
+ </xsl:template>
+
+ <xsl:template match="error">
+ <error-message>
+ <box-label>Error</box-label>
+ <xsl:copy-of select="."/>
+ </error-message>
+ </xsl:template>
+
+</xsl:stylesheet>