1
0
Fork 0
forked from github/pelican
pelican-theme/pelican/tests
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
..
content Fix extension-matching bug in generators.py 2016-10-12 23:33:29 -07:00
mixed_content Make StaticGenerator skip content sources. Refs #1019. 2014-10-31 16:46:01 -07:00
nested_content/maindir Make PAGE_EXCLUDES work with subdirs. Fixes #1500. 2014-11-01 17:38:20 -07:00
output Regenerate tests' output 2017-08-06 13:55:34 +02:00
TestPages Generate {tag}-style links on pages correctly. Fixes #1513 2015-01-02 01:20:57 -07:00
__init__.py Add logging for warnings during test suite run 2015-10-22 09:45:04 +02:00
default_conf.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
support.py PyCodeStyle fixes to keep Flake8 happy 2017-10-26 13:53:32 -07:00
test_cache.py Add tests to make sure cached content is properly added to generators 2016-12-10 05:18:35 -05:00
test_contents.py Consolidate validation of content (#2128) 2017-07-24 10:01:14 -07:00
test_generators.py Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00
test_importer.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_paginator.py Allow to use page URL in pagination pattern. 2018-02-10 18:26:55 +01:00
test_pelican.py Updates test cases to use MARKDOWN 2016-11-02 21:11:42 +01:00
test_readers.py Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
test_rstdirectives.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_settings.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_testsuite.py Drop unsupported Python 3.3 2017-10-02 18:33:21 +03:00
test_urlwrappers.py Add AUTHOR_SUBSTITUTIONS 2016-04-01 23:01:57 +03:00
test_utils.py Check safety of save_as earlier if possible 2017-02-27 21:49:17 +01:00