diff options
| author | winter Sparkles | 2026-08-06 23:47:34 +0100 |
|---|---|---|
| committer | winter Sparkles | 2026-08-06 23:47:34 +0100 |
| commit | ef14ba500ff27dd2d1fe6e5debd99f7a5fc4db10 (patch) | |
| tree | 1dd707be810472b13fe8ac60f204f74dfbecf9c6 /templates | |
initial commit
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/index.xsl | 67 |
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> |
