replace links that have .md suffixes with clean links

to aid viewing the raw markdown source in e.g. a gitlab source browser,
or to aid navigation in vim with "gf" style commands to jump between
files, allow the markdown source to specify foo.md or whatever/index.md
explicitly, yet generate the clean URLs for linking in the HTML output

this assumes that nginx is serving "foo" with foo.html, and "bar/" with
bar/index.html

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
2025-09-18 14:19:48 -05:00
parent 7205bb2aa5
commit 424ec3621d
4 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
[Cool](cool/index.md)
[Anchored Cool](cool/index.md#anchor)
[This Index](index.md)
[Anchored This Index](index.md#anchor)
[Parent](../index.md)
[Anchored Parent](../index.md#anchor)

View File

@@ -0,0 +1,4 @@
[Foo](foo.md)
[Anchored Foo](foo.md#anchor)
[Sub Foo](sub/foo.md)
[Anchored Sub Foo](sub/foo.md#anchor)