Skip to content
Snippets Groups Projects
Verified Commit c5a21459 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

Minimize bandwidth utilization for posts

We don't need to download a picture that we don't show anyway.

This patch simply add a HTML5 picture tag, that loads the blog cover for 
bigger sites and has a inline encoded 1x1 transparent pixel as fallback 
for mobile devices.
parent 4878ef83
No related merge requests found
......@@ -3,7 +3,13 @@ layout: default
---
<article class="post-container post-container--single">
<header class="post-header">
{% if page.cover %}<img class="post-cover" src="{{ site.baseurl }}/{{ page.cover }}" alt="Cover image for this blog post"> {% endif %}
{% if page.cover %}
<picture class="post-cover">
<source srcset="{{ site.baseurl }}/{{ page.cover }}" media="(min-width: 960px)">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh" alt="Cover image for this blog post">
</picture>
{% endif %}
<div class="post-meta">
<time datetime="{{ page.date | date: "%Y-%m-%d %H:%M" }}" class="post-meta__date date">{{ page.date | date: "%-d %b %Y" }}</time>
{% if page.tags.size > 0 %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment