How to link from .md page to other page

The link tag and other tags does not with a filter chain.

So this is invalid

{% link test_sub.md | absolute_url %})

This is what I do for all my Jekyll 3 sites

[Link to a page]({{ site.baseurl }}{% link test_sub.md %})

In Jekyll 4, you can simply do the link tag and it will add the relative URL subpath for you.

[Link to a page]({% link test_sub.md %})

Most of the time you should not want to use absolute URLs. Use relative URLs. You will need an absolute URL for meta HTML tags, RSS feed maybe, sitemap…

I guess you could use url from config if it was set with a domain. To make this absolute.

[Link to a page]({{ site.url }}{{ site.baseurl }}{% link test_sub.md %})
1 Like