diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-31 16:07:28 +0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2020-02-10 02:34:34 +0100 |
commit | 96f1ee8417e4d6c7134e13ab86ac55e52f1bc841 (patch) | |
tree | a83046f8a02d0511eac775c566b7817a338ddc38 /help3xsl/get_bookmark.xsl | |
parent | b6e3324d71cd4b17cd9384b43b762fb10ce92343 (diff) |
Don't hardcode version in links in online help
... so that when current page URL is like
https://help.libreoffice.org/latest/en-US/text/shared/05/new_help.html
links from it will lead to other pages under 'latest', not to
https://help.libreoffice.org/6.3/...
The problem reason was that in online help, HTML referred to resources
with relative URLs starting with version number, like
'href="6.3/media/navigation/favicon.ico"'. The links didn't include the
version level in local help: 'href="media/navigation/favicon.ico"'.
This was naturally accompanied by <base href="../../../../../"> (online)
and '<base href="../../../../">' (local), coming from "tokenize" in
help3xsl/online_transform.xsl.
This unifies online help behaviour with that of local help.
Change-Id: I486cbfbd680d52d00ef99ade9af5ecac2967c115
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/87768
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/get_bookmark.xsl')
-rw-r--r-- | help3xsl/get_bookmark.xsl | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/help3xsl/get_bookmark.xsl b/help3xsl/get_bookmark.xsl index 692ded0ffe..c53a559596 100644 --- a/help3xsl/get_bookmark.xsl +++ b/help3xsl/get_bookmark.xsl @@ -22,13 +22,6 @@ xsltproc get_bookmark.xsl <file.xhp> <xsl:param name="productversion"/> <xsl:output indent="yes" method="text"/> -<xsl:variable name="online" select="$local!='yes'"/> -<xsl:variable name="target"> - <xsl:choose> - <xsl:when test="$online"><xsl:value-of select="concat($productversion,'/')"/></xsl:when> - <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise> - </xsl:choose> -</xsl:variable> <!-- ############################ @@ -61,7 +54,7 @@ xsltproc get_bookmark.xsl <file.xhp> <xsl:template match="/"> <xsl:for-each select="//bookmark[@branch='index']"> <xsl:variable name="hrefhtml" select="substring-before($filename,'xhp')"/> - <xsl:variable name="href" select="concat($target,$Language,'/',$hrefhtml,'html?DbPAR=',$app,'#',@id)"/> + <xsl:variable name="href" select="concat($Language,'/',$hrefhtml,'html?DbPAR=',$app,'#',@id)"/> <xsl:for-each select="bookmark_value"> <xsl:text disable-output-escaping="yes"><![CDATA[{url:"]]></xsl:text> <xsl:value-of select="$href"/> |