File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed
Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change 44function Link (el )
55 local target = el .target
66
7- -- Only transform if it ends with .md
8- if target :match (" %.md$" ) then
9- -- Transform any .md link to .qmd
10- el .target = target :gsub (" %.md$" , " .qmd" )
11- return el
7+ -- Transform .md to .qmd (including anchors)
8+ if target :match (" %.md" ) then
9+ target = target :gsub (" %.md" , " .qmd" )
1210 end
1311
12+ -- Handle cross-skill SKILL references: ../add-xxx/SKILL.qmd -> add-xxx.qmd
13+ if target :match (" %.%./[^/]+/SKILL%.qmd" ) then
14+ target = target :gsub (" %.%./([^/]+)/SKILL%.qmd" , " %1.qmd" )
15+ end
16+
17+ -- Handle cross-skill reference files from references/ folder:
18+ -- ../../add-xxx/references/file.qmd -> file.qmd
19+ -- (Keep in same references/ folder, just get the filename)
20+ if target :match (" %.%./%.%./[^/]+/references/" ) then
21+ target = target :gsub (" %.%./%.%./[^/]+/references/([^/]+)" , " %1" )
22+ end
23+
24+ -- Handle same-skill reference files: add-xxx/references/file.qmd -> references/file.qmd
25+ if target :match (" ^add%-[^/]+/references/" ) then
26+ target = target :gsub (" ^add%-[^/]+/references/" , " references/" )
27+ end
28+
29+ -- Remove developers/ prefix
30+ target = target :gsub (" ^developers/" , " " )
31+
32+ el .target = target
1433 return el
1534end
You can’t perform that action at this time.
0 commit comments