Oops, some files were missing in previous commit

This commit is contained in:
Luc Saffre 2014-07-25 21:44:08 +03:00
parent cfc491cffd
commit 53fa1c675a
4 changed files with 21 additions and 10 deletions

2
.gitignore vendored
View file

@ -11,3 +11,5 @@ dist/
docs/_build/
.DS_Store
*~

View file

@ -9,6 +9,7 @@ from docutils.parsers.rst import directives
from sphinx.util.nodes import set_source_info
from sphinx.util.compat import Directive
from sphinx.environment import dummy_reporter
from sphinx.locale import _
from .ablog import ABlog, CONFIG
@ -269,20 +270,19 @@ def generate_archive_pages(app):
for redirect in post.redirect:
yield (redirect, {'redirect': post.docname, 'post': post},
'redirect.html')
for title, header, catalog in [
(None, 'Posts by', ablog.author),
(None, 'Posts from', ablog.location),
(None, 'Posts in', ablog.category),
('All posts', 'Posted in', ablog.archive),
(None, 'Posts tagged', ablog.tags),]:
(None, _('Posts by'), ablog.author),
(None, _('Posts from'), ablog.location),
(None, _('Posts in'), ablog.category),
(_('All posts'), _('Posted in'), ablog.archive),
(None, _('Posts tagged'), ablog.tags),]:
if not len(catalog):
continue
context = {
'parents': [],
'title': title or '{} {}'.format(header, catalog),
'title': title or u'{} {}'.format(header, catalog),
'header': header,
'catalog': catalog,
'summary': True,
@ -296,7 +296,7 @@ def generate_archive_pages(app):
context = {
'parents': [],
'title': '{} {}'.format(header, collection),
'title': u'{} {}'.format(header, collection),
'header': header,
'catalog': [collection],
'summary': True,
@ -377,6 +377,9 @@ def setup(app):
app.connect('doctree-resolved', process_postlist)
app.connect('html-collect-pages', generate_archive_pages)
ld = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'locale')
app.config.locale_dirs.append(ld)
def get_html_templates_path():
"""Return path to the folder containing ABlog templates."""

View file

@ -43,7 +43,7 @@
{% include "postcard2.html" %}</ul>
{{ post.summary(archive.docname) }}
<p><a href="{{ pathto(post.docname) }}">Read more ...</a></p>
<p><a href="{{ pathto(post.docname) }}">{{ _("Read more ...") }}</a></p>
<hr>
</div>
{% endfor %}

View file

@ -1,4 +1,4 @@
from distutils.core import setup
from setuptools import setup
__version__ = ''
with open('ablog/__init__.py') as inp:
@ -36,4 +36,10 @@ setup(
],
provides=['ablog ({0:s})'.format(__version__)],
requires=['Werkzeug', 'Sphinx'],
message_extractors={
'ablog': [
('**.html', 'jinja2', None),
('**.py', 'python', None),
]
},
)