Skip to content

Commit

Permalink
Merge pull request #156 from stockholmux/link-rewriter-update
Browse files Browse the repository at this point in the history
Link rewriter update
  • Loading branch information
stockholmux authored Oct 21, 2024
2 parents 783dd12 + 214d6b0 commit 883be38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions templates/macros/command.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
| regex_replace(pattern=`\]\(\.\./topics/(?P<fname>.*?).md#(?P<hash>.*?)\)`, rep=`](/topics/$fname#$hash)`)
| regex_replace(pattern=`\]\(\.\./topics/(?P<fname>.*?).md\)`, rep=`](/topics/$fname)`)
| regex_replace(pattern=`\[(?P<token>.*?)\]:\s+\.\./topics/(?P<fname>.*?).md`, rep=`[$token]: /topics/$fname`)
| regex_replace(pattern=`\[(?P<token>.*?)\]:\s+(?P<fname>.*?).md`, rep=`[$token]: $fname`)
}}
{%- endmacro fix_links -%}
12 changes: 12 additions & 0 deletions templates/macros/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@
| regex_replace(pattern=`\]\(\.\./commands/(?P<fname>\w.*?)(.md)?#(?P<hash>.*?)\)`, rep=`](/commands/$fname#$hash)`)
| regex_replace(pattern=`\]\(\.\./commands/(?P<fname>\w.*?)(.md)?\)`, rep=`](/commands/$fname)`)
| regex_replace(pattern=`\]\(\.\./commands/#(?P<hash>\w.*?)\)`, rep=`](/commands/#$hash)`)
| regex_replace(pattern=`\]\((?P<fname>\w.*?)(.md)\)`, rep=`](/topics/$fname)`)
| regex_replace(pattern=`\]\((?P<fname>\w.*?)(.md)?#(?P<hash>.*?)\)`, rep=`](/topics/$fname#$hash)`)
| regex_replace(pattern=`\]\((?P<fname>.*?).png\)`, rep=`](/topics/$fname.png)`)
| regex_replace(pattern=`\]\((?P<fname>.*?).gif\)`, rep=`](/topics/$fname.gif)`)
| regex_replace(pattern=`\]\((?P<fname>\w.*?)(.md)?\)`, rep=`](/topics/$fname)`)
| regex_replace(pattern=`\]\(\-(?P<url>https?:\/\/.*?\))`, rep=`]($url`)
| regex_replace(pattern=`\]\(\--(?P<hash>.*?\))`, rep=`](#$hash`)
| regex_replace(pattern=`\.\.\/commands\/`, rep=`/commands/`)

| regex_replace(pattern=`\[(?<id>.*)\]:\s*https://(?P<url>.*)`, rep=`[$id} https://$url`)

| regex_replace(pattern=`\[(?<id>.*)\]:\s*(?P<topic>.*)(\.md)`, rep=`[$id]: /topics/$topic`)

| regex_replace(pattern=`\]\(\/topics\/(?P<url>http:\/\/.*?\))`, rep=`]($url`)



| regex_replace(pattern=`\[(?<id>.*)\}\s*(?P<url>.*)`, rep=`[$id]: $url`)
}}
{%- endmacro fix_links -%}

0 comments on commit 883be38

Please sign in to comment.