aboutsummaryrefslogtreecommitdiff
path: root/source/02_data
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-24 20:34:09 +0200
committerAdrian Kummerlaender2014-07-24 20:34:09 +0200
commit776c0031c05c8660fee8d1b06a2371cbb43248f9 (patch)
tree882b3db0ba09f484325a8101c1408bcc1c1ee79f /source/02_data
parent305eb17cd2d70c2e922b8997ada86b29329d660e (diff)
downloadblog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.tar
blog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.tar.gz
blog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.tar.bz2
blog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.tar.lz
blog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.tar.xz
blog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.tar.zst
blog.kummerlaender.eu-776c0031c05c8660fee8d1b06a2371cbb43248f9.zip
Implemented basic article tagging facility
* articles are tagged by symlinking them to the appropriate "tag" in the "tags" directory * tags are resolved by the article datasource transformation * added tags for the example articles
Diffstat (limited to 'source/02_data')
-rw-r--r--source/02_data/articles.xsl13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/02_data/articles.xsl b/source/02_data/articles.xsl
index 508f435..7547cc7 100644
--- a/source/02_data/articles.xsl
+++ b/source/02_data/articles.xsl
@@ -22,6 +22,14 @@
<target mode="plain" value="articles.xml"/>
</xsl:variable>
+<xsl:template name="list_tags">
+ <xsl:param name="path"/>
+
+ <xsl:for-each select="../../tags/*[./file/full = $path]">
+ <tag><xsl:value-of select="name()"/></tag>
+ </xsl:for-each>
+</xsl:template>
+
<xsl:template match="files/articles/file[./extension = '.md']">
<xsl:variable name="content">
<xsl:call-template name="formatter">
@@ -37,6 +45,11 @@
<date>
<xsl:value-of select="substring(./name, 0, 11)"/>
</date>
+ <tags>
+ <xsl:call-template name="list_tags">
+ <xsl:with-param name="path" select="./full"/>
+ </xsl:call-template>
+ </tags>
<content>
<xsl:copy-of select="xalan:nodeset($content)/*[name() != 'h1']"/>
</content>