[libvirt] [PATCH 4/6] docs: adapt filling of <head> section for rst2html output

Daniel P. Berrangé berrange at redhat.com
Fri Nov 8 11:21:10 UTC 2019

The HTML from rst2html doesn't have <h1> immediately under the <body>
tag, instead there is at least one <div> in between.

There are also many things added in the <head> section that we don't
want to have copied over, since our templating system already adds
suitable <head> elements.

We only need to copy the <script> to make index.html work.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
 docs/page.xsl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/page.xsl b/docs/page.xsl
index 65ddeb2bb7..8faea07e65 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -95,9 +95,9 @@
         <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
         <link rel="manifest" href="/manifest.json"/>
         <meta name="theme-color" content="#ffffff"/>
-        <title>libvirt: <xsl:value-of select="html:html/html:body/html:h1"/></title>
+        <title>libvirt: <xsl:value-of select="html:html/html:body//html:h1"/></title>
         <meta name="description" content="libvirt, virtualization, virtualization API"/>
-        <xsl:apply-templates select="/html:html/html:head/*" mode="content"/>
+        <xsl:apply-templates select="/html:html/html:head/html:script" mode="content"/>
         <script type="text/javascript" src="{$href_base}js/main.js">
           <xsl:comment>// forces non-empty element</xsl:comment>

More information about the libvir-list mailing list