diff --git a/templates/macros/command.html b/templates/macros/command.html index 17fd157..c0e56d1 100644 --- a/templates/macros/command.html +++ b/templates/macros/command.html @@ -57,5 +57,6 @@ | regex_replace(pattern=`\]\(\.\./topics/(?P.*?).md#(?P.*?)\)`, rep=`](/topics/$fname#$hash)`) | regex_replace(pattern=`\]\(\.\./topics/(?P.*?).md\)`, rep=`](/topics/$fname)`) | regex_replace(pattern=`\[(?P.*?)\]:\s+\.\./topics/(?P.*?).md`, rep=`[$token]: /topics/$fname`) + | regex_replace(pattern=`\[(?P.*?)\]:\s+(?P.*?).md`, rep=`[$token]: $fname`) }} {%- endmacro fix_links -%} diff --git a/templates/macros/docs.html b/templates/macros/docs.html index 2e7bb67..f597381 100644 --- a/templates/macros/docs.html +++ b/templates/macros/docs.html @@ -29,11 +29,23 @@ | regex_replace(pattern=`\]\(\.\./commands/(?P\w.*?)(.md)?#(?P.*?)\)`, rep=`](/commands/$fname#$hash)`) | regex_replace(pattern=`\]\(\.\./commands/(?P\w.*?)(.md)?\)`, rep=`](/commands/$fname)`) | regex_replace(pattern=`\]\(\.\./commands/#(?P\w.*?)\)`, rep=`](/commands/#$hash)`) + | regex_replace(pattern=`\]\((?P\w.*?)(.md)\)`, rep=`](/topics/$fname)`) | regex_replace(pattern=`\]\((?P\w.*?)(.md)?#(?P.*?)\)`, rep=`](/topics/$fname#$hash)`) | regex_replace(pattern=`\]\((?P.*?).png\)`, rep=`](/topics/$fname.png)`) | regex_replace(pattern=`\]\((?P.*?).gif\)`, rep=`](/topics/$fname.gif)`) | regex_replace(pattern=`\]\((?P\w.*?)(.md)?\)`, rep=`](/topics/$fname)`) | regex_replace(pattern=`\]\(\-(?Phttps?:\/\/.*?\))`, rep=`]($url`) | regex_replace(pattern=`\]\(\--(?P.*?\))`, rep=`](#$hash`) + | regex_replace(pattern=`\.\.\/commands\/`, rep=`/commands/`) + + | regex_replace(pattern=`\[(?.*)\]:\s*https://(?P.*)`, rep=`[$id} https://$url`) + + | regex_replace(pattern=`\[(?.*)\]:\s*(?P.*)(\.md)`, rep=`[$id]: /topics/$topic`) + + | regex_replace(pattern=`\]\(\/topics\/(?Phttp:\/\/.*?\))`, rep=`]($url`) + + + + | regex_replace(pattern=`\[(?.*)\}\s*(?P.*)`, rep=`[$id]: $url`) }} {%- endmacro fix_links -%}