Skip to content

Commit 8600e78

Browse files
committed
Add stylesheet for tagcloud
1 parent 6b867ad commit 8600e78

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

src/ablog/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def config_inited(app, config):
9191
)
9292
app.config.matched_blog_posts = matched_patterns
9393

94+
# Add ablog stylesheets to static_path.
95+
static_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "stylesheets"))
96+
app.config.html_static_path.append(static_path)
97+
9498

9599
def builder_inited(app):
96100
if not isinstance(app.builder, StandaloneHTMLBuilder) or app.config.skip_injecting_base_ablog_templates:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
ul.ablog-cloud {
2+
list-style: none;
3+
overflow: auto;
4+
}
5+
6+
ul.ablog-cloud li {
7+
float: left;
8+
height: 20pt;
9+
line-height: 18pt;
10+
margin-right: 5px;
11+
}
12+
13+
ul.ablog-cloud a {
14+
text-decoration: none;
15+
vertical-align: middle;
16+
}
17+
18+
li.ablog-cloud-1 {
19+
font-size: 80%;
20+
}
21+
22+
li.ablog-cloud-2 {
23+
font-size: 95%;
24+
}
25+
26+
li.ablog-cloud-3 {
27+
font-size: 110%;
28+
}
29+
30+
li.ablog-cloud-4 {
31+
font-size: 125%;
32+
}
33+
34+
li.ablog-cloud-5 {
35+
font-size: 140%;
36+
}

src/ablog/templates/ablog/tagcloud.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% if ablog.tags %}
22
<div class="ablog-sidebar-item ablog__tags">
3+
<link rel="stylesheet" href="/_static/ablog/tagcloud.css" type="text/css" />
34
<h3><a href="{{ pathto(ablog.tags.path) }}">{{ gettext('Tags') }}</a></h3>
45
<ul class="ablog-cloud">
56
{% for coll in ablog.tags %}

src/ablog/templates/tagcloud.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{ warning("tagcloud.html is an old template path, that is no longer used by ablog. Please use ablog/tagcloud.html instead.") }}
22
{% if ablog.tags %}
33
<div class="ablog-sidebar-item ablog__tags">
4+
<link rel="stylesheet" href="/_static/ablog/tagcloud.css" type="text/css" />
45
<h3><a href="{{ pathto(ablog.tags.path) }}">{{ gettext('Tags') }}</a></h3>
56
<ul class="ablog-cloud">
67
{% for coll in ablog.tags %}

0 commit comments

Comments
 (0)