mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Pagination - simplification
This commit is contained in:
parent
dc6771d604
commit
60756678ab
1 changed files with 3 additions and 3 deletions
|
|
@ -17,7 +17,7 @@ from pelican.paginator import Paginator
|
||||||
_TEMPLATES = ('index', 'tag', 'tags', 'article', 'category', 'categories',
|
_TEMPLATES = ('index', 'tag', 'tags', 'article', 'category', 'categories',
|
||||||
'archives', 'page')
|
'archives', 'page')
|
||||||
_DIRECT_TEMPLATES = ('index', 'tags', 'categories', 'archives')
|
_DIRECT_TEMPLATES = ('index', 'tags', 'categories', 'archives')
|
||||||
_PAGINATED_DIRECT_TEMPLATES = ('index', 'tag', 'category')
|
_PAGINATED_DIRECT_TEMPLATES = ('index', )
|
||||||
|
|
||||||
|
|
||||||
class Generator(object):
|
class Generator(object):
|
||||||
|
|
@ -162,7 +162,7 @@ class ArticlesGenerator(Generator):
|
||||||
|
|
||||||
# and subfolders after that
|
# and subfolders after that
|
||||||
for tag, articles in self.tags.items():
|
for tag, articles in self.tags.items():
|
||||||
if self.settings.get('WITH_PAGINATION') and 'tag' in _PAGINATED_DIRECT_TEMPLATES:
|
if self.settings.get('WITH_PAGINATION'):
|
||||||
articles_paginator = Paginator(articles,
|
articles_paginator = Paginator(articles,
|
||||||
self.settings.get('DEFAULT_PAGINATION'),
|
self.settings.get('DEFAULT_PAGINATION'),
|
||||||
self.settings.get('DEFAULT_ORPHANS'))
|
self.settings.get('DEFAULT_ORPHANS'))
|
||||||
|
|
@ -176,7 +176,7 @@ class ArticlesGenerator(Generator):
|
||||||
tag=tag, articles=articles)
|
tag=tag, articles=articles)
|
||||||
|
|
||||||
for cat, articles in self.categories:
|
for cat, articles in self.categories:
|
||||||
if self.settings.get('WITH_PAGINATION') and 'tag' in _PAGINATED_DIRECT_TEMPLATES:
|
if self.settings.get('WITH_PAGINATION'):
|
||||||
articles_paginator = Paginator(articles,
|
articles_paginator = Paginator(articles,
|
||||||
self.settings.get('DEFAULT_PAGINATION'),
|
self.settings.get('DEFAULT_PAGINATION'),
|
||||||
self.settings.get('DEFAULT_ORPHANS'))
|
self.settings.get('DEFAULT_ORPHANS'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue