{% comment %} Page links, inspired by the example at the bottom of https://jekyllrb.com/docs/pagination/. {% endcomment %} {% if site.posts.size != 0 %} {% comment %} Link to page 1 is tricky. If site.paginate_path is used, then we cannot simply use /. This is a silly attempt to get the proper page 1 link. {% endcomment %} {% if paginator.page == 1 %} {% assign page1_url = page.url %} {% else %} {% assign page1_url = page.url | split: '/' | pop | join: '/' | append: '/' %} {% endif %} {% endif %}