[libvirt] [PATCH 1/3] docs: fix 404 page when fetched from different location

Martin Kletzander mkletzan at redhat.com
Fri Aug 10 09:34:24 UTC 2012


On 08/09/2012 04:25 PM, Eric Blake wrote:
> On 08/09/2012 08:17 AM, Martin Kletzander wrote:
>> 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 '/' and changing the src of
>> the image.
>> ---
>>  docs/404.html.in |    2 +-
>>  docs/site.xsl    |   11 ++++++++++-
>>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> I'm no xsl expert, but
> 
>> -  <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>
> 
> this reads pretty straightforward, so I'm okay giving:
> 
> ACK.
> 

Thanks, pushed with a trivial fix (I realized that href_base is only for
the stylesheets and other things added in the xsl, thus is not replaced
in the html, so I changed it to '/' in the image and double checked that
it generates correctly before pushing).

I'm not good with xsl as well, I just talked about this with DV and he
helped me with some of these things. Thanks DV.

Martin




More information about the libvir-list mailing list