Skip to content

Commit

Permalink
DOCTEAM-1368: SBP series are take from a parameter
Browse files Browse the repository at this point in the history
* Introduce a new parameter json-ld-seriesname (default empty)
* In the regular SUSE stylesheets, it's empty.
* For the SBP stylesheets, this parameter is set
  • Loading branch information
tomschr committed May 13, 2024
1 parent 3699d03 commit 1926cfb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions sbp/xhtml/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@

<xsl:include href="../VERSION.xsl"/>
<xsl:include href="titlepage.templates.xsl"/>
<xsl:include href="param.xsl"/>

</xsl:stylesheet>
10 changes: 10 additions & 0 deletions sbp/xhtml/param.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Specific parameters for the SBP stylesheets
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="json-ld-seriesname">SUSE Best Practices</xsl:param>

</xsl:stylesheet>
8 changes: 3 additions & 5 deletions suse2022-ns/xhtml/json-ld.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,6 @@
</xsl:choose>
</xsl:template>


<xsl:template name="json-ld-publisher">
"sameAs": [
"https://www.facebook.com/SUSEWorldwide/about",
Expand Down Expand Up @@ -913,12 +912,11 @@
<!-- The following templates access the Docserv config -->
<xsl:template name="json-ld-series">
<xsl:param name="node" select="."/>
<xsl:variable name="meta-series" select="$node/d:info/d:meta[@name='series']"/>

<xsl:if test="$meta-series != ''">
"isPartOf": {
<xsl:if test="$json-ld-seriesname != ''">
"isPartOf": {
"@type": "CreativeWorkSeries",
"name": "<xsl:value-of select="normalize-space($meta-series)"/>"
"name": "<xsl:value-of select="normalize-space($json-ld-seriesname)"/>"
},
</xsl:if>
</xsl:template>
Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/xhtml/param.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ task before
>https://www.suse.com/assets/img/suse-white-logo-green.svg</xsl:param>
<!-- The logo -->
<xsl:param name="json-ld-image-url" select="$json-ld-fallback-author-logo" />
<!-- By default, these are empty and are set by the SBP stylesheets -->
<xsl:param name="json-ld-seriesname"/>
<xsl:param name="json-ld-seriesnameshort"/>


<!-- The DC file needs to be passed to find the structure in the Docserv config -->
<xsl:param name="dcfilename"/>
Expand Down

0 comments on commit 1926cfb

Please sign in to comment.