mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Provide 'all_articles' variable to period pages
This allows 'recent posts' functionality to work properly.
This commit is contained in:
parent
de71f39232
commit
8520840be6
2 changed files with 7 additions and 4 deletions
|
|
@ -526,7 +526,7 @@ class ArticlesGenerator(CachingGenerator):
|
||||||
|
|
||||||
write(save_as, template, context, articles=articles,
|
write(save_as, template, context, articles=articles,
|
||||||
dates=archive, template_name='period_archives',
|
dates=archive, template_name='period_archives',
|
||||||
blog=True, url=url)
|
blog=True, url=url, all_articles=self.articles)
|
||||||
|
|
||||||
for period in 'year', 'month', 'day':
|
for period in 'year', 'month', 'day':
|
||||||
save_as = period_save_as[period]
|
save_as = period_save_as[period]
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,8 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
generator.get_template("period_archives"),
|
generator.get_template("period_archives"),
|
||||||
context, blog=True, articles=articles,
|
context, blog=True, articles=articles,
|
||||||
dates=dates, template_name='period_archives',
|
dates=dates, template_name='period_archives',
|
||||||
url="posts/1970/")
|
url="posts/1970/",
|
||||||
|
all_articles=generator.articles)
|
||||||
|
|
||||||
settings['MONTH_ARCHIVE_SAVE_AS'] = \
|
settings['MONTH_ARCHIVE_SAVE_AS'] = \
|
||||||
'posts/{date:%Y}/{date:%b}/index.html'
|
'posts/{date:%Y}/{date:%b}/index.html'
|
||||||
|
|
@ -444,7 +445,8 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
generator.get_template("period_archives"),
|
generator.get_template("period_archives"),
|
||||||
context, blog=True, articles=articles,
|
context, blog=True, articles=articles,
|
||||||
dates=dates, template_name='period_archives',
|
dates=dates, template_name='period_archives',
|
||||||
url="posts/1970/Jan/")
|
url="posts/1970/Jan/",
|
||||||
|
all_articles=generator.articles)
|
||||||
|
|
||||||
settings['DAY_ARCHIVE_SAVE_AS'] = \
|
settings['DAY_ARCHIVE_SAVE_AS'] = \
|
||||||
'posts/{date:%Y}/{date:%b}/{date:%d}/index.html'
|
'posts/{date:%Y}/{date:%b}/{date:%d}/index.html'
|
||||||
|
|
@ -476,7 +478,8 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
generator.get_template("period_archives"),
|
generator.get_template("period_archives"),
|
||||||
context, blog=True, articles=articles,
|
context, blog=True, articles=articles,
|
||||||
dates=dates, template_name='period_archives',
|
dates=dates, template_name='period_archives',
|
||||||
url="posts/1970/Jan/01/")
|
url="posts/1970/Jan/01/",
|
||||||
|
all_articles=generator.articles)
|
||||||
locale.setlocale(locale.LC_ALL, old_locale)
|
locale.setlocale(locale.LC_ALL, old_locale)
|
||||||
|
|
||||||
def test_nonexistent_template(self):
|
def test_nonexistent_template(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue