From 97f069322152dd237fe2b13ec62c9c53f938c6ee Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Fri, 20 Dec 2024 17:46:19 +1000 Subject: [PATCH 01/19] DOC-2608: Initial prototype - no posts yet --- antora-playbook-local.yml | 3 +++ rssfeed.cjs | 56 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 rssfeed.cjs diff --git a/antora-playbook-local.yml b/antora-playbook-local.yml index 3f6ce3c0fe..14c9240c6c 100644 --- a/antora-playbook-local.yml +++ b/antora-playbook-local.yml @@ -17,5 +17,8 @@ ui: asciidoc: extensions: - '@tinymce/antora-extension-livedemos' +antora: + extensions: + - './rssfeed.cjs' runtime: fetch: true diff --git a/rssfeed.cjs b/rssfeed.cjs new file mode 100644 index 0000000000..cfcbdf4856 --- /dev/null +++ b/rssfeed.cjs @@ -0,0 +1,56 @@ +"use strict"; + +module.exports.register = function () { + this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => { + const siteLink = playbook.site.url; + + // Find page + const page = contentCatalog.findBy({ + basename: "changelog.adoc", + })[0]; + + // Get page attributes + const attributes = page.asciidoc.attributes; + const { + productname: productName, + productmajorversion: productMajorVersion, + doctitle: pageTitle, + description: pageDescription, + docname: pageName, + } = attributes; + + // Get page content + const content = page.contents.toString(); + + console.log("Attributes:", attributes); + console.log("Content:", content); + + // Create RSS feed + const rss = ` + + + + ${productName} ${productMajorVersion} ${pageTitle} + ${siteLink}/${pageName} + ${pageDescription} + + RSS Tutorial + https://www.w3schools.com/xml/xml_rss.asp + New RSS tutorial on W3Schools + + + XML Tutorial + https://www.w3schools.com/xml + New XML tutorial on W3Schools + + + +`; + + // Add RSS feed to site catalog + siteCatalog.addFile({ + contents: Buffer.from(rss), + out: { path: "rss.xml" }, + }); + }); +}; From 867d1129812dfe13c419eb2d7fbf926808e09e25 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Fri, 20 Dec 2024 17:50:00 +1000 Subject: [PATCH 02/19] DOC-2608: Add extension to antora-playbook.yml --- antora-playbook.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/antora-playbook.yml b/antora-playbook.yml index c5fc872959..b42edf1e8c 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -19,5 +19,8 @@ ui: asciidoc: extensions: - '@tinymce/antora-extension-livedemos' +antora: + extensions: + - './rssfeed.cjs' runtime: fetch: true From a26c44cb0eb9b056e251c17b1024c41d2eba67ef Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 01:06:59 +1000 Subject: [PATCH 03/19] DOC-2608: Populate RSS with changelog.adoc content --- package.json | 1 + rssfeed.cjs | 91 +++++++++++++++++++---------- yarn.lock | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 222 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 9a24a18b76..0f6474e17f 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@antora/site-generator-default": "^3.0.1", "@tinymce/antora-extension-livedemos": "^0.1.0", "@tinymce/moxiedoc": "^0.3.0", + "cheerio": "^1.0.0", "dotenv": "^16.0.0", "ecstatic": "^4.1.4", "http-server": "^0.12.3", diff --git a/rssfeed.cjs b/rssfeed.cjs index cfcbdf4856..afeadd9826 100644 --- a/rssfeed.cjs +++ b/rssfeed.cjs @@ -1,50 +1,79 @@ "use strict"; +const cheerio = require("cheerio"); + module.exports.register = function () { this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => { - const siteLink = playbook.site.url; + // Find the changelog page + const page = contentCatalog.findBy({ basename: "changelog.adoc" })[0]; - // Find page - const page = contentCatalog.findBy({ - basename: "changelog.adoc", - })[0]; + if (!page) { + console.error("changelog.adoc page not found."); + return; + } - // Get page attributes - const attributes = page.asciidoc.attributes; + // Destructure page attributes const { productname: productName, productmajorversion: productMajorVersion, doctitle: pageTitle, description: pageDescription, docname: pageName, - } = attributes; + "page-component-name": pageComponentName, + "page-component-version": pageComponentVersion, + } = page.asciidoc.attributes; + + // Construct site links + const siteLink = playbook.site.url; + const siteLinkWithVersion = `${siteLink}/${pageComponentName}/${pageComponentVersion}`; - // Get page content - const content = page.contents.toString(); + // Load page content with cheerio + const $ = cheerio.load(page.contents.toString()); - console.log("Attributes:", attributes); - console.log("Content:", content); + // Extract releases + const releases = $(".sect1") + .map((_, element) => { + const $element = $(element); + const linkElement = $element.find("a.xref"); + const [version, date] = linkElement.text().split(" - "); + return { + title: linkElement.text(), + link: `${siteLinkWithVersion}/${linkElement + .attr("href") + .replace("../", "")}`, + description: `Release notes for TinyMCE ${version}`, + guid: version, + pubDate: new Date(date).toUTCString(), + content: $element.find(".sectionbody").html(), + }; + }) + .get(); - // Create RSS feed - const rss = ` - - - - ${productName} ${productMajorVersion} ${pageTitle} - ${siteLink}/${pageName} - ${pageDescription} - - RSS Tutorial - https://www.w3schools.com/xml/xml_rss.asp - New RSS tutorial on W3Schools - - - XML Tutorial - https://www.w3schools.com/xml - New XML tutorial on W3Schools - - + // Generate RSS feed items + const rssItems = releases + .map( + ({ title, link, description, guid, pubDate, content }) => ` + + ${title} + ${link} + ${description} + ${guid} + ${pubDate} + + ` + ) + .join("\n"); + // Assemble the complete RSS feed + const rss = ` + + + ${productName} ${productMajorVersion} ${pageTitle} + ${siteLinkWithVersion}/${pageName} + ${pageDescription} + + ${rssItems} + `; // Add RSS feed to site catalog diff --git a/yarn.lock b/yarn.lock index 847402296c..526ad33ef2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -330,6 +330,11 @@ binary-extensions@^2.0.0: resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +boolbase@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== + boxen@^5.0.0: version "5.1.2" resolved "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz" @@ -439,6 +444,35 @@ charset@^1.0.1: resolved "https://registry.npmjs.org/charset/-/charset-1.0.1.tgz" integrity sha512-6dVyOOYjpfFcL1Y4qChrAoQLRHvj2ziyhcm0QJlhOcAhykL/k1kTUPbeo+87MNRTRdk2OIIsIXbuF3x2wi5EXg== +cheerio-select@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" + integrity sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g== + dependencies: + boolbase "^1.0.0" + css-select "^5.1.0" + css-what "^6.1.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.0.1" + +cheerio@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0.tgz#1ede4895a82f26e8af71009f961a9b8cb60d6a81" + integrity sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww== + dependencies: + cheerio-select "^2.1.0" + dom-serializer "^2.0.0" + domhandler "^5.0.3" + domutils "^3.1.0" + encoding-sniffer "^0.2.0" + htmlparser2 "^9.1.0" + parse5 "^7.1.2" + parse5-htmlparser2-tree-adapter "^7.0.0" + parse5-parser-stream "^7.1.2" + undici "^6.19.5" + whatwg-mimetype "^4.0.0" + chokidar@^3.5.2: version "3.5.2" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" @@ -621,6 +655,22 @@ crypto-random-string@^2.0.0: resolved "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +css-select@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.1.0.tgz#b8ebd6554c3637ccc76688804ad3f6a6fdaea8a6" + integrity sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + +css-what@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" + integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== + d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -684,6 +734,36 @@ diff3@0.0.3: resolved "https://registry.yarnpkg.com/diff3/-/diff3-0.0.3.tgz#d4e5c3a4cdf4e5fe1211ab42e693fcb4321580fc" integrity sha1-1OXDpM305f4SEatC5pP8tDIVgPw= +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + +domelementtype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" + integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== + +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + +domutils@^3.0.1, domutils@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.1.0.tgz#c47f551278d3dc4b0b1ab8cbb42d751a6f0d824e" + integrity sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + dot-prop@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" @@ -753,6 +833,14 @@ emoji-regex@^8.0.0: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +encoding-sniffer@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz#799569d66d443babe82af18c9f403498365ef1d5" + integrity sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg== + dependencies: + iconv-lite "^0.6.3" + whatwg-encoding "^3.1.1" + end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" @@ -760,6 +848,11 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" +entities@^4.2.0, entities@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" @@ -1185,6 +1278,16 @@ hpagent@~0.1.0: resolved "https://registry.yarnpkg.com/hpagent/-/hpagent-0.1.2.tgz#cab39c66d4df2d4377dbd212295d878deb9bdaa9" integrity sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ== +htmlparser2@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-9.1.0.tgz#cdb498d8a75a51f739b61d3f718136c369bc8c23" + integrity sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.3" + domutils "^3.1.0" + entities "^4.5.0" + http-cache-semantics@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" @@ -1215,6 +1318,13 @@ http-server@^0.12.3: secure-compare "3.0.1" union "~0.5.0" +iconv-lite@0.6.3, iconv-lite@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + ignore-by-default@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz" @@ -1829,6 +1939,13 @@ npm-run-all@^4.1.5: shell-quote "^1.6.1" string.prototype.padend "^3.0.0" +nth-check@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.1.1.tgz#c9eab428effce36cd6b92c924bdb000ef1f1ed1d" + integrity sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w== + dependencies: + boolbase "^1.0.0" + object-inspect@^1.11.0: version "1.12.0" resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz" @@ -1913,6 +2030,28 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse5-htmlparser2-tree-adapter@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz#b5a806548ed893a43e24ccb42fbb78069311e81b" + integrity sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g== + dependencies: + domhandler "^5.0.3" + parse5 "^7.0.0" + +parse5-parser-stream@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz#d7c20eadc37968d272e2c02660fff92dd27e60e1" + integrity sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow== + dependencies: + parse5 "^7.0.0" + +parse5@^7.0.0, parse5@^7.1.2: + version "7.2.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== + dependencies: + entities "^4.5.0" + path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -2263,6 +2402,11 @@ safe-stable-stringify@^2.1.0: resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz#ab67cbe1fe7d40603ca641c5e765cb942d04fc73" integrity sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg== +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + secure-compare@3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz" @@ -2635,6 +2779,11 @@ undefsafe@^2.0.5: resolved "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz" integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== +undici@^6.19.5: + version "6.21.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.21.0.tgz#4b3d3afaef984e07b48e7620c34ed8a285ed4cd4" + integrity sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw== + union@~0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/union/-/union-0.5.0.tgz" @@ -2765,6 +2914,18 @@ vinyl@^2.0.0, vinyl@^2.0.2, vinyl@~2.2: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" +whatwg-encoding@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz#d0f4ef769905d426e1688f3e34381a99b60b76e5" + integrity sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ== + dependencies: + iconv-lite "0.6.3" + +whatwg-mimetype@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz#bc1bf94a985dc50388d54a9258ac405c3ca2fc0a" + integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg== + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz" From c4a2a780c9d8938713329f4847cee5b694bf4280 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 01:18:38 +1000 Subject: [PATCH 04/19] DOC-2608: Attempt to fix
  • tag rendering issue --- rssfeed.cjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rssfeed.cjs b/rssfeed.cjs index afeadd9826..c75fbe84c5 100644 --- a/rssfeed.cjs +++ b/rssfeed.cjs @@ -36,6 +36,14 @@ module.exports.register = function () { const $element = $(element); const linkElement = $element.find("a.xref"); const [version, date] = linkElement.text().split(" - "); + + // Remove

    tags inside

  • tags to fix rendering issues + const contentElement = $element.find(".sectionbody"); + contentElement.find("li > p").each((_, pElem) => { + $(pElem).replaceWith($(pElem).html()); + }); + const content = contentElement.html(); + return { title: linkElement.text(), link: `${siteLinkWithVersion}/${linkElement @@ -44,7 +52,7 @@ module.exports.register = function () { description: `Release notes for TinyMCE ${version}`, guid: version, pubDate: new Date(date).toUTCString(), - content: $element.find(".sectionbody").html(), + content, }; }) .get(); From 68e654b99d47dae91917392502923c3c04d26517 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 01:33:39 +1000 Subject: [PATCH 05/19] DOC-2608: Add purl.org's content module for encoded content --- rssfeed.cjs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rssfeed.cjs b/rssfeed.cjs index c75fbe84c5..509fc4551b 100644 --- a/rssfeed.cjs +++ b/rssfeed.cjs @@ -74,15 +74,19 @@ module.exports.register = function () { // Assemble the complete RSS feed const rss = ` - - + + ${productName} ${productMajorVersion} ${pageTitle} ${siteLinkWithVersion}/${pageName} ${pageDescription} + en ${rssItems} - -`; + + `; // Add RSS feed to site catalog siteCatalog.addFile({ From 629e422a3f8cf83af73b37e3efc1f2497f97051d Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 12:32:35 +1000 Subject: [PATCH 06/19] DOC-2608: Move rssfeed.cjs to lib folder and add error handling to prevent build from failing --- antora-playbook-local.yml | 2 +- antora-playbook.yml | 2 +- lib/rssfeed.cjs | 102 ++++++++++++++++++++++++++++++++++++++ rssfeed.cjs | 97 ------------------------------------ 4 files changed, 104 insertions(+), 99 deletions(-) create mode 100644 lib/rssfeed.cjs delete mode 100644 rssfeed.cjs diff --git a/antora-playbook-local.yml b/antora-playbook-local.yml index 14c9240c6c..d116f3e063 100644 --- a/antora-playbook-local.yml +++ b/antora-playbook-local.yml @@ -19,6 +19,6 @@ asciidoc: - '@tinymce/antora-extension-livedemos' antora: extensions: - - './rssfeed.cjs' + - './lib/rssfeed.cjs' runtime: fetch: true diff --git a/antora-playbook.yml b/antora-playbook.yml index b42edf1e8c..83132e2e90 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -21,6 +21,6 @@ asciidoc: - '@tinymce/antora-extension-livedemos' antora: extensions: - - './rssfeed.cjs' + - './lib/rssfeed.cjs' runtime: fetch: true diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs new file mode 100644 index 0000000000..734b805c83 --- /dev/null +++ b/lib/rssfeed.cjs @@ -0,0 +1,102 @@ +"use strict"; + +const cheerio = require("cheerio"); + +module.exports.register = function () { + this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => { + try { + // Find the changelog page + const page = contentCatalog.findBy({ basename: "changelog.adoc" })[0]; + + if (!page) { + console.error("changelog.adoc page not found."); + return; + } + + // Destructure page attributes + const { + productname: productName, + productmajorversion: productMajorVersion, + doctitle: pageTitle, + description: pageDescription, + docname: pageName, + "page-component-name": pageComponentName, + "page-component-version": pageComponentVersion, + } = page.asciidoc.attributes; + + // Construct site links + const siteLink = playbook.site.url; + const siteLinkWithVersion = `${siteLink}/${pageComponentName}/${pageComponentVersion}`; + + // Load page content with cheerio + const $ = cheerio.load(page.contents.toString()); + + // Extract releases + const releases = $(".sect1") + .map((_, element) => { + const $element = $(element); + const linkElement = $element.find("a.xref"); + const [version, date] = linkElement.text().split(" - "); + + // Remove

    tags inside

  • tags to fix rendering issues + const contentElement = $element.find(".sectionbody"); + contentElement.find("li > p").each((_, pElem) => { + $(pElem).replaceWith($(pElem).html()); + }); + const content = contentElement.html(); + + return { + title: linkElement.text(), + link: `${siteLinkWithVersion}/${linkElement + .attr("href") + .replace("../", "")}`, + description: `Release notes for TinyMCE ${version}`, + guid: version, + pubDate: new Date(date).toUTCString(), + content, + }; + }) + .get(); + + // Generate RSS feed items + const rssItems = releases + .map( + ({ title, link, description, guid, pubDate, content }) => ` + + ${title} + ${link} + ${description} + ${guid} + ${pubDate} + + ` + ) + .join("\n"); + + // Assemble the complete RSS feed + const rss = ` + + + ${productName} ${productMajorVersion} ${pageTitle} + ${siteLinkWithVersion}/${pageName} + ${pageDescription} + en + + ${rssItems} + + `; + + // Add RSS feed to site catalog + siteCatalog.addFile({ + contents: Buffer.from(rss), + out: { path: "rss.xml" }, + }); + } catch (error) { + // Catch any errors to allow the build to continue + console.error("Error generating RSS feed:", error); + } + }); +}; diff --git a/rssfeed.cjs b/rssfeed.cjs deleted file mode 100644 index 509fc4551b..0000000000 --- a/rssfeed.cjs +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; - -const cheerio = require("cheerio"); - -module.exports.register = function () { - this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => { - // Find the changelog page - const page = contentCatalog.findBy({ basename: "changelog.adoc" })[0]; - - if (!page) { - console.error("changelog.adoc page not found."); - return; - } - - // Destructure page attributes - const { - productname: productName, - productmajorversion: productMajorVersion, - doctitle: pageTitle, - description: pageDescription, - docname: pageName, - "page-component-name": pageComponentName, - "page-component-version": pageComponentVersion, - } = page.asciidoc.attributes; - - // Construct site links - const siteLink = playbook.site.url; - const siteLinkWithVersion = `${siteLink}/${pageComponentName}/${pageComponentVersion}`; - - // Load page content with cheerio - const $ = cheerio.load(page.contents.toString()); - - // Extract releases - const releases = $(".sect1") - .map((_, element) => { - const $element = $(element); - const linkElement = $element.find("a.xref"); - const [version, date] = linkElement.text().split(" - "); - - // Remove

    tags inside

  • tags to fix rendering issues - const contentElement = $element.find(".sectionbody"); - contentElement.find("li > p").each((_, pElem) => { - $(pElem).replaceWith($(pElem).html()); - }); - const content = contentElement.html(); - - return { - title: linkElement.text(), - link: `${siteLinkWithVersion}/${linkElement - .attr("href") - .replace("../", "")}`, - description: `Release notes for TinyMCE ${version}`, - guid: version, - pubDate: new Date(date).toUTCString(), - content, - }; - }) - .get(); - - // Generate RSS feed items - const rssItems = releases - .map( - ({ title, link, description, guid, pubDate, content }) => ` - - ${title} - ${link} - ${description} - ${guid} - ${pubDate} - - ` - ) - .join("\n"); - - // Assemble the complete RSS feed - const rss = ` - - - ${productName} ${productMajorVersion} ${pageTitle} - ${siteLinkWithVersion}/${pageName} - ${pageDescription} - en - - ${rssItems} - - `; - - // Add RSS feed to site catalog - siteCatalog.addFile({ - contents: Buffer.from(rss), - out: { path: "rss.xml" }, - }); - }); -}; From f99263dd5260996a30855ae8503058be21b1f22f Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 12:34:18 +1000 Subject: [PATCH 07/19] DOC-2608: Fix error in item description --- lib/rssfeed.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs index 734b805c83..442f7ea9de 100644 --- a/lib/rssfeed.cjs +++ b/lib/rssfeed.cjs @@ -50,7 +50,7 @@ module.exports.register = function () { link: `${siteLinkWithVersion}/${linkElement .attr("href") .replace("../", "")}`, - description: `Release notes for TinyMCE ${version}`, + description: `Changelog for TinyMCE ${version}`, guid: version, pubDate: new Date(date).toUTCString(), content, From 3c275a7de76b60a4609b7fe847b71511d1d41286 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 12:45:20 +1000 Subject: [PATCH 08/19] DOC-2608: Move input and output file names into Antora playbook config --- antora-playbook-local.yml | 4 +++- antora-playbook.yml | 4 +++- lib/rssfeed.cjs | 12 +++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/antora-playbook-local.yml b/antora-playbook-local.yml index d116f3e063..72f5d6fa3f 100644 --- a/antora-playbook-local.yml +++ b/antora-playbook-local.yml @@ -19,6 +19,8 @@ asciidoc: - '@tinymce/antora-extension-livedemos' antora: extensions: - - './lib/rssfeed.cjs' + - require: './lib/rssfeed.cjs' + input_file: 'changelog.adoc' + output_file: 'rss.xml' runtime: fetch: true diff --git a/antora-playbook.yml b/antora-playbook.yml index 83132e2e90..4e9212b87c 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -21,6 +21,8 @@ asciidoc: - '@tinymce/antora-extension-livedemos' antora: extensions: - - './lib/rssfeed.cjs' + - require: './lib/rssfeed.cjs' + input_file: 'changelog.adoc' + output_file: 'rss.xml' runtime: fetch: true diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs index 442f7ea9de..c8c4f48488 100644 --- a/lib/rssfeed.cjs +++ b/lib/rssfeed.cjs @@ -2,15 +2,16 @@ const cheerio = require("cheerio"); -module.exports.register = function () { +module.exports.register = function ({ config }) { this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => { try { // Find the changelog page - const page = contentCatalog.findBy({ basename: "changelog.adoc" })[0]; + const page = contentCatalog.findBy({ + basename: config.inputFile, + })[0]; if (!page) { - console.error("changelog.adoc page not found."); - return; + throw new Error(`${config.inputFile} page not found.`); } // Destructure page attributes @@ -92,8 +93,9 @@ module.exports.register = function () { // Add RSS feed to site catalog siteCatalog.addFile({ contents: Buffer.from(rss), - out: { path: "rss.xml" }, + out: { path: config.outputFile }, }); + console.log(`RSS feed generated at ${config.outputFile}`); } catch (error) { // Catch any errors to allow the build to continue console.error("Error generating RSS feed:", error); From 32e5a8d3d897e58881753409669ac564aded9f88 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 12:50:15 +1000 Subject: [PATCH 09/19] DOC-2608: Normalize version if it's missing the minor or patch version --- lib/rssfeed.cjs | 52 ++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs index c8c4f48488..8e5597decb 100644 --- a/lib/rssfeed.cjs +++ b/lib/rssfeed.cjs @@ -37,7 +37,15 @@ module.exports.register = function ({ config }) { .map((_, element) => { const $element = $(element); const linkElement = $element.find("a.xref"); - const [version, date] = linkElement.text().split(" - "); + let [version, date] = linkElement.text().split(" - "); + + // Normalize version if it's missing the minor or patch version + const versionParts = version.split("."); + if (versionParts.length === 1) { + version += ".0.0"; + } else if (versionParts.length === 2) { + version += ".0"; + } // Remove

    tags inside

  • tags to fix rendering issues const contentElement = $element.find(".sectionbody"); @@ -63,32 +71,32 @@ module.exports.register = function ({ config }) { const rssItems = releases .map( ({ title, link, description, guid, pubDate, content }) => ` - - ${title} - ${link} - ${description} - ${guid} - ${pubDate} - - ` + + ${title} + ${link} + ${description} + ${guid} + ${pubDate} + + ` ) .join("\n"); // Assemble the complete RSS feed const rss = ` - - - ${productName} ${productMajorVersion} ${pageTitle} - ${siteLinkWithVersion}/${pageName} - ${pageDescription} - en - - ${rssItems} - - `; + + + ${productName} ${productMajorVersion} ${pageTitle} + ${siteLinkWithVersion}/${pageName} + ${pageDescription} + en + + ${rssItems} + + `; // Add RSS feed to site catalog siteCatalog.addFile({ From 7b1599a7dd31e33e8bf098de34a8f7b503c35b19 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Sat, 21 Dec 2024 12:57:16 +1000 Subject: [PATCH 10/19] DOC-2608: Add copyright info to RSS --- lib/rssfeed.cjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs index 8e5597decb..a7e9ae3be7 100644 --- a/lib/rssfeed.cjs +++ b/lib/rssfeed.cjs @@ -83,7 +83,7 @@ module.exports.register = function ({ config }) { .join("\n"); // Assemble the complete RSS feed - const rss = ` + const rss = ` ${siteLinkWithVersion}/${pageName} ${pageDescription} en + Creative Commons Legal Code - Attribution-NonCommercial-ShareAlike 3.0 Unported ${rssItems} From 9c884538ca6d08f7ea4610c3a365dc28a198502d Mon Sep 17 00:00:00 2001 From: Farzad Hayat Date: Mon, 23 Dec 2024 10:46:24 +1000 Subject: [PATCH 11/19] Fix code scanning alert no. 35: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- lib/rssfeed.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs index a7e9ae3be7..20209de6f0 100644 --- a/lib/rssfeed.cjs +++ b/lib/rssfeed.cjs @@ -58,7 +58,7 @@ module.exports.register = function ({ config }) { title: linkElement.text(), link: `${siteLinkWithVersion}/${linkElement .attr("href") - .replace("../", "")}`, + .replace(/\.\.\//g, "")}`, description: `Changelog for TinyMCE ${version}`, guid: version, pubDate: new Date(date).toUTCString(), From 088e542c11b7b0d0b63a37e60071535cd2ed7670 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Wed, 25 Dec 2024 10:16:49 +1000 Subject: [PATCH 12/19] DOC-2608: Time the RSS feed generation and log it --- lib/rssfeed.cjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/rssfeed.cjs b/lib/rssfeed.cjs index 20209de6f0..2bed237f35 100644 --- a/lib/rssfeed.cjs +++ b/lib/rssfeed.cjs @@ -4,6 +4,8 @@ const cheerio = require("cheerio"); module.exports.register = function ({ config }) { this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => { + const startTime = Date.now(); // Start the timer + try { // Find the changelog page const page = contentCatalog.findBy({ @@ -104,7 +106,12 @@ module.exports.register = function ({ config }) { contents: Buffer.from(rss), out: { path: config.outputFile }, }); - console.log(`RSS feed generated at ${config.outputFile}`); + + const endTime = Date.now(); // End the timer + const duration = endTime - startTime; // Calculate the duration + console.log( + `RSS feed generated at ${config.outputFile} in ${duration}ms` + ); } catch (error) { // Catch any errors to allow the build to continue console.error("Error generating RSS feed:", error); From daadb63251da5a00db8757a1d761394976f231fd Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Thu, 2 Jan 2025 09:53:49 +1000 Subject: [PATCH 13/19] DOC-2608: Rename 'lib' folder to 'extensions' --- antora-playbook-local.yml | 2 +- antora-playbook.yml | 2 +- {lib => extensions}/rssfeed.cjs | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {lib => extensions}/rssfeed.cjs (100%) diff --git a/antora-playbook-local.yml b/antora-playbook-local.yml index 72f5d6fa3f..b683a22556 100644 --- a/antora-playbook-local.yml +++ b/antora-playbook-local.yml @@ -19,7 +19,7 @@ asciidoc: - '@tinymce/antora-extension-livedemos' antora: extensions: - - require: './lib/rssfeed.cjs' + - require: './extensions/rssfeed.cjs' input_file: 'changelog.adoc' output_file: 'rss.xml' runtime: diff --git a/antora-playbook.yml b/antora-playbook.yml index 4e9212b87c..4e6b70065b 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -21,7 +21,7 @@ asciidoc: - '@tinymce/antora-extension-livedemos' antora: extensions: - - require: './lib/rssfeed.cjs' + - require: './extensions/rssfeed.cjs' input_file: 'changelog.adoc' output_file: 'rss.xml' runtime: diff --git a/lib/rssfeed.cjs b/extensions/rssfeed.cjs similarity index 100% rename from lib/rssfeed.cjs rename to extensions/rssfeed.cjs From 6d8218b4cfc92e073d6a72938c1c6c8a66bfb071 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Thu, 2 Jan 2025 10:07:19 +1000 Subject: [PATCH 14/19] DOC-2608: Add link to RSS feed in changelog page --- modules/ROOT/pages/changelog.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ROOT/pages/changelog.adoc b/modules/ROOT/pages/changelog.adoc index f634eb7061..77467f974b 100644 --- a/modules/ROOT/pages/changelog.adoc +++ b/modules/ROOT/pages/changelog.adoc @@ -4,6 +4,8 @@ NOTE: This is the {productname} Community version changelog. For information about the latest {cloudname} or {enterpriseversion} Release, see: xref:release-notes.adoc[{productname} Release Notes]. +TIP: For an RSS feed of the {productname} Changelog, use the following URL: https://www.tiny.cloud/docs/rss.xml + == xref:7.6.0-release-notes.adoc[7.6.0 - 2024-12-11] === Added From b8cb65dd83d350bac8e10ccbded8e16cef88e2c3 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Thu, 2 Jan 2025 10:09:53 +1000 Subject: [PATCH 15/19] DOC-2608: Make changelog RSS url into an Antora attribute --- antora.yml | 1 + modules/ROOT/pages/changelog.adoc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/antora.yml b/antora.yml index 23beb449cb..a01a38979b 100644 --- a/antora.yml +++ b/antora.yml @@ -17,6 +17,7 @@ asciidoc: openai_proxy_url: https://openai.ai-demo-proxy.tiny.cloud/v1/chat/completions openai_proxy_token: eyJhbGciOiJFUzM4NCJ9.eyJhdWQiOlsiaHR0cHM6Ly9vcGVuYWkuYWktZGVtby1wcm94eS50aW55LmNsb3VkLyJdLCJleHAiOjE3NTEzMjgwMDAsImh0dHBzOi8vb3BlbmFpLmFpLWRlbW8tcHJveHkudGlueS5jbG91ZC9yb2xlIjoicHVibGljLWRlbW8iLCJpc3MiOiJodHRwczovL2FpLWRlbW8tcHJveHkudGlueS5jbG91ZC8iLCJqdGkiOiJmOGFmY2EyNC1mN2FhLTQxMjktYTc2Yy02YThlZDU3YjAyZjYiLCJzdWIiOiJhaS1hc3Npc3RhbnQtZGVtbyJ9.Xu0apHCbxgmRQTeTqrTIDFFhh2CgKeARRXa3mCxSGoCwZqkoQaFRZBCzDo8Xz7DuUa5mW2XHl-HYcYiXJM9ly16d0oY7lJefHBeLlmJEBE1CSttHBkCRWZS8eFLCasL6 default_meta_keywords: tinymce, documentation, docs, plugins, customizable skins, configuration, examples, html, php, java, javascript, image editor, inline editor, distraction-free editor, classic editor, wysiwyg + changelog_rss_url: https://www.tiny.cloud/docs/rss.xml # product docker variables dockerimageimportfromwordexporttoword: registry.containers.tiny.cloud/docx-converter-tiny dockerimageexporttopdf: registry.containers.tiny.cloud/pdf-converter-tiny diff --git a/modules/ROOT/pages/changelog.adoc b/modules/ROOT/pages/changelog.adoc index 77467f974b..13f35168a2 100644 --- a/modules/ROOT/pages/changelog.adoc +++ b/modules/ROOT/pages/changelog.adoc @@ -4,7 +4,7 @@ NOTE: This is the {productname} Community version changelog. For information about the latest {cloudname} or {enterpriseversion} Release, see: xref:release-notes.adoc[{productname} Release Notes]. -TIP: For an RSS feed of the {productname} Changelog, use the following URL: https://www.tiny.cloud/docs/rss.xml +TIP: For an RSS feed of the {productname} Changelog, use the following URL: {changelog_rss_url} == xref:7.6.0-release-notes.adoc[7.6.0 - 2024-12-11] From 665381601e00a03863e32509f7d678673f51c3ef Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Thu, 2 Jan 2025 10:13:15 +1000 Subject: [PATCH 16/19] DOC-2608: Use {site-url} attribute instead of hard-coded RSS link --- antora.yml | 1 - modules/ROOT/pages/changelog.adoc | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/antora.yml b/antora.yml index a01a38979b..23beb449cb 100644 --- a/antora.yml +++ b/antora.yml @@ -17,7 +17,6 @@ asciidoc: openai_proxy_url: https://openai.ai-demo-proxy.tiny.cloud/v1/chat/completions openai_proxy_token: eyJhbGciOiJFUzM4NCJ9.eyJhdWQiOlsiaHR0cHM6Ly9vcGVuYWkuYWktZGVtby1wcm94eS50aW55LmNsb3VkLyJdLCJleHAiOjE3NTEzMjgwMDAsImh0dHBzOi8vb3BlbmFpLmFpLWRlbW8tcHJveHkudGlueS5jbG91ZC9yb2xlIjoicHVibGljLWRlbW8iLCJpc3MiOiJodHRwczovL2FpLWRlbW8tcHJveHkudGlueS5jbG91ZC8iLCJqdGkiOiJmOGFmY2EyNC1mN2FhLTQxMjktYTc2Yy02YThlZDU3YjAyZjYiLCJzdWIiOiJhaS1hc3Npc3RhbnQtZGVtbyJ9.Xu0apHCbxgmRQTeTqrTIDFFhh2CgKeARRXa3mCxSGoCwZqkoQaFRZBCzDo8Xz7DuUa5mW2XHl-HYcYiXJM9ly16d0oY7lJefHBeLlmJEBE1CSttHBkCRWZS8eFLCasL6 default_meta_keywords: tinymce, documentation, docs, plugins, customizable skins, configuration, examples, html, php, java, javascript, image editor, inline editor, distraction-free editor, classic editor, wysiwyg - changelog_rss_url: https://www.tiny.cloud/docs/rss.xml # product docker variables dockerimageimportfromwordexporttoword: registry.containers.tiny.cloud/docx-converter-tiny dockerimageexporttopdf: registry.containers.tiny.cloud/pdf-converter-tiny diff --git a/modules/ROOT/pages/changelog.adoc b/modules/ROOT/pages/changelog.adoc index 13f35168a2..b16f32d892 100644 --- a/modules/ROOT/pages/changelog.adoc +++ b/modules/ROOT/pages/changelog.adoc @@ -4,7 +4,7 @@ NOTE: This is the {productname} Community version changelog. For information about the latest {cloudname} or {enterpriseversion} Release, see: xref:release-notes.adoc[{productname} Release Notes]. -TIP: For an RSS feed of the {productname} Changelog, use the following URL: {changelog_rss_url} +TIP: For an RSS feed of the {productname} Changelog, use the following URL: {site-url}/rss.xml == xref:7.6.0-release-notes.adoc[7.6.0 - 2024-12-11] From c29fe345ab289b22b03196f0869ccd0eb3e9c087 Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Thu, 2 Jan 2025 10:34:06 +1000 Subject: [PATCH 17/19] DOC-2608: Generate RSS file in tinymce/latest folder --- extensions/rssfeed.cjs | 7 +++---- modules/ROOT/pages/changelog.adoc | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions/rssfeed.cjs b/extensions/rssfeed.cjs index 2bed237f35..21a3f5ba04 100644 --- a/extensions/rssfeed.cjs +++ b/extensions/rssfeed.cjs @@ -102,16 +102,15 @@ module.exports.register = function ({ config }) { `; // Add RSS feed to site catalog + const filePath = `${pageComponentName}/${pageComponentVersion}/${config.outputFile}`; siteCatalog.addFile({ contents: Buffer.from(rss), - out: { path: config.outputFile }, + out: { path: filePath }, }); const endTime = Date.now(); // End the timer const duration = endTime - startTime; // Calculate the duration - console.log( - `RSS feed generated at ${config.outputFile} in ${duration}ms` - ); + console.log(`RSS feed generated at ${filePath} in ${duration}ms`); } catch (error) { // Catch any errors to allow the build to continue console.error("Error generating RSS feed:", error); diff --git a/modules/ROOT/pages/changelog.adoc b/modules/ROOT/pages/changelog.adoc index b16f32d892..38ae934c63 100644 --- a/modules/ROOT/pages/changelog.adoc +++ b/modules/ROOT/pages/changelog.adoc @@ -4,7 +4,7 @@ NOTE: This is the {productname} Community version changelog. For information about the latest {cloudname} or {enterpriseversion} Release, see: xref:release-notes.adoc[{productname} Release Notes]. -TIP: For an RSS feed of the {productname} Changelog, use the following URL: {site-url}/rss.xml +TIP: For an RSS feed of the {productname} Changelog, use the following URL: {site-url}/{page-component-name}/{page-component-version}/rss.xml == xref:7.6.0-release-notes.adoc[7.6.0 - 2024-12-11] From 852e77b0cfc17d2cebd5e4c417143e046f06dfad Mon Sep 17 00:00:00 2001 From: Farzad Hayatbakhsh Date: Thu, 2 Jan 2025 10:39:39 +1000 Subject: [PATCH 18/19] DOC-2608: Fix Atom link --- extensions/rssfeed.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/rssfeed.cjs b/extensions/rssfeed.cjs index 21a3f5ba04..fa639e6a41 100644 --- a/extensions/rssfeed.cjs +++ b/extensions/rssfeed.cjs @@ -30,6 +30,7 @@ module.exports.register = function ({ config }) { // Construct site links const siteLink = playbook.site.url; const siteLinkWithVersion = `${siteLink}/${pageComponentName}/${pageComponentVersion}`; + const filePath = `${pageComponentName}/${pageComponentVersion}/${config.outputFile}`; // Load page content with cheerio const $ = cheerio.load(page.contents.toString()); @@ -96,13 +97,12 @@ module.exports.register = function ({ config }) { ${pageDescription} en Creative Commons Legal Code - Attribution-NonCommercial-ShareAlike 3.0 Unported - + ${rssItems} `; // Add RSS feed to site catalog - const filePath = `${pageComponentName}/${pageComponentVersion}/${config.outputFile}`; siteCatalog.addFile({ contents: Buffer.from(rss), out: { path: filePath }, From fea6fc576b6ed3cfc8c9c079fd72d2986adf069e Mon Sep 17 00:00:00 2001 From: Sorita Heng Date: Fri, 4 Apr 2025 15:52:21 +1000 Subject: [PATCH 19/19] Add note about RSS reader in Tip admonition --- modules/ROOT/pages/changelog.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/changelog.adoc b/modules/ROOT/pages/changelog.adoc index 38ae934c63..f2c15f167c 100644 --- a/modules/ROOT/pages/changelog.adoc +++ b/modules/ROOT/pages/changelog.adoc @@ -4,7 +4,7 @@ NOTE: This is the {productname} Community version changelog. For information about the latest {cloudname} or {enterpriseversion} Release, see: xref:release-notes.adoc[{productname} Release Notes]. -TIP: For an RSS feed of the {productname} Changelog, use the following URL: {site-url}/{page-component-name}/{page-component-version}/rss.xml +TIP: For an RSS feed of the {productname} Changelog, use the following URL in any RSS reader: {site-url}/{page-component-name}/{page-component-version}/rss.xml == xref:7.6.0-release-notes.adoc[7.6.0 - 2024-12-11]