58 lines
3.4 KiB
Markdown
58 lines
3.4 KiB
Markdown
---
|
|
title: "Testing Jekyll environment"
|
|
sidebar: home_sidebar
|
|
permalink: siteinfo.html
|
|
---
|
|
|
|
## Site
|
|
|
|
Some information about this jekyll site (for debugging):
|
|
|
|
- site.port: {{site.port}}
|
|
- site.host: {{site.host}}
|
|
- site.url: {{site.url}}
|
|
- site.baseurl: {{site.baseurl}}
|
|
|
|
{% comment %}
|
|
## Full dump
|
|
|
|
<pre>{{site|inspect}}</pre>
|
|
|
|
{% endcomment %}
|
|
|
|
## Testing links
|
|
|
|
Link processing in Jekyll
|
|
|
|
Code | Result | Baseurl
|
|
---- | ------ | -------
|
|
`{%raw%}[Normal link to source]{%endraw%}{%raw%}(/pages/merlin6/01-Quick-Start-Guide/introduction.md){%endraw%}` | [Normal link to source](/pages/merlin6/01-Quick-Start-Guide/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/01-Quick-Start-Guide/introduction.md"}}){%endraw%}` | [Invalid Escaped link to source]({{"/pages/merlin6/01-Quick-Start-Guide/introduction.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/01-Quick-Start-Guide/introduction.md %}){%endraw%}` | [Liquid Link]({% link pages/merlin6/01-Quick-Start-Guide/introduction.md %}) | ❌
|
|
`{%raw%}{%endraw%}` |  | ✅
|
|
`{%raw%}{%endraw%}` |  | ❌
|
|
`{%raw%}{% include inline_image.html file="psi-logo.png" alt="Included PSI Logo" %}{%endraw%}` | {% include inline_image.html file="psi-logo.png" alt="Included PSI Logo" -%} | | ❌
|
|
`{%raw%}{{ "/pages/merlin6/01-Quick-Start-Guide/introduction.md" | relative_url }}{%endraw%}` | {{ "/pages/merlin6/01-Quick-Start-Guide/introduction.md" | relative_url }} | ✅❗
|
|
`{%raw%}{{ "/merlin6/introduction.html" | relative_url }}{%endraw%}` | {{ "/merlin6/introduction.html" | relative_url }} | ✅
|
|
`{%raw%}{% link pages/merlin6/01-Quick-Start-Guide/introduction.md %}{%endraw%}` | {% link pages/merlin6/01-Quick-Start-Guide/introduction.md %} | ✅
|
|
|
|
[srcRef]: /pages/merlin6/01-Quick-Start-Guide/introduction.md
|
|
[dstRef]: /merlin6/introduction.html
|
|
|
|
Key:
|
|
- ✅ Baseurl gets prepended to the URL
|
|
- ❌ No baseurl in URL
|
|
- ❗ Source not expected to be converted to the result URL
|
|
|
|
### 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 |