Skip to content

Commit

Permalink
Add json-ld-task
Browse files Browse the repository at this point in the history
  • Loading branch information
tomschr committed Feb 8, 2024
1 parent 78270ed commit 752a0f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions suse2022-ns/xhtml/json-ld.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
<xsl:call-template name="json-ld-category">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="json-ld-task">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<!-- Belongs to type "SoftwareApplication" -->
<xsl:call-template name="json-ld-version">
<xsl:with-param name="node" select="$node"/>
Expand Down Expand Up @@ -713,4 +716,17 @@
</xsl:if>
</xsl:template>

<xsl:template name="json-ld-task">
<xsl:param name="node" select="."/>
<xsl:variable name="task" select="$node/d:info/d:meta[@name='task']/@content"/>
<xsl:if test="$task">
"about": [{<xsl:for-each select="$task">
"@type": "Thing",
"name": "<xsl:value-of select="."/>"
}<xsl:if test="position() != last()">,&#10; </xsl:if>
</xsl:for-each>
],
</xsl:if>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 752a0f7

Please sign in to comment.