[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/4] docs: fix 404 page when fetched from different location



On Thu, Jun 21, 2012 at 01:47:40PM +0200, Martin Kletzander wrote:
> On 06/21/2012 12:24 PM, Daniel P. Berrange wrote:
> > On Thu, Jun 21, 2012 at 12:18:12PM +0200, 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.
> >> ---
> >>  docs/404.html.in |    5 ++++-
> >>  1 files changed, 4 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/docs/404.html.in b/docs/404.html.in
> >> index 9363871..66e4c14 100644
> >> --- a/docs/404.html.in
> >> +++ b/docs/404.html.in
> >> @@ -1,5 +1,8 @@
> >>  <?xml version="1.0"?>
> >>  <html>
> >> +  <head>
> >> +    <link rel="stylesheet" type="text/css" href="/main.css" />
> >> +  </head>
> > 
> > The page.xsl already generates a <head> section with a <link> element.
> > What you need todo is fix  site.xsl to use '/' as the href_base. In
> > fact if we just used '/' as href_base, then we can remove the
> > subsite.xsl entirely.
> > 
> 
> I haven't noticed that, thanks. OK, so I deleted subsite.xsl, replaced
> it with site.xsl, but internals/*.html are still generated with
> ../main.css, which is ok, but its not what I meant to achieve. The only
> place where href_base is set to '../' is newapi.xsl, but that one is
> used only for libvirt-api.xml if I read the rules and Makefiles correctly.

Unfortunately I've just realized we can't do what I suggested, because
that only works if browsing the pages via apache. If you just point
your web browser at /usr/share/doc/libvirt, then all the CSS links will
be broken.

So we need to keep the relative href_base, but in site.xsl, add a
special case setting href_base to '/', /only/ for the 404.html page

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]