feat: use fileurl instead of manipulated filename

This commit is contained in:
Darragh Elliott 2024-09-18 17:19:41 +01:00
parent 4477c4401b
commit c0682c8522
3 changed files with 6 additions and 6 deletions

View File

@ -12,8 +12,8 @@
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">referrer</xsl:attribute>
<xsl:attribute name="value">
<xsl:text>https://fsfe.org/</xsl:text>
<xsl:value-of select="substring-after(substring-after(/buildinfo/@filename,'/'),'/')"/>
<xsl:text>https://fsfe.org</xsl:text>
<xsl:value-of select="/buildinfo/@fileurl"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
</xsl:element>
@ -23,8 +23,8 @@
<xsl:template match="fsfe-cd-donate-link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>https://my.fsfe.org/donate?referrer=https://fsfe.org/</xsl:text>
<xsl:value-of select="substring-after(substring-after(/buildinfo/@filename,'/'),'/')"/>
<xsl:text>https://my.fsfe.org/donate?referrer=https://fsfe.org</xsl:text>
<xsl:value-of select="/buildinfo/@fileurl"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>

View File

@ -148,7 +148,7 @@
<xsl:attribute name="rel">alternate</xsl:attribute>
<xsl:attribute name="hreflang"><xsl:value-of select="@id" /></xsl:attribute>
<xsl:attribute name="lang"><xsl:value-of select="@id" /></xsl:attribute>
<xsl:attribute name="href">/<xsl:value-of select="substring-after(substring-after(/buildinfo/@filename, '/'), '/')"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="/buildinfo/@fileurl"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="." disable-output-escaping="yes" /></xsl:attribute>
</xsl:element>
</xsl:for-each>

View File

@ -35,7 +35,7 @@
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>/<xsl:value-of select="substring-after(substring-after(/buildinfo/@filename,'/'),'/')"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:value-of select="$urlprefix"/><xsl:value-of select="/buildinfo/@fileurl"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:element>
</xsl:element>