mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
fix: use relative urls when github publish enabled
docs: add doc about enabling relative urls when github
This commit is contained in:
parent
d9b2bc3a4e
commit
19d0aca2dd
3 changed files with 11 additions and 0 deletions
|
|
@ -445,6 +445,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.
|
||||
This option is enabled by default if you use github pages.
|
||||
|
||||
.. data:: ARTICLE_URL = '{slug}.html'
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,12 @@ ifeq ($(DEBUG), 1)
|
|||
PELICANOPTS += -D
|
||||
endif
|
||||
|
||||
{% if github %}
|
||||
RELATIVE ?= 1
|
||||
{% else %}
|
||||
RELATIVE ?= 0
|
||||
{% endif %}
|
||||
|
||||
ifeq ($(RELATIVE), 1)
|
||||
PELICANOPTS += --relative-urls
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue