From dce92228ca47eb87f751494eddf38f682a32dbe1 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Thu, 27 Jul 2023 17:02:33 +0200 Subject: [PATCH] Improve JSON-LD metadata (part 1) * JSON-LD: Rewrite author + authorgroup code * Simplify code and create a two set approach * If no (author/editor/corpauthor/contributor)s or authorgroup is found, fallback to a default corporation author * Add new parameters: - json-ld-fallback-author: The author's name - json-ld-fallback-author-url: the author's URL - json-ld-fallback-author-type: "Corporation" by default (but can also be a "Person") - json-ld-fallback-author-logo: the URL pointing to the logo * Correct metadata * Rename abstract -> description and refactor code * Introduce "sameAs" property * Disable json-ld-version and json-ld-keywords * Use "Corporation" instead of "Organization" for default author and publisher --- suse2022-ns/xhtml/json-ld.xsl | 203 ++++++++++++++++++++++------------ suse2022-ns/xhtml/param.xsl | 5 + 2 files changed, 139 insertions(+), 69 deletions(-) diff --git a/suse2022-ns/xhtml/json-ld.xsl b/suse2022-ns/xhtml/json-ld.xsl index 748b714a..6890b947 100644 --- a/suse2022-ns/xhtml/json-ld.xsl +++ b/suse2022-ns/xhtml/json-ld.xsl @@ -19,7 +19,6 @@ "@type": "TechArticle", "name": "Getting Started with ExampleApp", "headline": "ExampleApp Documentation", - "abstract": "A short abstract of ExampleApp", "description": "A comprehensive guide to get started with ExampleApp.", "author": { "@type": "Person", @@ -28,6 +27,12 @@ }, "datePublished": "2023-07-24", "dateModified": "2023-07-25", + "sameAs": [ + "https://www.facebook.com/SUSEWorldwide/about", + "https://www.youtube.com/channel/UCHTfqIzPKz4f_dri36lAQGA", + "https://twitter.com/SUSE", + "https://www.linkedin.com/company/suse" + ], "publisher": { "@type": "Organization", "name": "SUSE", @@ -50,20 +55,6 @@ xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="date exsl d"> - - - - - - - - - - - , - - - @@ -75,13 +66,14 @@ --> - - - - + + + + + - + } @@ -95,33 +87,42 @@ "headline": "", - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - "abstract": "", + + "description": "", - @@ -138,14 +139,72 @@ - + + + + + + + + + + + + + + + + + + + + + - - + + INFO: found one author - + "author": { @@ -154,30 +213,29 @@ "role": "Writer" }, - - - - - - - - - - - + + "author": [ + + ], + + + - + - - "author": [ - ], - + "author": { + "@type": "", + "name": "", + "url": "", + + "logo": "" + }, @@ -234,10 +292,10 @@ - + - + @@ -292,9 +350,16 @@ + "sameAs": [ + "https://www.facebook.com/SUSEWorldwide/about", + "https://www.youtube.com/channel/UCHTfqIzPKz4f_dri36lAQGA", + "https://twitter.com/SUSE", + "https://www.linkedin.com/company/suse" + ], "publisher": { - "@type": "Organization", + "@type": "Corporation", "name": "SUSE", + "url": "https://documentation.suse.com", "logo": { "@type": "ImageObject", "url": "https://www.suse.com/assets/img/suse-white-logo-green.svg" diff --git a/suse2022-ns/xhtml/param.xsl b/suse2022-ns/xhtml/param.xsl index 5fb26121..91c6b4f9 100644 --- a/suse2022-ns/xhtml/param.xsl +++ b/suse2022-ns/xhtml/param.xsl @@ -460,6 +460,11 @@ task before + SUSE documentation team + https://documentation.suse.com + Corporation + https://www.suse.com/assets/img/suse-white-logo-green.svg + {{#language#}}