mirror of
https://github.com/vale981/ablog
synced 2025-03-05 09:11:38 -05:00
Oops, some files were missing in previous commit
This commit is contained in:
parent
cfc491cffd
commit
53fa1c675a
4 changed files with 21 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -11,3 +11,5 @@ dist/
|
|||
docs/_build/
|
||||
|
||||
.DS_Store
|
||||
|
||||
*~
|
||||
|
|
|
@ -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."""
|
||||
|
|
|
@ -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 %}
|
||||
|
|
8
setup.py
8
setup.py
|
@ -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),
|
||||
]
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue