Skip to content

Commit

Permalink
updated rewrite broken content to not include the README/_index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
schaeferka authored and btlghrants committed Feb 23, 2024
1 parent f39234a commit 67b37d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,12 @@ for (const version of RUN.versions) {
await activity(`Rewrite broken content`, async () => {
RUN.srcmd.content = rewriteRemoteVideoLinks(RUN.srcmd.content)

// rewrite relative .md link paths to compensate Hugo-gen'd pretty path
RUN.srcmd.content = RUN.srcmd.content.replaceAll('](../', '](../../').replaceAll('](./', '](../')
const baseFile = path.basename(RUN.srcmd.file)

// rewrite relative .md link paths to compensate Hugo-gen'd pretty path, except for README.md/_index.md files
if (baseFile !== "README.md") {
RUN.srcmd.content = RUN.srcmd.content.replaceAll('](../', '](../../').replaceAll('](./', '](../')
}

RUN.srcmd.content = rewriteNumberedFileLinks(RUN.srcmd.content)

Expand Down

0 comments on commit 67b37d9

Please sign in to comment.