aboutsummaryrefslogtreecommitdiff
path: root/source/02_augment
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-10-27 19:01:19 +0100
committerAdrian Kummerlaender2014-10-27 19:01:19 +0100
commit9b376ec4e2b50a9ba23de0338a0f7ee692fd8869 (patch)
treec26534705515e221a66af6edf7d3bcc12b5dc4ab /source/02_augment
parent53639fdc8a610f4940a3c8e444ed3285641f6d70 (diff)
downloadOverview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.tar
Overview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.tar.gz
Overview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.tar.bz2
Overview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.tar.lz
Overview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.tar.xz
Overview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.tar.zst
Overview-9b376ec4e2b50a9ba23de0338a0f7ee692fd8869.zip
Rewrite `href` attributes to base url
* the article feed contains links that expect the base url to be the blog url ** these links have to be rewritten to be absolute instead of relative to the blog url * this is achieved via a appropriate identity template in `02_augment/articles.xsl`
Diffstat (limited to 'source/02_augment')
-rw-r--r--source/02_augment/articles.xsl16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/02_augment/articles.xsl b/source/02_augment/articles.xsl
index 0f32987..e3eaf6f 100644
--- a/source/02_augment/articles.xsl
+++ b/source/02_augment/articles.xsl
@@ -31,6 +31,22 @@
</link>
</xsl:template>
+<xsl:template match="@href" mode="article">
+ <xsl:choose>
+ <xsl:when test="substring(., 0, 2) = '/'">
+ <xsl:attribute name="href">
+ <xsl:text>http://blog.kummerlaender.eu</xsl:text>
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
<xsl:template match="content[@type = 'xhtml']" mode="article">
<content>
<xsl:apply-templates select="div/p[1]/node()" mode="article"/>