This commit is contained in:
Salar Nosrati-Ershad 2026-05-14 13:05:41 +00:00 committed by GitHub
commit 8ebaf87fef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View file

@ -496,6 +496,7 @@ This would save your articles into something like
Defines whether Pelican should use document-relative URLs or not. Only set
this to ``True`` when developing/testing and only if you fully understand
the effect it can have on links/feeds. The default is ``False``.
This option is enabled by default if you use github pages.
.. data:: ARTICLE_URL

View file

@ -46,7 +46,12 @@ ifeq ($(DEBUG), 1)
PELICANOPTS += -D
endif
{% if github %}
RELATIVE ?= 1
{% else %}
RELATIVE ?= 0
{% endif %}
ifeq ($(RELATIVE), 1)
PELICANOPTS += --relative-urls
endif

View file

@ -9,7 +9,12 @@ from pelicanconf import *
# If your site is available via HTTPS, make sure SITEURL begins with https://
SITEURL = "{{siteurl}}"
{{ if github }}
RELATIVE_URLS = False
{{ else }}
RELATIVE_URLS = True
{{ endif }}
FEED_ALL_ATOM = "feeds/all.atom.xml"
CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml"