aboutsummaryrefslogtreecommitdiff
path: root/source/02_augment/articles.xsl
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-10-27 13:17:43 +0100
committerAdrian Kummerlaender2014-10-27 13:17:43 +0100
commite4ae586170229de78aaf00963e2f0c49427a9926 (patch)
tree5e8fdf8fb7acba7e09cdfee941a739ac61fed30e /source/02_augment/articles.xsl
parent7116f8fd112d721fac44b2bafa23023b9f0f9234 (diff)
downloadOverview-e4ae586170229de78aaf00963e2f0c49427a9926.tar
Overview-e4ae586170229de78aaf00963e2f0c49427a9926.tar.gz
Overview-e4ae586170229de78aaf00963e2f0c49427a9926.tar.bz2
Overview-e4ae586170229de78aaf00963e2f0c49427a9926.tar.lz
Overview-e4ae586170229de78aaf00963e2f0c49427a9926.tar.xz
Overview-e4ae586170229de78aaf00963e2f0c49427a9926.tar.zst
Overview-e4ae586170229de78aaf00963e2f0c49427a9926.zip
Implemented latest article view
* the first paragraph of the three latest articles of my blog are now displayed on the overview page * feed is fetched via `curl` in `01_raw/article_feed.xsl` ** as with all commit feeds the article feed is processed further in the `02_augment` level ** the count of articles to be displayed is defined in `00_content/meta.xml` as `article_count` * CSS was updated to correctly display the article summary
Diffstat (limited to 'source/02_augment/articles.xsl')
-rw-r--r--source/02_augment/articles.xsl50
1 files changed, 50 insertions, 0 deletions
diff --git a/source/02_augment/articles.xsl b/source/02_augment/articles.xsl
new file mode 100644
index 0000000..36e1c7c
--- /dev/null
+++ b/source/02_augment/articles.xsl
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:include href="[utility/datasource.xsl]"/>
+
+<xsl:variable name="meta">
+ <datasource type="main" mode="full" source="01_raw/article_feed.xml" target="articles"/>
+ <target mode="plain" value="articles.xml"/>
+</xsl:variable>
+
+<xsl:template match="id" mode="article"/>
+
+<xsl:template match="author" mode="article">
+ <xsl:copy>
+ <xsl:value-of select="name"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="updated" mode="article">
+ <date>
+ <xsl:value-of select="substring(., 0, 11)"/>
+ </date>
+</xsl:template>
+
+<xsl:template match="link" mode="article">
+ <link>
+ <xsl:value-of select="@href"/>
+ </link>
+</xsl:template>
+
+<xsl:template match="content[@type = 'xhtml']" mode="article">
+ <content>
+ <xsl:apply-templates select="div/p[1]" mode="article"/>
+ </content>
+</xsl:template>
+
+<xsl:template match="@* | node()" mode="article">
+ <xsl:copy>
+ <xsl:apply-templates select="@* | node()" mode="article"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="articles">
+ <xsl:apply-templates select="entry" mode="article"/>
+</xsl:template>
+
+</xsl:stylesheet>