Commit b7e9e41f91c1375eaa6f1331b2a90a2dbf15749c

Authored by Geoffrey PREUD'HOMME
1 parent 4ab50938

Pagination

Problème : Ça pollue la liste des pages et le footer de
[TITRE PAGE] - page X
et c'est embettant
... ... @@ -21,4 +21,5 @@ gem "minima", "~> 2.0"
21 21 # If you have any plugins, put them here!
22 22 group :jekyll_plugins do
23 23 gem 'octopress-minify-html'
  24 + gem 'octopress-paginate'
24 25 end
... ...
Gemfile.lock
... ... @@ -50,6 +50,8 @@ GEM
50 50 html_press (~> 0.8)
51 51 jekyll (>= 2.0)
52 52 octopress-hooks
  53 + octopress-paginate (1.2.0)
  54 + octopress-hooks
53 55 pathutil (0.14.0)
54 56 forwardable-extended (~> 2.6)
55 57 public_suffix (2.0.4)
... ... @@ -70,6 +72,7 @@ DEPENDENCIES
70 72 jekyll (= 3.3.1)
71 73 minima (~> 2.0)
72 74 octopress-minify-html
  75 + octopress-paginate
73 76  
74 77 RUBY VERSION
75 78 ruby 2.4.0p0
... ...
_config.yml
... ... @@ -52,6 +52,7 @@ markdown: kramdown
52 52 theme: minima
53 53 gems:
54 54 - octopress-minify-html
  55 + - octopress-paginate
55 56 exclude:
56 57 - Gemfile
57 58 - Gemfile.lock
... ...
_includes/paginator.html 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 + <div class="page-nav">
  2 + <span>
  3 + {% if include.paginator.previous_page %}
  4 + <a href="{{ include.paginator.previous_page_path}}">&laquo; Suivants</a>
  5 + {% endif %}
  6 + </span>
  7 + <span class="prev">
  8 + {% if include.paginator.next_page %}
  9 + <a href="{{ include.paginator.next_page_path }}">Précédents &raquo;</a>
  10 + {% endif %}
  11 + </span>
  12 + </div>
... ...
_layouts/cr.html
... ... @@ -5,7 +5,7 @@ layout: default
5 5 <div class="page-nav">
6 6 <span>
7 7 {% if page.next.url %}
8   - <a class="next" href="{{page.next.url}}">&laquo; {% include date.html date=page.next.date %}</a>
  8 + <a href="{{page.next.url}}">&laquo; {% include date.html date=page.next.date %}</a>
9 9 {% endif %}
10 10 </span>
11 11 <span class="prev">
... ...
crs.html
... ... @@ -2,13 +2,18 @@
2 2 title: Compte-rendus
3 3 tags: footer
4 4 permalink: /cr/
  5 +paginate:
  6 + collection: crs
  7 + reversed: true
  8 + limit: false
  9 + lang: fr
5 10 ---
6 11  
7 12 <p>Vous trouverez ici les comptes-rendus de nos réunions rédigés par notre secrétaire (la plupart du temps).</p>
8 13  
9 14 <ul class="post-list">
10   -{% assign crs = site.crs | sort: 'date' | reverse %}
11   -{% for cr in crs %}
  15 +{% include paginator.html paginator=paginator %}
  16 +{% for cr in paginator.crs %}
12 17 <li>
13 18 <h2>
14 19 <a class="post-link" href="{{ cr.url | relative_url }}">
... ... @@ -17,5 +22,6 @@ permalink: /cr/
17 22 </h2>
18 23 </li>
19 24 {% endfor %}
  25 +{% include paginator.html paginator=paginator %}
20 26 </ul>
21 27  
... ...