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 8, 2024
1 parent f4eb3c4 commit 1c491f9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 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>
4 changes: 1 addition & 3 deletions sbp/xhtml/titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@
</xsl:template>

<xsl:template match="d:info/d:abstract" mode="article.titlepage.recto.auto.mode">
<xsl:message>d:info/d:abstract</xsl:message>
<div class="abstract">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode"/>
</div>
</xsl:template>
<xsl:template match="d:info/d:abstract/d:title" mode="article.titlepage.recto.auto.mode">
<xsl:message>d:info/d:abstract/d:title</xsl:message>
<div class="title">
<xsl:apply-templates/>
</div>
Expand Down Expand Up @@ -281,4 +279,4 @@
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:copyright"/>
</xsl:template>

</xsl:stylesheet>
</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 @@ -856,7 +856,6 @@
</xsl:choose>
</xsl:template>


<xsl:template name="json-ld-publisher">
"sameAs": [
"https://www.facebook.com/SUSEWorldwide/about",
Expand Down Expand Up @@ -910,12 +909,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 1c491f9

Please sign in to comment.