Skip to content

Commit 6356950

Browse files
committed
added back old templates but with warning
1 parent 66f81bb commit 6356950

14 files changed

+444
-4
lines changed

ablog/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def html_page_context(app, pagename, templatename, context, doctree):
7272
context["feed_title"] = blog.blog_title
7373

7474

75-
def config_inited(app):
75+
def config_inited(app, config):
7676
# Automatically identify any blog posts if a pattern is specified in the config
77-
if isinstance(app.config.blog_post_pattern, str):
78-
app.config.blog_post_pattern = [app.config.blog_post_pattern]
77+
if isinstance(config.blog_post_pattern, str):
78+
config.blog_post_pattern = [config.blog_post_pattern]
7979
matched_patterns = []
80-
for pattern in app.config.blog_post_pattern:
80+
for pattern in config.blog_post_pattern:
8181
pattern = os.path.join(app.srcdir, pattern)
8282
# make sure that blog post paths have forward slashes even on windows
8383
matched_patterns.extend(

ablog/templates/archives.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ warning("archives.html is an old template path, that is no longer used by ablog. Please use ablog/archives.html instead.") }}
2+
{% if ablog.archive %}
3+
<div class="ablog-sidebar-item ablog__archive">
4+
<h3>
5+
<a href="{{ pathto(ablog.archive.docname) }}">{{ gettext('Archives') }}</a>
6+
</h3>
7+
<ul>
8+
{% for coll in ablog.archive %}
9+
{% if coll %}
10+
<li>
11+
<a href="{{ pathto(coll.docname) }}">{{ coll }} ({{ coll|length }})</a>
12+
</li>
13+
{% endif %}
14+
{% endfor %}
15+
</ul>
16+
</div>
17+
{% endif %}

ablog/templates/authors.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{ warning("authors.html is an old template path, that is no longer used by ablog. Please use ablog/authors.html instead.") }}
2+
{% if ablog.author %}
3+
<div class="ablog-sidebar-item ablog__authors">
4+
<h3><a href="{{ pathto(ablog.author.path) }}">{{ gettext('Authors') }}</a></h3>
5+
<ul>
6+
{% for coll in ablog.author %} {% if coll %}
7+
<li>
8+
<a href="{{ pathto(coll.docname) }}">{{ coll }} ({{ coll|length }})</a>
9+
</li>
10+
{% endif %} {% endfor %}
11+
</ul>
12+
</div>
13+
{% endif %}

ablog/templates/catalog.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{ warning("catalog.html is an old template path, that is no longer used by ablog. Please use ablog/catalog.html instead.") }}
2+
{%- extends "page.html" %}
3+
{% block body %}
4+
{% for collection in catalog %}
5+
{% if collection %}
6+
<div class="section ablog__catalog_header">
7+
<h2>
8+
{{ header }}
9+
<a href="{{ pathto(collection.docname) }}">{{ collection }}</a>
10+
</h2>
11+
{% for post in collection %}
12+
<div class="section ablog__catalog_post">
13+
<p>
14+
{% if post.published %}
15+
{{ post.date.strftime(ablog.post_date_format) }}
16+
{% else %}
17+
Draft
18+
{% endif %}
19+
-
20+
<a href="{{ pathto(post.docname) }}{{ anchor(post) }}"
21+
>{{ post.title }}</a
22+
>
23+
</p>
24+
</div>
25+
{% endfor %}
26+
</div>
27+
{% endif %}
28+
{% endfor %}
29+
{% endblock %}

ablog/templates/categories.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ warning("category.html is an old template path, that is no longer used by ablog. Please use ablog/category.html instead.") }}
2+
{% if ablog.category %}
3+
<div class="ablog-sidebar-item ablog__category">
4+
<h3>
5+
<a href="{{ pathto(ablog.category.path) }}">{{ gettext('Categories') }}</a>
6+
</h3>
7+
<ul>
8+
{% for coll in ablog.category %}
9+
{% if coll %}
10+
<li>
11+
<a href="{{ pathto(coll.docname) }}">{{ coll }} ({{ coll|length }})</a>
12+
</li>
13+
{% endif %}
14+
{% endfor %}
15+
</ul>
16+
</div>
17+
{% endif %}

ablog/templates/collection.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{ warning("collection.html is an old template path, that is no longer used by ablog. Please use ablog/collection.html instead.") }}
2+
{%- extends "page.html" %} {% block body %}
3+
<div class="section ablog__collection">
4+
<h1>
5+
{% if archive_feed and fa %}
6+
<a href="{{ pathto(collection.path, 1) }}/atom.xml">
7+
<i class="fa fa-rss fa-rotate-270"></i></a>
8+
{% endif %}
9+
{{ header }}
10+
{% if collection.href %}
11+
<a href="{{ collection.href }}">{{ collection }}</a>
12+
{% else %}
13+
{{ collection }}
14+
{% endif %}
15+
</h1>
16+
{% if ablog.blog_archive_titles %}
17+
{% for post in collection %}
18+
<div class="section ablog__collection_meta">
19+
<p>
20+
{% if post.published %}
21+
{{ post.date.strftime(ablog.post_date_format) }}
22+
{% else %}
23+
Draft
24+
{% endif %}
25+
-
26+
<a href="{{ pathto(post.docname) }}{{ anchor(post) }}">{{ post.title }}</a>
27+
</p>
28+
</div>
29+
{% endfor %}
30+
{% else %}
31+
{% for post in collection %}
32+
<div class="section ablog-post">
33+
<h2 class="ablog-post-title">
34+
<a href="{{ pathto(post.docname) }}{{ anchor(post) }}">{{ post.title }}</a>
35+
</h2>
36+
<ul class="ablog-archive">
37+
<li>
38+
{% if post.published %}
39+
{% if fa %}
40+
<i class="fa fa-calendar"></i>
41+
{% endif %}
42+
{{ post.date.strftime(ablog.post_date_format) }}
43+
{% else %}
44+
{% if fa %}
45+
<i class="fa fa-pencil"></i>
46+
{% endif %}
47+
{% if post.date %}
48+
{{ post.date.strftime(ablog.post_date_format) }}
49+
{% else %}
50+
Draft
51+
{% endif %}
52+
{% endif %}
53+
</li>
54+
{% include "ablog/postcard2.html" %}
55+
</ul>
56+
{{ post.to_html(collection.docname) }}
57+
<p class="ablog-post-expand"><a href="{{ pathto(post.docname) }}"><em>{{ _("Read more ...") }}</em></a></p>
58+
<hr/>
59+
</div>
60+
{% endfor %}
61+
{% endif %}
62+
</div>
63+
{% endblock %}

ablog/templates/languages.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{ warning("languages.html is an old template path, that is no longer used by ablog. Please use ablog/languages.html instead.") }}
2+
{% if ablog.language %}
3+
<div class="ablog__languages">
4+
<h3>
5+
<a href="{{ pathto(ablog.language.path) }}">{{ gettext('Languages') }}</a>
6+
</h3>
7+
<ul>
8+
{% for coll in ablog.language %} {% if coll %}
9+
<li>
10+
<a href="{{ pathto(coll.docname) }}">{{ coll }} ({{ coll|length }})</a>
11+
</li>
12+
{% endif %} {% endfor %}
13+
</ul>
14+
</div>
15+
{% endif %}

ablog/templates/locations.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{ warning("locations.html is an old template path, that is no longer used by ablog. Please use ablog/locations.html instead.") }}
2+
{% if ablog.location %}
3+
<div class="ablog__locations">
4+
<h3>
5+
<a href="{{ pathto(ablog.location.path) }}">{{ gettext('Locations') }}</a>
6+
</h3>
7+
<ul>
8+
{% for coll in ablog.location %}
9+
{% if coll %}
10+
<li>
11+
<a href="{{ pathto(coll.docname) }}">{{ coll }} ({{ coll|length }})</a>
12+
</li>
13+
{% endif %}
14+
{% endfor %}
15+
</ul>
16+
</div>
17+
{% endif %}

ablog/templates/postcard.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{ warning("postcard.html is an old template path, that is no longer used by ablog. Please use ablog/postcard.html instead.") }}
2+
{% if pagename in ablog %}
3+
<div class="ablog__postcard">
4+
{% set fa = ablog.fontawesome %}
5+
{% set post = ablog[pagename] %}
6+
<h2>
7+
{% if post.published %}
8+
{% if fa %}
9+
<i class="fa fa-calendar"></i>
10+
{% endif %}
11+
{{ post.date.strftime(ablog.post_date_format) }}
12+
{% else %}
13+
{% if fa %}
14+
<i class="fa fa-pencil"></i>
15+
{% endif %}
16+
{% if post.date %}
17+
{{ post.date.strftime(ablog.post_date_format)}}
18+
{% else %}
19+
Draft
20+
{% endif %}
21+
{% endif %}
22+
</h2>
23+
<ul>
24+
{% include "ablog/postcard2.html" %}
25+
</ul>
26+
</div>
27+
{% endif %}

ablog/templates/postcard2.html

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
{{ warning("postcard2.html is an old template path, that is no longer used by ablog. Please use ablog/postcard2.html instead.") }}
2+
{% if post.published and post.date != post.update %}
3+
<div class="ablog__postcard2">
4+
<li id="published">
5+
<span>
6+
{% if fa %}
7+
<i class="fa fa-pencil-square-o"></i>
8+
{% else %}
9+
{{gettext('Update') }}:
10+
{% endif %}
11+
</span>
12+
{{ post.update.strftime(ablog.post_date_format) }}
13+
</li>
14+
{% endif %}
15+
{% if post.author %}
16+
<li id="ablog-sidebar-item author ablog__author">
17+
<span>
18+
{% if fa %}
19+
<i class="fa-fw fa fa-user"></i>
20+
{% else %}
21+
{{ gettext('Author')}}:
22+
{% endif %}
23+
</span>
24+
{% for coll in post.author %}
25+
{% if coll|length %}
26+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>
27+
{% if loop.index < post.author|length %}
28+
,
29+
{% endif %}
30+
{% else %}
31+
{{ coll }}
32+
{% if loop.index < post.author|length %}
33+
,
34+
{% endif %}
35+
{% endif %}
36+
{% endfor %}
37+
</li>
38+
{% endif %}
39+
{% if post.location %}
40+
<li id="ablog-sidebar-item location ablog__location">
41+
<span>
42+
{% if fa %}
43+
<i class="fa-fw fa fa-location-arrow"></i>
44+
{% else %}
45+
{{gettext('Location') }}:
46+
{% endif %}
47+
</span>
48+
{% for coll in post.location %}
49+
{% if coll|length %}
50+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>
51+
{% if loop.index < post.location|length %}
52+
,
53+
{% endif %}
54+
{% else %}
55+
{{ coll }}
56+
{% if loop.index < post.location|length %}
57+
,
58+
{% endif %}
59+
{% endif %}
60+
{% endfor %}
61+
</li>
62+
{% endif %}
63+
{% if post.language %}
64+
<li id="ablog-sidebar-item language ablog__language">
65+
<span>
66+
{% if fa %}
67+
<i class="fa-fw fa fa-language"></i>
68+
{% else %}
69+
{{gettext('Language') }}:
70+
{% endif %}
71+
</span>
72+
{% for coll in post.language %}
73+
{% if coll|length %}
74+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>
75+
{% if loop.index < post.language|length %}
76+
,
77+
{% endif %}
78+
{% else %}
79+
{{ coll }}
80+
{% if loop.index < post.language|length %}
81+
,
82+
{% endif %}
83+
{% endif %}
84+
{% endfor %}
85+
</li>
86+
{% endif %}
87+
{% if post.category %}
88+
<li id="ablog-sidebar-item category ablog__category">
89+
<span>
90+
{% if fa %}
91+
<i class="fa-fw fa fa-folder-open"></i>
92+
{% else %}
93+
{{ gettext('Category') }}:
94+
{% endif %}
95+
</span>
96+
{% for coll in post.category %}
97+
{% if coll|length %}
98+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>
99+
{% if loop.index < post.category|length %}
100+
,
101+
{% endif %}
102+
{% else %}
103+
{{ coll }}
104+
{% if loop.index < post.category|length %}
105+
,
106+
{% endif %}
107+
{% endif %}
108+
{% endfor %}
109+
</li>
110+
{% endif %}
111+
{% if post.tags %}
112+
<li id="ablog-sidebar-item tags ablog__tags">
113+
<span>
114+
{% if post.tags|length > 1 %}
115+
{% if fa %}
116+
<i class="fa-fw fa fa-tags"></i>
117+
{% else %}
118+
{{ gettext('Tags') }}:
119+
{% endif %}
120+
{% else %}
121+
{% if fa %}
122+
<i class="fa-fw fa fa-tag"></i>
123+
{% else %}
124+
{{ gettext('Tag') }}:
125+
{% endif %}{% endif %}
126+
</span>
127+
{% for coll in post.tags %}
128+
{% if coll|length %}
129+
<a href="{{ pathto(coll.docname) }}">{{ coll }}</a>
130+
{% if loop.index < post.tags|length %}
131+
{% endif %}
132+
{% else %}
133+
{{ coll }}
134+
{% if loop.index < post.tags|length %}
135+
{% endif %}
136+
{% endif %}
137+
{% endfor %}
138+
</li>
139+
{% endif %}
140+
{% if ablog.disqus_shortname and (ablog[pagename].published or ablog.disqus_drafts) %}
141+
<li id="ablog-sidebar-item comments ablog__comments">
142+
<script type="text/javascript">
143+
var disqus_shortname = "{{ ablog.disqus_shortname }}";
144+
145+
(function () {
146+
var s = document.createElement("script");
147+
s.async = true;
148+
s.type = "text/javascript";
149+
s.src = "//" + disqus_shortname + ".disqus.com/count.js";
150+
(
151+
document.getElementsByTagName("HEAD")[0] ||
152+
document.getElementsByTagName("BODY")[0]
153+
).appendChild(s);
154+
})();
155+
</script>
156+
{% if fa %}
157+
<i class="fa-fw fa fa-comments"></i>
158+
{% endif %}
159+
<a href="{% if pagename != post.docname %} {{ pathto(post.docname) }} {% endif %} #disqus_thread" data-disqus-identifier="/{{post.docname}}/">
160+
{% if not fa %}
161+
Comments
162+
{% endif %}
163+
</a >
164+
</li>
165+
</div>
166+
{% endif %}

0 commit comments

Comments
 (0)