diff options
author | Ulrich Müller <ulm@gentoo.org> | 2020-01-29 12:21:52 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2020-02-03 01:01:19 +0100 |
commit | a17eeb5d6403f6e020b1ae7fbe92f6606bb28ed0 (patch) | |
tree | aa9117c0688305d9b53e3fa02d01168687f95c99 /devbook.xsl | |
parent | devbook.xsl: Move all header parts into the header element. Add main. (diff) | |
download | devmanual-a17eeb5d6403f6e020b1ae7fbe92f6606bb28ed0.tar.gz devmanual-a17eeb5d6403f6e020b1ae7fbe92f6606bb28ed0.tar.bz2 devmanual-a17eeb5d6403f6e020b1ae7fbe92f6606bb28ed0.zip |
devbook.xsl: Define relative_path_depth_recursion only once.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'devbook.xsl')
-rw-r--r-- | devbook.xsl | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/devbook.xsl b/devbook.xsl index be30022..3ff6502 100644 --- a/devbook.xsl +++ b/devbook.xsl @@ -437,18 +437,18 @@ </xsl:template> <xsl:template match="/"> + <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/> + <xsl:variable name="relative_path_depth_recursion"> + <xsl:call-template name="str:repeatString"> + <xsl:with-param name="count" select="$relative_path_depth"/> + <xsl:with-param name="append">../</xsl:with-param> + </xsl:call-template> + </xsl:variable> <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text> <xsl:value-of select='$newline'/> <html lang="en"> <head> <title><xsl:value-of select="/guide/chapter[1]/title"/> – Gentoo Development Guide</title> - <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/> - <xsl:variable name="relative_path_depth_recursion"> - <xsl:call-template name="str:repeatString"> - <xsl:with-param name="count" select="$relative_path_depth"/> - <xsl:with-param name="append">../</xsl:with-param> - </xsl:call-template> - </xsl:variable> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="The Gentoo Devmanual is a technical manual which covers topics such as writing ebuilds and eclasses, and policies that developers should be abiding by." /> <link href="https://assets.gentoo.org/tyrian/bootstrap.min.css" rel="stylesheet" media="screen" /> @@ -508,13 +508,6 @@ </div> <div class="collapse navbar-collapse navbar-main-collapse"> <ul class="nav navbar-nav"> - <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/> - <xsl:variable name="relative_path_depth_recursion"> - <xsl:call-template name="str:repeatString"> - <xsl:with-param name="count" select="$relative_path_depth"/> - <xsl:with-param name="append">../</xsl:with-param> - </xsl:call-template> - </xsl:variable> <li><a href="{concat($relative_path_depth_recursion, substring-after(substring-before(@link, '##'), '::'), 'index.html', substring-after(@link, '##'))}"><span class="fa fa-home"/>  Home</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><xsl:value-of select="/guide/chapter[1]/title"/> <span class="caret"></span></a> @@ -618,13 +611,6 @@ <script src="https://assets.gentoo.org/tyrian/jquery.min.js"></script> <script src="https://assets.gentoo.org/tyrian/bootstrap.min.js"></script> <script src="https://assets.gentoo.org/lunr/lunr.min.js"></script> - <xsl:variable name="relative_path_depth" select="string-length(/guide/@self)-string-length(translate(/guide/@self, '/' , ''))"/> - <xsl:variable name="relative_path_depth_recursion"> - <xsl:call-template name="str:repeatString"> - <xsl:with-param name="count" select="$relative_path_depth"/> - <xsl:with-param name="append">../</xsl:with-param> - </xsl:call-template> - </xsl:variable> <script><xsl:text>var documentsSrc = "</xsl:text><xsl:value-of select="$relative_path_depth_recursion"/><xsl:text>documents.js"</xsl:text></script> <script src="{$relative_path_depth_recursion}search.js"></script> </body> |