summaryrefslogtreecommitdiff
path: root/tools/xml-to-html.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/xml-to-html.xsl')
-rw-r--r--tools/xml-to-html.xsl44
1 files changed, 39 insertions, 5 deletions
diff --git a/tools/xml-to-html.xsl b/tools/xml-to-html.xsl
index d317688..96c94c8 100644
--- a/tools/xml-to-html.xsl
+++ b/tools/xml-to-html.xsl
@@ -68,19 +68,32 @@
<!-- The rest is fixed metadata -->
<link property="dc:creator schema:creator foaf:maker sioc:has_creator"
href="https://defanor.uberspace.net/about.xhtml#me" />
+ <link property="dc:creator schema:creator foaf:maker sioc:has_creator"
+ href="https://www.thunix.net/~defanor/about.xhtml#me" />
+ <link property="dc:license schema:license"
+ href="https://creativecommons.org/licenses/by-sa/4.0/" />
<link property="dc:isPartOf schema:isPartOf sioc:has_container"
href="https://defanor.uberspace.net/" />
+ <link property="dc:isPartOf schema:isPartOf sioc:has_container"
+ href="https://www.thunix.net/~defanor/" />
<meta name="robots" content="noarchive" />
</head>
<body>
<xsl:apply-templates mode="body" select="xhtml:body/@*" />
<xsl:apply-templates mode="body" select="xhtml:body/*" />
<footer>
+ defanor, <a
+ href="https://creativecommons.org/licenses/by-sa/4.0/">CC
+ BY-SA 4.0</a>,
<xsl:if test="not(//notes) and @created and @modified">
- <a href="https://defanor.uberspace.net/">defanor</a>,
- <time><xsl:copy-of select="substring(@created,0,8)" /></time>
- <xsl:if test="substring(@created,0,8) != substring(@modified,0,8)"> to <time><xsl:copy-of select="substring(@modified,0,8)" /></time></xsl:if>
- </xsl:if>
+ <time><xsl:copy-of select="substring(@created,0,8)"
+ /></time> <xsl:if test="substring(@created,0,8) !=
+ substring(@modified,0,8)"> to <time><xsl:copy-of
+ select="substring(@modified,0,8)" /></time></xsl:if>,
+ </xsl:if>at <a
+ href="https://defanor.uberspace.net/">defanor.uberspace.net</a>
+ or <a
+ href="https://www.thunix.net/~defanor/">thunix.net/~defanor</a>
</footer>
</body>
</html>
@@ -127,6 +140,27 @@
</dd>
</xsl:template>
+ <xsl:template mode="body" match="files">
+ <xsl:variable name="files" select="document(@src)" />
+ <xsl:variable name="number" select="@number" />
+ <ul>
+ <xsl:apply-templates mode="file-index"
+ select="$files/files/file[$number=0 or position()&lt;=$number]">
+ <xsl:with-param name="prefix"
+ select="@prefix" />
+ </xsl:apply-templates>
+ </ul>
+ </xsl:template>
+
+ <xsl:template mode="file-index" match="file">
+ <xsl:param name="prefix" />
+ <li>
+ <a href="{$prefix}/{@src}">
+ <xsl:value-of select="@src" />
+ </a>
+ </li>
+ </xsl:template>
+
<xsl:template mode="body" match="xhtml:h1|xhtml:h2|xhtml:h3|xhtml:h4|xhtml:h5">
<xsl:copy>
<xsl:attribute name="id">
@@ -137,7 +171,7 @@
</xsl:copy>
</xsl:template>
- <xsl:template mode="body" match="@* | node()" priority="0">
+ <xsl:template mode="body" match="@* | node()" priority="-1">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates mode="body" />