aboutsummaryrefslogtreecommitdiff
path: root/source/01_data
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-12-09 19:03:28 +0100
committerAdrian Kummerlaender2014-12-09 19:03:28 +0100
commit299dbbb58f9b6c6c85563bba4d1e43ae514a7949 (patch)
tree30a77680fb5d015648c1be639312cfb8f2a9bcfe /source/01_data
parent1b9a49bacf15c72c093b7e6de79b408c28e5b904 (diff)
downloadblog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.tar
blog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.tar.gz
blog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.tar.bz2
blog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.tar.lz
blog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.tar.xz
blog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.tar.zst
blog.kummerlaender.eu-299dbbb58f9b6c6c85563bba4d1e43ae514a7949.zip
Replaced function-like data resolution with template applications
* e.g. article and tag support data is now fetched through direct _XPath_ template applications ** this required the introduction of a special `resolve` mode to prevent interaction between support and main content resolution ** in most cases arguments had to be wrapped inside helper constants to enable selection of e.g. article support data via the `@handle` attribute using the current elements `@handle` attribute * analogously to the recent changes in _StaticXSLT_ this commit aims to improve the XSLT code style used in generating this static website
Diffstat (limited to 'source/01_data')
-rw-r--r--source/01_data/articles.xsl20
1 files changed, 8 insertions, 12 deletions
diff --git a/source/01_data/articles.xsl b/source/01_data/articles.xsl
index e207117..c25fe2a 100644
--- a/source/01_data/articles.xsl
+++ b/source/01_data/articles.xsl
@@ -12,17 +12,13 @@
<xsl:variable name="meta">
<datasource type="main" mode="xpath" source="$source_tree/directory[@name = '00_content']/directory" target="files"/>
- <target mode="plain" value="articles.xml"/>
+ <target mode="plain" value="articles.xml"/>
</xsl:variable>
-<xsl:template name="list_tags">
- <xsl:param name="path"/>
-
- <xsl:for-each select="$root/files/directory[@name = 'tags']/*[./file/full = $path]">
- <tag>
- <xsl:value-of select="@name"/>
- </tag>
- </xsl:for-each>
+<xsl:template match="files/directory[@name = 'tags']/*" mode="resolve">
+ <tag>
+ <xsl:value-of select="@name"/>
+ </tag>
</xsl:template>
<xsl:template match="files/directory[@name = 'articles']">
@@ -51,9 +47,9 @@
</year>
</date>
<tags>
- <xsl:call-template name="list_tags">
- <xsl:with-param name="path" select="./full"/>
- </xsl:call-template>
+ <xsl:variable name="self" select="."/>
+
+ <xsl:apply-templates select="$root/files/directory[@name = 'tags']/*[./file/full = $self/full]" mode="resolve"/>
</tags>
<content>
<xsl:copy-of select="xalan:nodeset($content)/*[name() != 'h1']"/>