conditional call for crypto function
continuous-integration/drone/push Build is failing Details

This commit is contained in:
vv01f 2023-11-08 20:14:49 +01:00
parent 7259266fd1
commit c30565d4a0
1 changed files with 9 additions and 8 deletions

View File

@ -380,14 +380,15 @@
</xsl:template>
<xsl:template match="/page/portal/item">
<!-- 1 (not really) random character 1-9 and blank -->
<!--
deactivated until nix package has crypto support
-->
<xsl:variable name="diceroll">4</xsl:variable>
<!--
<xsl:variable name="diceroll" select="translate(substring(crypto:sha1(.),1,1),'0abcdef','')"/>
-->
<!-- 1 (not really) random character 1-9 and blank
crypto:sha1 depends on crypto being built with xsltproc
-->
<xsl:variable name="diceroll"><!--
--><xsl:choose><!--
--><xsl:when test="not(function-available('crypto:sha1'))">4</xsl:when><!--
--><xsl:otherwise><xsl:text select="translate(substring(crypto:sha1(.),1,1),'0abcdef','')"/></xsl:otherwise><!--
--></xsl:choose><!--
--></xsl:variable>
<article>
<xsl:if test="@class">
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>