Skip to content

Commit

Permalink
Merge pull request #561 from openSUSE/json-ld-finetune-2
Browse files Browse the repository at this point in the history
JSON-LD: Remove "role" property for authors
  • Loading branch information
tomschr authored Aug 3, 2023
2 parents 556697b + 602c688 commit 83f1c59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 5 additions & 11 deletions suse2022-ns/xhtml/json-ld.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
</xsl:message>-->

<xsl:choose>
<xsl:when test="count($candidate-authors/*) = 1">
<xsl:when test="number($json-ld-use-individual-authors) = 1 and count($candidate-authors/*) = 1">
<xsl:message>INFO: found one author</xsl:message>
<xsl:variable name="person">
<xsl:call-template name="person.name">
Expand All @@ -209,11 +209,11 @@
</xsl:variable>
"author": {
"@type": "Person",
"name": "<xsl:value-of select="$person"/>",
"role": "Writer"
"name": "<xsl:value-of select="$person"/>"<!--,
"role": "Writer"-->
},
</xsl:when>
<xsl:when test="count($candidate-authors/*) > 1">
<xsl:when test="number($json-ld-use-individual-authors) = 1 and count($candidate-authors/*) > 1">
"author": [<!--
--><xsl:call-template name="json-ld-person.name.list">
<xsl:with-param name="node" select="$candidate-authors"/>
Expand Down Expand Up @@ -263,13 +263,7 @@
</xsl:variable>
{
"@type": "Person",
"name": "<xsl:value-of select="string($name)"/>",
"role": "<xsl:choose>
<!-- <xsl:when test="local-name($person.list[position()=$count]) = 'author'">Writer</xsl:when>-->
<xsl:when test="local-name($person.list[position()=$count]) = 'editor'">Editor</xsl:when>
<xsl:when test="local-name($person.list[position()=$count]) = 'othercredit'">Contributor</xsl:when>
<xsl:otherwise>Writer</xsl:otherwise>
</xsl:choose>"
"name": "<xsl:value-of select="string($name)"/>"
}<xsl:if test="$count &lt; $person.count">,&#10;</xsl:if>
<xsl:call-template name="json-ld-person.name.list">
<xsl:with-param name="person.list" select="$person.list"/>
Expand Down
2 changes: 2 additions & 0 deletions suse2022-ns/xhtml/param.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ task before

<!-- Should we generate a JSON-LD structure? 0=no, 1=yes -->
<xsl:param name="generate.json-ld" select="0"/>
<!-- Should the individual authors be used? 0=no, 1=yes -->
<xsl:param name="json-ld-use-individual-authors" select="1"/>
<xsl:param name="json-ld-fallback-author-name">SUSE documentation team</xsl:param>
<xsl:param name="json-ld-fallback-author-url">https://documentation.suse.com</xsl:param>
<xsl:param name="json-ld-fallback-author-type">Corporation</xsl:param>
Expand Down

0 comments on commit 83f1c59

Please sign in to comment.