Skip to content

Commit

Permalink
Merge pull request #605 from openSUSE/docteam1249-meta2json
Browse files Browse the repository at this point in the history
Implement external JSON-LD file
  • Loading branch information
tomschr authored Feb 16, 2024
2 parents 3214ae5 + 2abc850 commit 3adb372
Show file tree
Hide file tree
Showing 3 changed files with 621 additions and 145 deletions.
33 changes: 33 additions & 0 deletions suse2022-ns/xhtml/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,39 @@
</xsl:if>
</xsl:template>


<!-- ############################################################## -->
<xsl:template match="d:book|d:article|d:set" priority="2" mode="process.root">
<xsl:apply-imports/>
<xsl:if test="$rootid = @xml:id and $is.chunk = 0">
<xsl:choose>
<xsl:when test="$dcfilename != ''">
<xsl:call-template name="generate-json-ld-external">
<xsl:with-param name="node" select="." />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="log.message">
<xsl:with-param name="level">WARN</xsl:with-param>
<xsl:with-param name="context-desc">
<xsl:text>JSON-LD</xsl:text>
</xsl:with-param>
<xsl:with-param name="message">
<xsl:text>The parameter $dcfile is unset. Cannot find the DC file in Docserv config.</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>

<xsl:template match="/" priority="2" mode="process.root">
<xsl:apply-imports/>
<xsl:call-template name="generate-json-ld-external">
<xsl:with-param name="node" select="/*"/>
</xsl:call-template>
</xsl:template>

<xsl:template match="*" mode="process.root">
<xsl:param name="prev"/>
<xsl:param name="next"/>
Expand Down
Loading

0 comments on commit 3adb372

Please sign in to comment.