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,4 +21,5 @@ gem "minima", "~> 2.0"
21 # If you have any plugins, put them here! 21 # If you have any plugins, put them here!
22 group :jekyll_plugins do 22 group :jekyll_plugins do
23 gem 'octopress-minify-html' 23 gem 'octopress-minify-html'
  24 + gem 'octopress-paginate'
24 end 25 end
@@ -50,6 +50,8 @@ GEM @@ -50,6 +50,8 @@ GEM
50 html_press (~> 0.8) 50 html_press (~> 0.8)
51 jekyll (>= 2.0) 51 jekyll (>= 2.0)
52 octopress-hooks 52 octopress-hooks
  53 + octopress-paginate (1.2.0)
  54 + octopress-hooks
53 pathutil (0.14.0) 55 pathutil (0.14.0)
54 forwardable-extended (~> 2.6) 56 forwardable-extended (~> 2.6)
55 public_suffix (2.0.4) 57 public_suffix (2.0.4)
@@ -70,6 +72,7 @@ DEPENDENCIES @@ -70,6 +72,7 @@ DEPENDENCIES
70 jekyll (= 3.3.1) 72 jekyll (= 3.3.1)
71 minima (~> 2.0) 73 minima (~> 2.0)
72 octopress-minify-html 74 octopress-minify-html
  75 + octopress-paginate
73 76
74 RUBY VERSION 77 RUBY VERSION
75 ruby 2.4.0p0 78 ruby 2.4.0p0
@@ -52,6 +52,7 @@ markdown: kramdown @@ -52,6 +52,7 @@ markdown: kramdown
52 theme: minima 52 theme: minima
53 gems: 53 gems:
54 - octopress-minify-html 54 - octopress-minify-html
  55 + - octopress-paginate
55 exclude: 56 exclude:
56 - Gemfile 57 - Gemfile
57 - Gemfile.lock 58 - Gemfile.lock
_includes/paginator.html 0 → 100644
@@ -0,0 +1,12 @@ @@ -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>
@@ -5,7 +5,7 @@ layout: default @@ -5,7 +5,7 @@ layout: default
5 <div class="page-nav"> 5 <div class="page-nav">
6 <span> 6 <span>
7 {% if page.next.url %} 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 {% endif %} 9 {% endif %}
10 </span> 10 </span>
11 <span class="prev"> 11 <span class="prev">
@@ -2,13 +2,18 @@ @@ -2,13 +2,18 @@
2 title: Compte-rendus 2 title: Compte-rendus
3 tags: footer 3 tags: footer
4 permalink: /cr/ 4 permalink: /cr/
  5 +paginate:
  6 + collection: crs
  7 + reversed: true
  8 + limit: false
  9 + lang: fr
5 --- 10 ---
6 11
7 <p>Vous trouverez ici les comptes-rendus de nos réunions rédigés par notre secrétaire (la plupart du temps).</p> 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 <ul class="post-list"> 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 <li> 17 <li>
13 <h2> 18 <h2>
14 <a class="post-link" href="{{ cr.url | relative_url }}"> 19 <a class="post-link" href="{{ cr.url | relative_url }}">
@@ -17,5 +22,6 @@ permalink: /cr/ @@ -17,5 +22,6 @@ permalink: /cr/
17 </h2> 22 </h2>
18 </li> 23 </li>
19 {% endfor %} 24 {% endfor %}
  25 +{% include paginator.html paginator=paginator %}
20 </ul> 26 </ul>
21 27