aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-26 23:31:12 +0200
committerAdrian Kummerlaender2014-07-26 23:31:12 +0200
commitcff2b8fe9a763752e0f871cad09dee6ed86da1ea (patch)
tree570848e3b69d318be250b4fe40a2d70b45a95e7a
parent93d4a7e4e1d1e577cb7fddc42345f5eb9c117678 (diff)
downloadblog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.tar
blog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.tar.gz
blog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.tar.bz2
blog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.tar.lz
blog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.tar.xz
blog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.tar.zst
blog.kummerlaender.eu-cff2b8fe9a763752e0f871cad09dee6ed86da1ea.zip
Added separate year node to article datasource
* this is needed for the implementation of a article datasource grouped by year ** this in turn is needed for the archive page template * modified tags meta transformation and article result transformation accordingly
-rw-r--r--source/02_data/articles.xsl7
-rw-r--r--source/03_meta/tags.xsl9
-rw-r--r--source/99_result/article/article.xsl2
3 files changed, 15 insertions, 3 deletions
diff --git a/source/02_data/articles.xsl b/source/02_data/articles.xsl
index 8900085..6f79675 100644
--- a/source/02_data/articles.xsl
+++ b/source/02_data/articles.xsl
@@ -49,7 +49,12 @@
<xsl:value-of select="xalan:nodeset($content)/h1"/>
</title>
<date>
- <xsl:value-of select="substring(./name, 0, 11)"/>
+ <full>
+ <xsl:value-of select="substring(./name, 0, 11)"/>
+ </full>
+ <year>
+ <xsl:value-of select="substring(./name, 0, 5)"/>
+ </year>
</date>
<tags>
<xsl:call-template name="list_tags">
diff --git a/source/03_meta/tags.xsl b/source/03_meta/tags.xsl
index 84114e8..ac77335 100644
--- a/source/03_meta/tags.xsl
+++ b/source/03_meta/tags.xsl
@@ -22,7 +22,14 @@
<xsl:template name="get_article_data">
<xsl:param name="handle"/>
- <xsl:copy-of select="$root/articles/entry[@handle = $handle]/*[self::title | self::date]"/>
+ <xsl:variable name="article" select="$root/articles/entry[@handle = $handle]/*[self::title | self::date]"/>
+
+ <title>
+ <xsl:value-of select="$article/self::title"/>
+ </title>
+ <date>
+ <xsl:value-of select="$article/self::date/full"/>
+ </date>
</xsl:template>
<xsl:template match="tags/entry">
diff --git a/source/99_result/article/article.xsl b/source/99_result/article/article.xsl
index af8702b..11fd2b5 100644
--- a/source/99_result/article/article.xsl
+++ b/source/99_result/article/article.xsl
@@ -31,7 +31,7 @@
</h2>
<p class="info">
<xsl:call-template name="format-date">
- <xsl:with-param name="date" select="./date"/>
+ <xsl:with-param name="date" select="./date/full"/>
<xsl:with-param name="format" select="'M x, Y'"/>
</xsl:call-template>
| <xsl:for-each select="tags/tag">