Improved category name for reading optimisation

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-06-09 17:27:24 +02:00
parent 4d8e0c4be7
commit 51442ee1dc
5 changed files with 34 additions and 29 deletions

View File

@ -125,7 +125,7 @@ ul.list-unstyled li {
// limit width of article to optimise reading experience
@include media-breakpoint-up(md) {
article, .index, .category {
.reading-optimised {
width: 550px;
margin-left: auto;
margin-right: auto;

View File

@ -2,29 +2,31 @@
layout: default
---
{{ content }}
<ul class="post-list list-unstyled">
{% assign categories = page.categories | split:',' %}
{% assign posts = site.categories[categories.first] %}
{% for category in categories %}
{% if category != categories.first %}
{% assign posts = site.categories[category] | concat: posts %}
{% endif %}
{% endfor %}
{% assign posts = posts | sort: 'date' | reverse %}
{% for post in posts %}
<li class="mb-4">
<p class="small text-muted">
<span class="far fa-calendar-alt"></span>
<time datetime="{{ post.date | date_to_xmlschema }}">
{{ post.date | date: "%b %-d, %Y" }}
</time>
• {% include reading-time.html content=post.content %}
</p>
<div class="reading-optimised">
{{ content }}
<ul class="post-list list-unstyled">
{% assign categories = page.categories | split:',' %}
{% assign posts = site.categories[categories.first] %}
{% for category in categories %}
{% if category != categories.first %}
{% assign posts = site.categories[category] | concat: posts %}
{% endif %}
{% endfor %}
{% assign posts = posts | sort: 'date' | reverse %}
{% for post in posts %}
<li class="mb-4">
<p class="small text-muted">
<span class="far fa-calendar-alt"></span>
<time datetime="{{ post.date | date_to_xmlschema }}">
{{ post.date | date: "%b %-d, %Y" }}
</time>
• {% include reading-time.html content=post.content %}
</p>
<p class="h4 post-title">
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
</p>
</li>
{% endfor %}
</ul>
<p class="h4 post-title">
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
</p>
</li>
{% endfor %}
</ul>
</div>

View File

@ -1,7 +1,8 @@
---
layout: default
---
<div class="category">
<div class="reading-optimised">
{{ content }}
<ul class="post-list list-unstyled">
{% for post in site.categories[page.category] %}

View File

@ -1,7 +1,8 @@
---
layout: default
---
<article class="post">
<article class="post reading-optimised">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>

View File

@ -1,12 +1,13 @@
---
layout: default
---
{% if page.date_modified %}
{% assign modified = page.date_modified %}
{% else %}
{% assign modified = page.date %}
{% endif %}
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<article class="post reading-optimised" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>