diff options
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.xsl | 20 |
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']"/> |