Skip to content

Commit

Permalink
fix: alwayse add trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyvdhondel committed Dec 11, 2024
1 parent a9f2956 commit 2b04882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gridsome-source-confluence",
"version": "1.1.0",
"version": "1.2.0",
"description": "Confluence source for Gridsome",
"author": "Jeffrey van den Hondel",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class ConfluenceSource {
const contentId = a.getAttribute("data-linked-resource-id");
if (contentId) {
const slug = this.createSlug(space.key, contentId);
a.replaceWith(`<a href="${slug}/">${a.innerHTML}</a>`);
a.replaceWith(`<a href="${slug}">${a.innerHTML}</a>`);
}
//External urls
} else if (a.getAttribute("class") == "external-link") {
Expand Down Expand Up @@ -455,7 +455,7 @@ class ConfluenceSource {
while (!done) {
const page = this.spaces[spaceIndex].pages.filter((page) => page.id == id);
if (page.length === 1) {
slug = `/${slugify(page[0].title, { trim: true, lower: true, remove: /[*+~./()'"!?:@]/g })}${slug}`;
slug = `/${slugify(page[0].title, { trim: true, lower: true, remove: /[*+~./()'"!?:@]/g })}${slug}/`; // https://gridsome.org/docs/linking/#link-between-pages
if (page[0].parent_page) {
id = page[0].parent_page;
continue;
Expand Down

0 comments on commit 2b04882

Please sign in to comment.