From 3e194bf4d5f94391ed82bc4d28779dd1f41d39f4 Mon Sep 17 00:00:00 2001 From: Spencer Bliven Date: Wed, 19 Jun 2019 11:22:23 +0200 Subject: [PATCH] More siteinfo.html tests --- siteinfo.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/siteinfo.md b/siteinfo.md index a6de4e2..764e5db 100644 --- a/siteinfo.md +++ b/siteinfo.md @@ -20,13 +20,31 @@ permalink: siteinfo.html ## Testing links -All of these links should be valid: +Link processing in Jekyll -| Code | Result | -| ---- | ------ | -| `{%raw%}[Normal link to result](/merlin6/introduction.html){%endraw%}` | [Normal link to result](/merlin6/introduction.html) | -| `{%raw%}[Normal link to source](/pages/merlin6/introduction.md){%endraw%}` | [Normal link to source](/pages/merlin6/introduction.md) | -| `{%raw%}[Escaped link to result]({{"/merlin6/introduction.html"}}){%endraw%}` | [Escaped link to result]({{"/merlin6/introduction.html"}}) | -| `{%raw%}[Liquid Link]({% link pages/merlin6/introduction.md %}){%endraw%}` | [Liquid Link]({% link pages/merlin6/introduction.md %}) | -| `{%raw%}![PSI Logo](/images/psi-logo.png){%endraw%}` | ![PSI Logo](/images/psi-logo.png) | -| `{%raw%}![Escaped PSI Logo]({{ "/images/psi-logo.png" }}){%endraw%}` | ![PSI Logo from liquid]({{ "/images/psi-logo.png" }}) | +Code | Result | +---- | ------ | +`{%raw%}[Normal link to source]{%endraw%}{%raw%}(/pages/merlin6/introduction.md){%endraw%}` | [Normal link to source](/pages/merlin6/introduction.md) +`{%raw%}[Normal link to result](/merlin6/introduction.html){%endraw%}` | [Normal link to result](/merlin6/introduction.html) +`{%raw%}[Invalid Escaped link to source]({{"/pages/merlin6/introduction.md"}}){%endraw%}` | [Invalid Escaped link to source]({{"/pages/merlin6/troduction.md"}} +`{%raw%}[Escaped link to result]({{"/merlin6/introduction.html"}}){%endraw%}` | [Escaped link to result]({{"/merlin6/introduction.html"}}) +`{%raw%}[Reference link to source](srcRef){%endraw%}` | [Reference link to source][srcRef] +`{%raw%}[Reference link to result](dstRef){%endraw%}` | [Reference link to result][dstRef] +`{%raw%}[Liquid Link]({% link pages/merlin6/introduction.md %}){%endraw%}` | [Liquid Link]({% link pages/merlin6/introduction.md %}) +`{%raw%}![PSI Logo](/images/psi-logo.png){%endraw%}` | ![PSI Logo](/images/psi-logo.png) +`{%raw%}![Escaped PSI Logo]({{ "/images/psi-logo.png" }}){%endraw%}` | ![PSI Logo from liquid]({{ "/images/psi-logo.png" }}) +`{%raw%}Reference to source: (/pages/merlin6/introduction.md){%endraw%}` | Reference to source: (/pages/merlin6/introduction.md) +`{%raw%}{{ "/pages/merlin6/introduction.md" | relative_url }}{%endraw%}` | {{ "/pages/merlin6/introduction.md" | relative_url }} +`{%raw%}{{ "/merlin6/introduction.html" | relative_url }}{%endraw%}` | {{ "/merlin6/introduction.html" | relative_url }} + +[srcRef]: /pages/merlin6/introduction.md +[dstRef]: /merlin6/introduction.html + +Conclusions: + +- Markdown links that refer to source files are replaced by the + baseurl + permalink +- This happens for both normal links and images +- Workarounds + - Link to permalink directly (for pages/posts) + - Can use `{%raw%}{{"path"}}{%endraw%}` pattern to disable expansion \ No newline at end of file