diff options
author | defanor <defanor@uberspace.net> | 2018-05-01 07:20:44 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2018-05-01 07:20:44 +0300 |
commit | 0e39fa32bc657936001d62ef078f4f132f7f81a3 (patch) | |
tree | 43f5f53a8c82550dd67427dffbea283aa5ae2d5b | |
parent | c92ac94887cb318a20b0e40f783df08e53950be9 (diff) |
Handle prefixes for index links
So that notes can be linked from notes/index.xhtml as well. Most of
file path manipulation here is rather hacky.
-rw-r--r-- | tools/xml-to-html.xsl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/xml-to-html.xsl b/tools/xml-to-html.xsl index 1b92318..5d88077 100644 --- a/tools/xml-to-html.xsl +++ b/tools/xml-to-html.xsl @@ -97,13 +97,17 @@ <xsl:variable name="number" select="@number" /> <dl> <xsl:apply-templates mode="note-index" - select="$notes/notes/note[$number=0 or position()<=$number]" /> + select="$notes/notes/note[$number=0 or position()<=$number]"> + <xsl:with-param name="prefix" + select="@prefix" /> + </xsl:apply-templates> </dl> </xsl:template> <xsl:template mode="note-index" match="note"> + <xsl:param name="prefix" /> <dt> - <a href="{@src}"> + <a href="{$prefix}/{@src}"> <xsl:value-of select="document/@title" /> </a> </dt> |