Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ minima:
date_format: "%b %-d, %Y"
```

### Add links to previous and next post

in `_config.yml`: `links_to_prev_next: true` (default is `false`)

### Extending the `<head />`

Expand Down
13 changes: 13 additions & 0 deletions _includes/links_to_prev_next.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<hr>
<div class="post-nav" style="display: flex; justify-content: space-between; flex-wrap: wrap;">
<p style="flex: 1 1 0; width: 45%; padding-right: 0.5em;">
{% if page.previous.url %}
<a href="{{page.previous.url}}">&#8672;&nbsp;{{page.previous.title}}</a>
{% endif %}
</p>
<p style="flex: 1 1 0; width: 45%; padding-left: 0.5em; text-align: right">
{% if page.next.url %}
<a href="{{page.next.url}}">{{page.next.title}}&nbsp;&#8674;</a>
{% endif %}
</p>
</div>
4 changes: 4 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
{{ content }}
</div>

{%- if site.links_to_prev_next -%}
{%- include links_to_prev_next.html -%}
{%- endif -%}

{%- if site.disqus.shortname -%}
{%- include disqus_comments.html -%}
{%- endif -%}
Expand Down