[PATCH] docs: Convert 404 page to rST

Peter Krempa pkrempa at redhat.com
Tue Feb 21 08:23:44 UTC 2023


On Tue, Feb 21, 2023 at 08:28:14 +0100, Martin Kletzander wrote:
> There is no markup equivalent for any of the <s/> or <del/> HTML tags, so this
> is the only thing I came up with and it looks like it works.
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
> Sorry if I'm trampling on someone else's patches, I just figured out how to keep
> the strike-through text Peter mentioned, so I'm sending it to "share the
> knowledge" ;)
> 
>  docs/404.html.in     | 19 -------------------
>  docs/404.rst         | 16 ++++++++++++++++
>  docs/css/libvirt.css |  4 ++++
>  docs/meson.build     |  7 +------
>  4 files changed, 21 insertions(+), 25 deletions(-)
>  delete mode 100644 docs/404.html.in
>  create mode 100644 docs/404.rst

[...]

> diff --git a/docs/meson.build b/docs/meson.build
> index a90c59866a71..96ca21509047 100644
> --- a/docs/meson.build
> +++ b/docs/meson.build
> @@ -22,6 +22,7 @@ docs_html_in_files = [
>  ]
>  
>  docs_rst_files = [
> +  '404',
>    'aclpolkit',
>    'advanced-tests',
>    'api',
> @@ -251,12 +252,6 @@ html_xslt_gen += {
>    'depends': aclperms_gen,
>  }
>  
> -html_xslt_gen += {
> -  'name': '404',
> -  'source': 'docs' / '404.html.in',
> -  'href_base': '/',
> -}
> -
>  hvsupport_html_in = custom_target(
>    'hvsupport.html.in',
>    output: 'hvsupport.html.in',

The 404 page is special in the way how it requires the 'href_base'
parameter to be set and the implications in doing that.

The reason for it is that it needs to work in an arbitrarily deep broken
URI e.g.: https://libvirt.org/asdfasdfzsdf/ssdfgsdg/

There relative URIs will not work properly.

On the other hand we can't get rid of the 'href_base' parameter as we do
want relative URIs to work properly for viewing the webpage from disk.
This also causes the 404 page break horribly when viewed from anywhere
else than the web server.

If you preserve the "absolute" href base for 404:

Reviewed-by: Peter Krempa <pkrempa at redhat.com>


More information about the libvir-list mailing list