Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated rewite numbered links to work with nested links #3

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ for (const version of RUN.versions) {
const srcimgs = `${RUN.core}/_images`
const dstimgs = `${RUN.work}/static/${RUN.version}/_images`
await fs.cp(srcimgs, dstimgs, {recursive: true})

log.push(['src', srcimgs])
log.push(['dst', dstimgs])
})
Expand Down Expand Up @@ -294,7 +294,7 @@ for (const version of RUN.versions) {
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('](./', '](../')
RUN.srcmd.content = RUN.srcmd.content.replaceAll('](../', '](../../').replaceAll('](./', '](../')

// rewrite .md link paths to strip filename number prefixes
Array.from(RUN.srcmd.content.matchAll(/\]\(\.\.\/[^)]*\)/g), m => m[0]).forEach(mdLink => {
Expand Down Expand Up @@ -354,7 +354,7 @@ for (const version of RUN.versions) {
const idxContent = [idxFront, idxBody].join("\n")
await fs.writeFile(idxMd, idxContent, { encoding: 'utf8' })

log.push(['dst', idxMd])
log.push(['dst', idxMd])
})

}
Expand Down
Loading