Browse Source

paginator url

master
sipp11 10 years ago
parent
commit
73cab64c48
  1. 4
      _config.yml
  2. 6
      _includes/paginator.html

4
_config.yml

@ -12,10 +12,10 @@ github_username: sipp11
# Build settings # Build settings
markdown: kramdown markdown: kramdown
permalink: /:year/:month/:day/:title.html permalink: /:year/:month/:day/:title/
paginate: 8 paginate: 8
paginate_path: "post/page:num/" paginate_path: "post/page/:num/"
sass: sass:
style: :compressed style: :compressed

6
_includes/paginator.html

@ -5,14 +5,14 @@
{% else %} {% else %}
<span>&laquo; Prev</span> <span>&laquo; Prev</span>
{% endif %} {% endif %}
{{ site.baseurl }}
{% for page in (1..paginator.total_pages) %} {% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %} {% if page == paginator.page %}
<em>{{ page }}</em> <em>{{ page }}</em>
{% elsif page == 1 %} {% elsif page == 1 %}
<a href="{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a> <a href="{{ '/index.html' }}">{{ page }}</a>
{% else %} {% else %}
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a> <a href="/{{ site.paginate_path | replace: ':num', page }}"> {{ page }}</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

Loading…
Cancel
Save