Skip to content

Commit 0f1dbdb

Browse files
committed
Render thumbs as jpeg to reduce image file sizes
1 parent 6c1ea87 commit 0f1dbdb

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

page/templates/blog/medium_listing.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="col-12 col-sm-5 listing-image">
55
<a href="{{page.url}}" title="{{page.title}}">
66
{% if page.header_image %}
7-
{% image page.header_image fill-1200x800 %}
7+
{% image page.header_image fill-1200x800 format-jpeg %}
88
{% else %}
99
<div class="placeholder"></div>
1010
{% endif %}
@@ -16,9 +16,13 @@
1616
</a>
1717
</div>
1818
<div class="col-12 col-sm-7 description">
19-
<h3 class="title"><a href="{{page.url}}" title="{{page.title}}">{{page.title}}</a></h3>
19+
<h3 class="title">
20+
<a href="{{page.url}}" title="{{page.title}}">{{page.title}}</a>
21+
</h3>
2022
{% if page.subtitle %}
21-
<h5 class="subtitle"><a href="{{page.url}}" title="{{page.title}}">{{page.subtitle}}</a></h5>
23+
<h5 class="subtitle">
24+
<a href="{{page.url}}" title="{{page.title}}">{{page.subtitle}}</a>
25+
</h5>
2226
{% endif %}
2327
{% include "blog/meta_tags.html" %}
2428
</div>

page/templates/blog/sidebar_listing.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<a href="{{post.url}}" title="{{post.title}}">
77
<div class="thumb">
88
{% if post.header_image %}
9-
{% image post.header_image fill-1200x800 %}
9+
{% image post.header_image fill-1200x800 format-jpeg %}
1010
{% else %}
11-
<div class="placeholder"></div>
11+
<div class="placeholder"></div>
1212
{% endif %}
1313
{% if post.category.title != "Blog Posts" %}
14-
<label class="category-badge">
15-
{{post.category.title|unpluralize_category}}
16-
</label>
14+
<label class="category-badge">
15+
{{post.category.title|unpluralize_category}}
16+
</label>
1717
{% endif %}
1818
</div>
1919
</a>
@@ -22,10 +22,12 @@ <h6>
2222
<a href="{{post.url}}" title="{{post.title}}">{{post.sidebar_title}}</a>
2323
</h6>
2424
{% if post.author %}
25-
<small class="byline">By {% author post.author %}</small>
25+
<small class="byline">By {% author post.author %}</small>
2626
{% endif %}
2727
{% if post.category.title == "News" %}
28-
<small class="post-date"><i class="fa fa-clock"></i> {{post.post_date|date:"M d"}}</small>
28+
<small class="post-date">
29+
<i class="fa fa-clock"></i> {{post.post_date|date:"M d"}}
30+
</small>
2931
{% endif %}
3032
</div>
3133
</div>

spritesanddice/templatetags/menu_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def blog_posts(context, blog_folder=None, tag=None, user=None, page_number=1):
4848
query = query.live().public().order_by('-go_live_at')
4949

5050
# Pagination
51-
paginator = Paginator(query, 25)
51+
paginator = Paginator(query, 20)
5252
try:
5353
pages = paginator.page(page_number)
5454
except PageNotAnInteger: # First Page

0 commit comments

Comments
 (0)