From 9edd13ae779ecc84908ce5a9f74e14a98af23005 Mon Sep 17 00:00:00 2001 From: Guillaume EHRET Date: Sun, 31 Dec 2023 16:28:17 +0100 Subject: [PATCH] Fix bug on canonical URL --- extension/read-asciidoctor.js | 2 +- extension/read-asciidoctor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/read-asciidoctor.js b/extension/read-asciidoctor.js index 6bb68d7..461a887 100644 --- a/extension/read-asciidoctor.js +++ b/extension/read-asciidoctor.js @@ -90,7 +90,7 @@ function extReadAsciidoc(options) { imgteaser: function () { return indexData.imgteaser; }, status: function () { return file.attributes.status; }, modedev: function () { return indexData.modeDev; }, - canonicalUrl: function () { return subdirectory + "/" + dir + "/" + filename + ".html"; } + canonicalUrl: function () { return (subdirectory + "/" + dir + "/" + filename + ".html").replace('//', '/'); } }; if (file.attributes.status !== 'draft') { file.indexData = indexData; diff --git a/extension/read-asciidoctor.ts b/extension/read-asciidoctor.ts index e6e9e25..e259acc 100644 --- a/extension/read-asciidoctor.ts +++ b/extension/read-asciidoctor.ts @@ -102,7 +102,7 @@ export function extReadAsciidoc(options: Options): Transform { imgteaser: () => indexData.imgteaser, status: () => file.attributes.status, modedev: () => indexData.modeDev, - canonicalUrl: () => `${subdirectory}/${dir}/${filename}.html` + canonicalUrl: () => `${subdirectory}/${dir}/${filename}.html`.replace('//', '/') }; if (file.attributes.status !== 'draft') {