1
0
Fork 0
forked from github/pelican
pelican-theme/pelican
Vladimír Vondruš 182fb11c80 Allow to use page URL in pagination pattern.
Currently it was only possible to use page "save as" name or part of it
for generating pagination links. That's not sufficient when page URLs
differ a lot from actual filenames. With this patch it's possible to use
the `{url}` placeholder in PAGINATION_PATTERNS setting. For example, the
paginated archives would be saved to:

    blog/index.html
    blog/2/index.html
    blog/3/index.html

while the actual URLs would be like this (with the help of Apache's
mod_rewrite):

    http://blog.my.site/
    http://blog.my.site/2/
    http://blog.my.site/3/

The configuration that corresponds to this is roughly the following:

    ARCHIVES_SAVE_AS = 'blog/index.html'
    ARCHIVES_URL = 'http://blog.my.site/'
    PAGINATION_PATTERNS = [
        (1, '/{url}', '{base_name}/index.html'),
        (2, '/{url}{number}/', '{base_name}/{number}/index.html')
    ]

Also added YEAR_ARCHIVE_URL, MONTH_ARCHIVE_URL and DAY_ARCHIVE_URL
settings, as they were missing and now they make sense.
2018-02-10 18:26:55 +01:00
..
tests Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00
themes Remove Internet Explorer script, as it wasn't being used: 404 HTTP error 2017-07-30 17:49:43 +02:00
tools PyCodeStyle fixes to keep Flake8 happy 2017-10-26 13:53:32 -07:00
__init__.py Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
cache.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
contents.py Consolidate validation of content (#2128) 2017-07-24 10:01:14 -07:00
generators.py Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00
log.py Correct new flake8 warnings 2017-01-24 09:12:16 +01:00
paginator.py Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00
readers.py Ability to override docutils HTML writer/translator. 2017-06-30 22:59:42 +02:00
rstdirectives.py Fix warnings originating from bad regexes 2017-03-27 16:09:08 +02:00
server.py prevent server from dying when query strings present 2016-12-10 10:05:50 -08:00
settings.py Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00
signals.py Add new signal: feed_generated 2017-01-16 11:33:13 +01:00
urlwrappers.py Add AUTHOR_SUBSTITUTIONS 2016-04-01 23:01:57 +03:00
utils.py Fix warnings originating from bad regexes 2017-03-27 16:09:08 +02:00
writers.py Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00