docs: fix 404 page when fetched from different location

Error 404 page had relative paths specified for both the image and
stylesheets which caused a problem when requested URL included a
subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects
this behaviour by modifying href_base to '/' (for style-sheets) and
changing the src of the image (to be '/' always).
This commit is contained in:
Martin Kletzander 2012-06-22 15:21:18 +02:00
parent b8a56f12f5
commit 3924072e4e
2 changed files with 11 additions and 2 deletions

View File

@ -15,7 +15,7 @@
</ul>
<p class="image">
<img src="libvirtLogo404.png" alt="libvirt Logo"/>
<img src="/libvirtLogo404.png" alt="libvirt Logo"/>
</p>

View File

@ -14,7 +14,16 @@
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<xsl:variable name="href_base" select="''"/>
<xsl:variable name="href_base">
<xsl:choose>
<xsl:when test="$pagename = '404.html'">
<xsl:value-of select="'/'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template match="/">
<xsl:apply-templates select="." mode="page">