From 79ead1da1120f6e17fbb162aebce121889ec8f39 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 27 Mar 2024 08:37:04 +0100 Subject: [PATCH 1/2] Metadata: Make checking for content more stable * Check for $content != '' instead of just $content * datePublished checks now ancestor nodes too to avoid distracting warning message * categories for DC Dublin Core --- suse2022-ns/xhtml/json-ld.xsl | 28 ++++++++++++++++++++++++++++ suse2022-ns/xhtml/meta.xsl | 12 +++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/suse2022-ns/xhtml/json-ld.xsl b/suse2022-ns/xhtml/json-ld.xsl index aa9a90c2..33bef1c1 100644 --- a/suse2022-ns/xhtml/json-ld.xsl +++ b/suse2022-ns/xhtml/json-ld.xsl @@ -584,6 +584,13 @@ + + + + + + + @@ -858,6 +865,27 @@ + + + + + error + JSON-LD + + Could not create WebPage type for DC file + + + + + - + @@ -45,7 +45,7 @@ - + @@ -63,11 +63,13 @@ - + - - + + + + From a6a93dbce4c37b0e758ed246d71705aca177c0a6 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 27 Mar 2024 13:20:25 +0100 Subject: [PATCH 2/2] Fix JSON-LD generation for single & chunked HTML * Create "handle-json-ld" named template that handles both single and chunked HTML * Introduce xsl:choose inside json-ld-headline to handle the different cases better --- suse2022-ns/xhtml/chunk.xsl | 19 +------------ suse2022-ns/xhtml/docbook.xsl | 47 +++++++++++++++++++------------- suse2022-ns/xhtml/json-ld.xsl | 51 ++++++++++++++++++++++++++++------- 3 files changed, 72 insertions(+), 45 deletions(-) diff --git a/suse2022-ns/xhtml/chunk.xsl b/suse2022-ns/xhtml/chunk.xsl index df13cfa8..3857ef2d 100644 --- a/suse2022-ns/xhtml/chunk.xsl +++ b/suse2022-ns/xhtml/chunk.xsl @@ -42,23 +42,6 @@ - - - - - - - - - WARN - - JSON-LD - - - The parameter $dcfilename is unset. Cannot create the external JSON file. - - - - + diff --git a/suse2022-ns/xhtml/docbook.xsl b/suse2022-ns/xhtml/docbook.xsl index 35bad1ce..65ecb895 100644 --- a/suse2022-ns/xhtml/docbook.xsl +++ b/suse2022-ns/xhtml/docbook.xsl @@ -700,29 +700,40 @@ + + + + + + + + + + + + + + + + + WARN + + JSON-LD + + + The parameter $dcfilename is unset. Cannot create the external JSON file. + + + + + + - - - - - - - - - WARN - - JSON-LD - - - The parameter $dcfilename is unset. Cannot create the external JSON file. - - - - + diff --git a/suse2022-ns/xhtml/json-ld.xsl b/suse2022-ns/xhtml/json-ld.xsl index 33bef1c1..2e6520ac 100644 --- a/suse2022-ns/xhtml/json-ld.xsl +++ b/suse2022-ns/xhtml/json-ld.xsl @@ -208,6 +208,7 @@ + @@ -236,7 +237,7 @@ - + @@ -361,8 +362,27 @@ - + + + + + + + + + + + + + + + + + "headline": "", @@ -762,25 +782,38 @@ - - "about": [ + + + + + + "about": [ + + + + , + + + ], - - - { + + + { "@type": "Thing", "name": "" - }, + } + , +