diff --git a/_config.yml b/_config.yml index 694629bdd10..60d4c8ace0c 100644 --- a/_config.yml +++ b/_config.yml @@ -7,6 +7,7 @@ date_format: "%B %d, %Y" sidebar: true # show a sidebar instead of the usual header show_excerpts: false # show article excerpts on the home page +show_related: true # show the previous and next links after every post dark_header: false # keep the top-header dark hide_title: false # hide the site title in the header minimal: false # minima-inspired style without box-shadows diff --git a/_includes/post.html b/_includes/post.html index e47bcb79126..0df9f186ffd 100644 --- a/_includes/post.html +++ b/_includes/post.html @@ -12,6 +12,15 @@

{{ include.post.title }}
read more
{% else %} {{ include.post.content }} + {% if site.show_related %} +

Related posts

+ {% if include.post.next.url %} + + {% endif %} + {% if include.post.previous.url %} + + {% endif %} + {% endif %} {% if include.post.comments != false and site.comments.isso or site.comments.disqus %}
{% if site.comments.isso %}
{% endif %} diff --git a/assets/css/classes.sass b/assets/css/classes.sass index 26e28bbfc45..9b848dad96c 100644 --- a/assets/css/classes.sass +++ b/assets/css/classes.sass @@ -9,6 +9,31 @@ .categories + h1 margin: .1em 0 +{% if site.show_related %} + +.separator + display: flex + color: reduce(100) + margin: 2em -.8em + +.separator::before, .separator::after + display: block + content: " " + margin: .8em + border-top: 1px solid reduce(26) + flex: 1 + +.related span + display: block + color: reduce(100) + +.related a + color: inherit + font-size: 1.2em + font-weight: bold + +{% endif %} + {% if site.sidebar %} .hidden