diff --git a/README.md b/README.md index 1c16bcf695..d37fc9f9f5 100644 --- a/README.md +++ b/README.md @@ -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 `` diff --git a/_includes/links_to_prev_next.html b/_includes/links_to_prev_next.html new file mode 100644 index 0000000000..bd7edae6f8 --- /dev/null +++ b/_includes/links_to_prev_next.html @@ -0,0 +1,13 @@ +
+
+

+ {% if page.previous.url %} + ⇠ {{page.previous.title}} + {% endif %} +

+

+ {% if page.next.url %} + {{page.next.title}} ⇢ + {% endif %} +

+
diff --git a/_layouts/post.html b/_layouts/post.html index c9a03be7ba..fb16140ba5 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -30,6 +30,10 @@

{{ page.title | escape }} {{ content }} + {%- if site.links_to_prev_next -%} + {%- include links_to_prev_next.html -%} + {%- endif -%} + {%- if site.disqus.shortname -%} {%- include disqus_comments.html -%} {%- endif -%}