Skip to content

Commit

Permalink
Fix bug on canonical URL
Browse files Browse the repository at this point in the history
  • Loading branch information
javamind committed Dec 31, 2023
1 parent d080eb2 commit 9edd13a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension/read-asciidoctor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion extension/read-asciidoctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 9edd13a

Please sign in to comment.