What is the point of using absolute URLs in Pelican?

About RELATIVE_URLS , Pelican docs say:

& hellip; There are currently two supported methods for generating URLs: relative and absolute. Relative URLs are useful for local testing, and absolute URLs are reliable and most useful for publishing.

( http://pelican.readthedocs.org/en/3.4.0/settings.html#url-settings )

But I'm confused why absolute URLs will be better or not. In general, when I write HTML manually, I prefer to use relative URLs because I can change the domain of the site and not worry about it later.

Can someone explain the thinking behind this setting in more detail?

+6
source share
1 answer

I do not use the RELATIVE_URLS parameter because it is relative to the document. I don't need URLs containing ../.. , which often happens when this option is used.

In addition, relative URLs can cause problems in Atom / RSS feeds, since all links in feeds must be absolute in accordance with standard feed specifications.

Unlike what is implied in the original question, using the RELATIVE_URLS parameter RELATIVE_URLS not result in any 404s if you later decide to change the domain. There is a difference between specifying absolute URLs in the source document (which you seem to be talking about) and having absolute URLs generated for you during build (which is what Pelican does).

When it comes time to link to your own content, you can either use root links or use the on- site link syntax that Pelican provides.

+2
source

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


All Articles