mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Remove WITH_PAGINATION, only have a DEFAULT_PAGINATION setting
DEFAULT_PAGINATION can be set to False instead of using WITH_PAGINATION
This commit is contained in:
parent
522ac12dc9
commit
2be58aa51a
5 changed files with 10 additions and 11 deletions
|
|
@ -160,9 +160,9 @@ Setting name (default value) what does it do?
|
||||||
`DEFAULT_ORPHANS` (0) The minimum number of articles allowed on the
|
`DEFAULT_ORPHANS` (0) The minimum number of articles allowed on the
|
||||||
last page. Use this when you don't want to
|
last page. Use this when you don't want to
|
||||||
have a last page with very few articles.
|
have a last page with very few articles.
|
||||||
`DEFAULT_PAGINATION` (5) The maximum number of articles to include on a
|
`DEFAULT_PAGINATION` (False) The maximum number of articles to include on a
|
||||||
page, not including orphans.
|
page, not including orphans. False to disable
|
||||||
`WITH_PAGINATION` (``False``) Activate pagination.
|
pagination.
|
||||||
================================================ =====================================================
|
================================================ =====================================================
|
||||||
|
|
||||||
Tag cloud
|
Tag cloud
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ _DEFAULT_CONFIG = {'PATH': None,
|
||||||
'DATE_FORMATS': {},
|
'DATE_FORMATS': {},
|
||||||
'JINJA_EXTENSIONS': [],
|
'JINJA_EXTENSIONS': [],
|
||||||
'LOCALE': '', # default to user locale
|
'LOCALE': '', # default to user locale
|
||||||
'WITH_PAGINATION': False,
|
'DEFAULT_PAGINATION': False,
|
||||||
'DEFAULT_PAGINATION': 5,
|
|
||||||
'DEFAULT_ORPHANS': 0,
|
'DEFAULT_ORPHANS': 0,
|
||||||
'DEFAULT_METADATA': (),
|
'DEFAULT_METADATA': (),
|
||||||
'FILES_TO_COPY': (),
|
'FILES_TO_COPY': (),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{% if WITH_PAGINATION %}
|
{% if DEFAULT_PAGINATION %}
|
||||||
<p class="paginator">
|
<p class="paginator">
|
||||||
{% if articles_page.has_previous() %}
|
{% if articles_page.has_previous() %}
|
||||||
{% if articles_page.previous_page_number() == 1 %}
|
{% if articles_page.previous_page_number() == 1 %}
|
||||||
|
|
@ -12,4 +12,4 @@
|
||||||
<a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html">»</a>
|
<a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html">»</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ class Writer(object):
|
||||||
for key in paginated.iterkeys():
|
for key in paginated.iterkeys():
|
||||||
object_list = paginated[key]
|
object_list = paginated[key]
|
||||||
|
|
||||||
if self.settings.get('WITH_PAGINATION'):
|
if self.settings.get('DEFAULT_PAGINATION'):
|
||||||
paginators[key] = Paginator(object_list,
|
paginators[key] = Paginator(object_list,
|
||||||
self.settings.get('DEFAULT_PAGINATION'),
|
self.settings.get('DEFAULT_PAGINATION'),
|
||||||
self.settings.get('DEFAULT_ORPHANS'))
|
self.settings.get('DEFAULT_ORPHANS'))
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,6 @@ SOCIAL = (
|
||||||
('You can add links in your config file', '#'),
|
('You can add links in your config file', '#'),
|
||||||
)
|
)
|
||||||
|
|
||||||
WITH_PAGINATION = $with_pagination
|
|
||||||
DEFAULT_PAGINATION = $default_pagination
|
DEFAULT_PAGINATION = $default_pagination
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -104,7 +103,6 @@ CONF = {
|
||||||
'ssh_user': 'root',
|
'ssh_user': 'root',
|
||||||
'ssh_target_dir': '/var/www',
|
'ssh_target_dir': '/var/www',
|
||||||
'dropbox_dir' : '~/Dropbox/Public/',
|
'dropbox_dir' : '~/Dropbox/Public/',
|
||||||
'with_pagination' : True,
|
|
||||||
'default_pagination' : 7,
|
'default_pagination' : 7,
|
||||||
'lang': 'en'
|
'lang': 'en'
|
||||||
}
|
}
|
||||||
|
|
@ -221,10 +219,12 @@ Please answer the following questions so this script can generate the files need
|
||||||
CONF['author'] = ask('Who will be the author of this Web site ?', answer=str, default=args.author)
|
CONF['author'] = ask('Who will be the author of this Web site ?', answer=str, default=args.author)
|
||||||
CONF['lang'] = ask('What will be the default language of this Web site ?', str, args.lang or CONF['lang'], 2)
|
CONF['lang'] = ask('What will be the default language of this Web site ?', str, args.lang or CONF['lang'], 2)
|
||||||
|
|
||||||
CONF['with_pagination'] = ask('Do you want to enable article pagination ?', bool, CONF['with_pagination'])
|
CONF['with_pagination'] = ask('Do you want to enable article pagination ?', bool, bool(CONF['default_pagination']))
|
||||||
|
|
||||||
if CONF['with_pagination']:
|
if CONF['with_pagination']:
|
||||||
CONF['default_pagination'] = ask('So how many articles per page do you want ?', int, CONF['default_pagination'])
|
CONF['default_pagination'] = ask('So how many articles per page do you want ?', int, CONF['default_pagination'])
|
||||||
|
else:
|
||||||
|
CONF['default_pagination'] = False
|
||||||
|
|
||||||
mkfile = ask('Do you want to generate a Makefile to easily manage your website ?', bool, True)
|
mkfile = ask('Do you want to generate a Makefile to easily manage your website ?', bool, True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue