Skip to content

Commit

Permalink
.eleventy.js: allow paths that start with .. to be rewritten from .md
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Aug 19, 2024
1 parent c2c6db4 commit c558d5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ module.exports = function (eleventyConfig) {
const startURL = this.inputPath.substring(1, lastSlashIndex + 1);
return content
.replace(
/<a( class="[\w\-]+")? href="\.\/([\w\-\/]+)\.md(#[\w+\-]+)?"/g,
/<a( class="[\w\-]+")? href="\.?\.\/([\w\-\/]+)\.md(#[\w+\-]+)?"/g,
`<a$1 href="${startURL}$2/$3"`
)
.replace("/index/", "/");
Expand Down

0 comments on commit c558d5b

Please sign in to comment.