mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1453 from arty-name/period-archives-syntax-errors
Fix #1405: No error message for invalid syntax in period_archives.html
This commit is contained in:
commit
389d0cec52
1 changed files with 5 additions and 2 deletions
|
|
@ -28,6 +28,9 @@ from pelican import signals
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PelicanTemplateNotFound(Exception):
|
||||
pass
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Generator(object):
|
||||
"""Baseclass generator"""
|
||||
|
|
@ -87,7 +90,7 @@ class Generator(object):
|
|||
try:
|
||||
self._templates[name] = self.env.get_template(name + '.html')
|
||||
except TemplateNotFound:
|
||||
raise Exception('[templates] unable to load %s.html from %s'
|
||||
raise PelicanTemplateNotFound('[templates] unable to load %s.html from %s'
|
||||
% (name, self._templates_path))
|
||||
return self._templates[name]
|
||||
|
||||
|
|
@ -356,7 +359,7 @@ class ArticlesGenerator(CachingGenerator):
|
|||
"""Generate per-year, per-month, and per-day archives."""
|
||||
try:
|
||||
template = self.get_template('period_archives')
|
||||
except Exception:
|
||||
except PelicanTemplateNotFound:
|
||||
template = self.get_template('archives')
|
||||
|
||||
period_save_as = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue