1

I want to write some getting started guides for areas of my site in markdown and split them over multiple pages.

My file structure is like so:

/doing-x
  1-blah-blah.md
  2-blah-blah.md
  3-blah-blah.md
/doing-y
  ...

I managed to get mostly what I needed done in nanoc, but I'd like to have next and previous buttons on each page of each section.

I tried the paginator gem but it's for paging an index of blogs.

Toby
  • 9,696
  • 16
  • 68
  • 132
Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84

1 Answers1

0

In the docs, it says page.previous and page.next are just for posts, but I believe they work for collection items too. http://jekyllrb.com/docs/variables/#page-variables

So it would look like:

{% if page.previous %}
  <a href="{{ page.previous.url }}">
    {{ page.previous.title }}
  </a>
{% endif %}

and same thing for next.

Bud Parr
  • 484
  • 3
  • 7