How to link your Pelican blog articles?

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

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

But it is possible that another article will appear in a different folder due to the ARTICLE_URL template. Examples:

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

Can I link my articles with a link to the slug? Any other better solution than the generated HTML file name?

+4
source share
2 answers

As stated in the documentation , you can link to other source content files through:

[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)

The Pelican will include the selected URL scheme and will automatically determine the correct way to link to another article.

+9
source

, , sluglines, save_as. , my_post.md, :

Title: My Blog Post
save_as: myblogpost.html

This is the world most boring blog post.

, /myblogpost.html. - :

Title: My Second Blog Post
save_as: mysecondblogpost.html

This is the world second most boring blog post. The most boring blog post is [here]({{ SITEURL }}/myblogpost.html).

, . , .

+4

Source: https://habr.com/ru/post/1527604/


All Articles