]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: fix 404 page when fetched from different location
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 22 Jun 2012 13:21:18 +0000 (15:21 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 10 Aug 2012 08:54:23 +0000 (10:54 +0200)
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).

docs/404.html.in
docs/site.xsl

index 9363871457cc2c43e7a46555a3974e8c36f23ba7..6021ad0d0872574f13f6b143f598061d26fa31e6 100644 (file)
@@ -15,7 +15,7 @@
     </ul>
 
     <p class="image">
-      <img src="libvirtLogo404.png" alt="libvirt Logo"/>
+      <img src="/libvirtLogo404.png" alt="libvirt Logo"/>
     </p>
 
 
index a6801e661f9d747005ad709e96443c76aa1da0b9..a65c10d28e9ec825f6bdde68c90bd64762dc0802 100644 (file)
     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">