docs: page.xsl: Split up 'href_base' for assets and links

To allow reuse of this template as-is in libvirt-wiki, we need to be
able to specify a distinct asset_href_base and link_href_base. Adjust
the template to allow that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-02-07 17:05:49 +01:00
parent 334858bd40
commit c4e35af08c
3 changed files with 15 additions and 12 deletions

View File

@ -815,7 +815,8 @@
encoding="UTF-8">
<xsl:apply-templates select="exsl:node-set($subpage)" mode="page">
<xsl:with-param name="timestamp" select="$timestamp"/>
<xsl:with-param name="href_base" select="$href_base"/>
<xsl:with-param name="link_href_base" select="$href_base"/>
<xsl:with-param name="asset_href_base" select="$href_base"/>
</xsl:apply-templates>
</xsl:document>
</xsl:for-each>

View File

@ -17,7 +17,8 @@
<xsl:template match="/" mode="page">
<xsl:param name="pagesrc"/>
<xsl:param name="timestamp"/>
<xsl:param name="href_base"/>
<xsl:param name="link_href_base"/>
<xsl:param name="asset_href_base"/>
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
</xsl:text>
<html data-sourcedoc="{$pagesrc}">
@ -31,7 +32,7 @@
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="{$href_base}css/main.css"/>
<link rel="stylesheet" type="text/css" href="{$asset_href_base}css/main.css"/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
@ -43,7 +44,7 @@
<meta name="go-import" content="{/html:html/html:head/html:meta[@name='go-import']/@content}"/>
</xsl:if>
<script type="text/javascript" src="{$href_base}js/main.js">
<script type="text/javascript" src="{$asset_href_base}js/main.js">
<xsl:comment>// forces non-empty element</xsl:comment>
</script>
</head>
@ -62,13 +63,13 @@
</div>
<div id="nav">
<div id="home">
<a href="{$href_base}index.html">Home</a>
<a href="{$link_href_base}index.html">Home</a>
</div>
<div id="jumplinks">
<ul>
<li><a href="{$href_base}downloads.html">Download</a></li>
<li><a href="{$href_base}contribute.html">Contribute</a></li>
<li><a href="{$href_base}docs.html">Docs</a></li>
<li><a href="{$link_href_base}downloads.html">Download</a></li>
<li><a href="{$link_href_base}contribute.html">Contribute</a></li>
<li><a href="{$link_href_base}docs.html">Docs</a></li>
</ul>
</div>
<div id="search">
@ -91,8 +92,8 @@
<div id="contact">
<h3>Contact</h3>
<ul>
<li><a href="{$href_base}contact.html#mailing-lists">email</a></li>
<li><a href="{$href_base}contact.html#irc">irc</a></li>
<li><a href="{$link_href_base}contact.html#mailing-lists">email</a></li>
<li><a href="{$link_href_base}contact.html#irc">irc</a></li>
</ul>
</div>
<div id="community">
@ -112,7 +113,7 @@
</div>
</xsl:if>
<div id="conduct">
Participants in the libvirt project agree to abide by <a href="{$href_base}governance.html#code-of-conduct">the project code of conduct</a>
Participants in the libvirt project agree to abide by <a href="{$link_href_base}governance.html#code-of-conduct">the project code of conduct</a>
</div>
<br class="clear"/>
</div>

View File

@ -31,7 +31,8 @@
<xsl:apply-templates select="." mode="page">
<xsl:with-param name="pagesrc" select="$pagesrc"/>
<xsl:with-param name="timestamp" select="$timestamp"/>
<xsl:with-param name="href_base" select="$href_base"/>
<xsl:with-param name="link_href_base" select="$href_base"/>
<xsl:with-param name="asset_href_base" select="$href_base"/>
</xsl:apply-templates>
</xsl:template>