Add continue reading buttons

This commit is contained in:
Oliver Davies 2018-06-04 21:46:35 +01:00
parent 4b5c01e6df
commit 7330fd8226
2 changed files with 25 additions and 2 deletions

View file

@ -27,3 +27,9 @@ ol,
table,
pre
@apply .mb-4
.element-invisible
@apply .absolute .overflow-hidden .break-normal
clip: rect(1px, 1px, 1px, 1px)
height: 1px
width: 1px

View file

@ -25,9 +25,26 @@ use: [posts]
{% include 'post/intro-image' with { page: post } %}
<div class="markdown mb-4">
{{ post.summary|markdown }}
{% if post.blocks.excerpt is not empty %}
{% if post.summary %}
{{ post.summary|markdown }}
<div>
<a
class="button text-grey-darker rounded-lg border border-grey-light bg-grey-lightest no-underline hover:underline focus:underline"
href="{{ post.url }}"
>
Continue reading <span class="element-invisible">about {{ post.title }}
</a>
</div>
{% elseif post.blocks.excerpt %}
{{ post.blocks.excerpt|markdown }}
<div>
<a
class="button text-grey-darker rounded-lg border border-grey-light bg-grey-lightest no-underline hover:underline focus:underline"
href="{{ post.url }}"
>
Continue reading <span class="element-invisible">about {{ post.title }}
</a>
</div>
{% else %}
{{ post.blocks.content|markdown }}
{% endif %}