From 9095e13c0828a9469ce1727e89a53bff95e6062c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 17 Jul 2022 11:49:29 +0300 Subject: feat: resolve links to other pages This is meant to implement the rules described on https://ikiwiki.info/ikiwiki/subpage/linkingrules/. Sponsored-by: author --- riki.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'riki.md') diff --git a/riki.md b/riki.md index 23f430e..40ea5e7 100644 --- a/riki.md +++ b/riki.md @@ -363,3 +363,31 @@ when I run riki build site output then AST of site/foo/page.mdwn matches that of output/foo/page.html then files site/bar//image.jpg and output/bar/image.jpg match ~~~ + +## Wiki links to other pages on the site + +_Requirement: Pages can link to other pages on the site, the same +way ikiwiki does, including subpages._ + +~~~scenario +given an installed riki +given file site/dir/foo.mdwn from foo +given file site/absolute.mdwn from empty +given file site/dir/sibling.mdwn from empty +given file site/dir/foo/child.mdwn from empty +given file site/dir/foo/child/grandchild.mdwn from empty +when I run riki build site output +then file output/dir/foo.html contains "href="/absolute"" +then file output/dir/foo.html contains "href="dir/sibling"" +then file output/dir/foo.html contains "href="dir/foo/child"" +then file output/dir/foo.html contains "href="dir/foo/child/grandchild"" +then file output/dir/foo.html contains "href="/missing" +~~~ + +~~~{#foo .file .markdown} +[[/absolute]] +[[sibling]] +[[child]] +[[child/grandchild]] +[[missing]] +~~~ -- cgit v1.2.1