Adapting relative links to match the structure of the browsable archive
This commit is contained in:
parent
bf2980567a
commit
bc581fabf9
|
@ -49,7 +49,8 @@
|
||||||
<xsl:matching-substring>
|
<xsl:matching-substring>
|
||||||
<xsl:text>url(</xsl:text>
|
<xsl:text>url(</xsl:text>
|
||||||
<xsl:variable name="abs" select="substring-before(concat(resolve-uri(regex-group(1), $base), '#'), '#')"/>
|
<xsl:variable name="abs" select="substring-before(concat(resolve-uri(regex-group(1), $base), '#'), '#')"/>
|
||||||
<xsl:value-of select="$index/resource[(uri, same-as) = $abs]/local-name"/>
|
<xsl:variable name="local-name" select="$index/resource[(uri, same-as) = $abs][1]/local-name"/>
|
||||||
|
<xsl:value-of select="if ($local-name) then concat('../', $local-name) else resolve-uri(regex-group(1), $base)"/>
|
||||||
<xsl:text>)</xsl:text>
|
<xsl:text>)</xsl:text>
|
||||||
</xsl:matching-substring>
|
</xsl:matching-substring>
|
||||||
<xsl:non-matching-substring>
|
<xsl:non-matching-substring>
|
||||||
|
|
|
@ -58,7 +58,8 @@
|
||||||
<xsl:template match="link[@rel='stylesheet']/@href|img/@src|script/@src">
|
<xsl:template match="link[@rel='stylesheet']/@href|img/@src|script/@src">
|
||||||
<xsl:attribute name="{name(.)}">
|
<xsl:attribute name="{name(.)}">
|
||||||
<xsl:variable name="abs" select="substring-before(concat(resolve-uri(., $base), '#'), '#')"/>
|
<xsl:variable name="abs" select="substring-before(concat(resolve-uri(., $base), '#'), '#')"/>
|
||||||
<xsl:value-of select="$index/resource[(uri, same-as) = $abs]/local-name"/>
|
<xsl:variable name="local-name" select="$index/resource[(uri, same-as) = $abs][1]/local-name"/>
|
||||||
|
<xsl:value-of select="if ($local-name) then concat(if ($resource/uri/@seed = 'false') then '../' else '', $local-name) else resolve-uri(., $base)"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="link[@rel!='stylesheet']/@href|a/@href">
|
<xsl:template match="link[@rel!='stylesheet']/@href|a/@href">
|
||||||
|
|
Loading…
Reference in New Issue