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
markdown: kramdown
permalink: /:year/:month/:day/:title.html
permalink: /:year/:month/:day/:title/
paginate: 8
paginate_path: "post/page:num/"
paginate_path: "post/page/:num/"
sass:
style: :compressed

6
_includes/paginator.html

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

Loading…
Cancel
Save