Search code examples
relative-pathpelicanstatic-site

How to link your own articles on a Pelican blog?


I tried to link with the html file name, but it works because they are on the same folder.

[Title](./this-is-the-file.html)

But it is possible that another article would appear on another folder because of the ARTICLE_URL pattern. Examples:

[Title 1](/2014/02/article1.html)
[Title 2](/2014/01/25/article2.html)

Is it possible to link your own articles with a reference to the slug ? Any other better solution than the generated HTML file name ?


Solution

  • As noted in the documentation, you can link to other source content files via:

    [a link relative to content root]({filename}/this-is-the-source-file.md)
    

    ... or ...

    [a link relative to current file]({filename}../this-is-the-source-file.md)
    

    Pelican will incorporate your chosen URL scheme and automatically determine the proper way to link to the other article.