Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stylesheet for tagcloud #268

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ablog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def config_inited(app, config):
)
app.config.matched_blog_posts = matched_patterns

# Add ablog stylesheets to static_path.
static_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "stylesheets"))
app.config.html_static_path.append(static_path)


def builder_inited(app):
if not isinstance(app.builder, StandaloneHTMLBuilder) or app.config.skip_injecting_base_ablog_templates:
Expand Down
36 changes: 36 additions & 0 deletions src/ablog/stylesheets/ablog/tagcloud.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ul.ablog-cloud {
list-style: none;
overflow: auto;
}

ul.ablog-cloud li {
float: left;
height: 20pt;
line-height: 18pt;
margin-right: 5px;
}

ul.ablog-cloud a {
text-decoration: none;
vertical-align: middle;
}

li.ablog-cloud-1 {
font-size: 80%;
}

li.ablog-cloud-2 {
font-size: 95%;
}

li.ablog-cloud-3 {
font-size: 110%;
}

li.ablog-cloud-4 {
font-size: 125%;
}

li.ablog-cloud-5 {
font-size: 140%;
}
1 change: 1 addition & 0 deletions src/ablog/templates/ablog/tagcloud.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% if ablog.tags %}
<div class="ablog-sidebar-item ablog__tags">
<link rel="stylesheet" href="{{ pathto('_static/ablog/tagcloud.css', 1) }}" type="text/css" />
<h3><a href="{{ pathto(ablog.tags.path) }}">{{ gettext('Tags') }}</a></h3>
<ul class="ablog-cloud">
{% for coll in ablog.tags %}
Expand Down
1 change: 1 addition & 0 deletions src/ablog/templates/tagcloud.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{ warning("tagcloud.html is an old template path, that is no longer used by ablog. Please use ablog/tagcloud.html instead.") }}
{% if ablog.tags %}
<div class="ablog-sidebar-item ablog__tags">
<link rel="stylesheet" href="{{ pathto('_static/ablog/tagcloud.css', 1) }}" type="text/css" />
<h3><a href="{{ pathto(ablog.tags.path) }}">{{ gettext('Tags') }}</a></h3>
<ul class="ablog-cloud">
{% for coll in ablog.tags %}
Expand Down