minimal-mistakes-jekyll 4.0.4 → 4.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,148 +1,151 @@
1
- # [Minimal Mistakes Jekyll Theme](https://mmistakes.github.io/minimal-mistakes/)
2
-
3
- [![GitHub release](https://img.shields.io/gem/v/minimal-mistakes-jekyll.svg)](https://github.com/mmistakes/minimal-mistakes/releases) [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/mmistakes/minimal-mistakes/master/LICENSE)
4
-
5
- Minimal Mistakes is a flexible two-column Jekyll theme. Perfect for hosting your personal site, blog, or portfolio on GitHub or self-hosting on your own server. As the name implies --- styling is purposely minimalistic to be enhanced and customized by you :smile:.
6
-
7
- See what's new in the [CHANGELOG](CHANGELOG.md).
8
-
9
- Interested in testing out a [**pre-release "gemified" version**](https://github.com/mmistakes/minimal-mistakes/tree/feature/theme-gem) of the theme? Read this blog post to [learn how](https://mmistakes.github.io/minimal-mistakes/jekyll/gemified-theme-beta/).
10
-
11
- [![Minimal Mistakes live preview][2]][1]
12
-
13
- [1]: https://mmistakes.github.io/minimal-mistakes/
14
- [2]: screenshot.png (live preview)
15
-
16
- ![layout examples](screenshot-layouts.png)
17
-
18
- ## Notable Features
19
-
20
- - Compatible with Jekyll 3.x and GitHub Pages
21
- - Support for Jekyll's built-in Sass/SCSS preprocessor
22
- - Several responsive layout options (single, archive index, splash, and paginated home page)
23
- - SEO optimized with support for [Twitter Cards](https://dev.twitter.com/cards/overview) and [Open Graph](http://ogp.me/) data
24
- - Optional [header images](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#headers), [custom sidebars](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#sidebars), [table of contents](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#table-of-contents), [galleries](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#gallery), related posts, [breadcrumb links](https://mmistakes.github.io/minimal-mistakes/docs/configuration/#breadcrumb-navigation-beta), [navigation lists](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#navigation-list), and more.
25
- - Commenting support (powered by [Disqus](https://disqus.com/), [Facebook](https://developers.facebook.com/docs/plugins/comments), Google+, [Discourse](https://www.discourse.org/), static-based via [Staticman](https://staticman.net/), and custom).
26
- - [Google Analytics](https://www.google.com/analytics/) support.
27
- - UI localized text in English (default), Brazilian Portguese, Chinese, French, German, Italian, Spanish, and Turkish
28
-
29
- ## Demo Pages
30
-
31
- | Name | Description |
32
- | ------------------------------------------- | ----------------------------------------------------- |
33
- | [Post with Header Image][header-image-post] | A post with a large header image. |
34
- | [HTML Tags and Formatting Post][html-tags-post] | A variety of common markup showing how the theme styles them. |
35
- | [Syntax Highlighting Post][syntax-post] | Post displaying highlighted code. |
36
- | [Post with a Gallery][gallery-post] | A post showing several images wrapped in `<figure>` elements. |
37
- | [Sample Collection Page][sample-collection] | Single page from a collection. |
38
- | [Categories Archive][categories-archive] | Posts grouped by category. |
39
- | [Tags Archive][tags-archive] | Posts grouped by tags. |
40
-
41
- For even more demo pages check the [posts archive][year-archive] on the demo site. Looking for the source code to peep the YAML Front Matter and Markdown used? Check the [`gh-pages`](https://github.com/mmistakes/minimal-mistakes/tree/gh-pages) branch.
42
-
43
- [header-image-post]: https://mmistakes.github.io/minimal-mistakes/layout-header-image-text-readability/
44
- [gallery-post]: https://mmistakes.github.io/minimal-mistakes/post%20formats/post-gallery/
45
- [html-tags-post]: https://mmistakes.github.io/minimal-mistakes/markup/markup-html-tags-and-formatting/
46
- [syntax-post]: https://mmistakes.github.io/minimal-mistakes/markup-syntax-highlighting/
47
- [sample-collection]: https://mmistakes.github.io/minimal-mistakes/recipes/chocolate-chip-cookies/
48
- [categories-archive]: https://mmistakes.github.io/minimal-mistakes/categories/
49
- [tags-archive]: https://mmistakes.github.io/minimal-mistakes/tags/
50
- [year-archive]: https://mmistakes.github.io/minimal-mistakes/year-archive/
51
-
52
- ## Quick Start
53
-
54
- Add this line to your Jekyll site's `Gemfile`:
55
-
56
- ```ruby
57
- gem "minimal-mistakes-jekyll"
58
- ```
59
-
60
- Add this line to your Jekyll site's `_config.yml` file:
61
-
62
- ```yaml
63
- theme: minimal-mistakes-jekyll
64
- ```
65
-
66
- Run Bundler:
67
-
68
- ```bash
69
- bundle install
70
- ```
71
-
72
- ## Usage
73
-
74
- For detailed instructions on how to configure, customize, add content, and more read the [theme's documentation](https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/).
75
-
76
- **Note:** Gem version of the theme requires Jekyll v3.3+ and is not supported with sites hosted with [GitHub Pages](https://pages.github.com/). You can still use the theme on GitHub Pages, you'll just need to install using the old "[repo fork method](https://mmistakes.github.io/minimal-mistakes/docs/installation/)".
77
-
78
- ---
79
-
80
- ## Contributing
81
-
82
- Having trouble working with the theme? Found a typo in the documentation? Interested in adding a feature or [fixing a bug](https://github.com/mmistakes/minimal-mistakes/issues)? Then by all means [submit an issue](https://github.com/mmistakes/minimal-mistakes/issues/new) or [pull request](https://help.github.com/articles/using-pull-requests/). If this is your first pull request, it may be helpful to read up on the [GitHub Flow](https://guides.github.com/introduction/flow/) first.
83
-
84
- Minimal Mistakes has been designed as a base for you to customize and fit your site's unique needs. Please keep this in mind when requesting features and/or submitting pull requests. If it's not something that most people will use, I probably won't consider it. When in doubt ask.
85
-
86
- This goes for author sidebar links and "share button" additions -- I have no intention of merging in every possibly option, the essentials are there to get you started :smile:.
87
-
88
- ### Pull Requests
89
-
90
- To help me out try to avoid creating pull requests on `master` and instead branch off of `develop`. It's much easier for me to test, merge, and roll them into new releases this way.
91
-
92
- Theme documentation and demo pages can be found in the `gh-pages` branch, please submit pull requests against that branch.
93
-
94
- ---
95
-
96
- ## Credits
97
-
98
- ### Creator
99
-
100
- **Michael Rose**
101
-
102
- - <https://mademistakes.com>
103
- - <https://twitter.com/mmistakes>
104
- - <https://github.com/mmistakes>
105
-
106
- ### Icons + Demo Images:
107
-
108
- - [The Noun Project](https://thenounproject.com) -- Garrett Knoll, Arthur Shlain, and [tracy tam](https://thenounproject.com/tracytam)
109
- - [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
110
- - [Unsplash](https://unsplash.com/)
111
-
112
- ### Other:
113
-
114
- - [Jekyll](http://jekyllrb.com/)
115
- - [jQuery](http://jquery.com/)
116
- - [Susy](http://susy.oddbird.net/)
117
- - [Breakpoint](http://breakpoint-sass.com/)
118
- - [Magnific Popup](http://dimsemenov.com/plugins/magnific-popup/)
119
- - [FitVids.JS](http://fitvidsjs.com/)
120
- - Greedy Navigation - [lukejacksonn](http://codepen.io/lukejacksonn/pen/PwmwWV)
121
- - [jQuery Smooth Scroll](https://github.com/kswedberg/jquery-smooth-scroll)
122
- - [Stickyfill](https://github.com/wilddeer/stickyfill)
123
-
124
- ---
125
-
126
- ## License
127
-
128
- The MIT License (MIT)
129
-
130
- Copyright (c) 2016 Michael Rose
131
-
132
- Permission is hereby granted, free of charge, to any person obtaining a copy
133
- of this software and associated documentation files (the "Software"), to deal
134
- in the Software without restriction, including without limitation the rights
135
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
136
- copies of the Software, and to permit persons to whom the Software is
137
- furnished to do so, subject to the following conditions:
138
-
139
- The above copyright notice and this permission notice shall be included in all
140
- copies or substantial portions of the Software.
141
-
142
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
143
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
144
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
145
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
146
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
147
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
148
- SOFTWARE.
1
+ # [Minimal Mistakes Jekyll Theme](https://mmistakes.github.io/minimal-mistakes/)
2
+
3
+ [![GitHub release](https://img.shields.io/gem/v/minimal-mistakes-jekyll.svg)](https://github.com/mmistakes/minimal-mistakes/releases) [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/mmistakes/minimal-mistakes/master/LICENSE)
4
+
5
+ Minimal Mistakes is a flexible two-column Jekyll theme. Perfect for hosting your personal site, blog, or portfolio on GitHub or self-hosting on your own server. As the name implies --- styling is purposely minimalistic to be enhanced and customized by you :smile:.
6
+
7
+ See what's new in the [CHANGELOG](CHANGELOG.md).
8
+
9
+ :sparkles: Minimal Mistakes is now available as a [Ruby gem](https://rubygems.org/gems/minimal-mistakes-jekyll). Consult the [Quick-Start Guide](https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/) and [this blog post](https://mmistakes.github.io/minimal-mistakes/jekyll/gemified-theme-beta/) to learn how to upgrade.
10
+
11
+ [![Minimal Mistakes live preview][2]][1]
12
+
13
+ [1]: https://mmistakes.github.io/minimal-mistakes/
14
+ [2]: screenshot.png (live preview)
15
+
16
+ ![layout examples](screenshot-layouts.png)
17
+
18
+ ## Notable Features
19
+
20
+ - "Gemified" for easier install/upgrading
21
+ - Compatible with Jekyll 3.x and GitHub Pages
22
+ - Support for Jekyll's built-in Sass/SCSS preprocessor
23
+ - Several responsive layout options (single, archive index, splash, and paginated home page)
24
+ - SEO optimized with support for [Twitter Cards](https://dev.twitter.com/cards/overview) and [Open Graph](http://ogp.me/) data
25
+ - Optional [header images](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#headers), [custom sidebars](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#sidebars), [table of contents](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#table-of-contents), [galleries](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#gallery), related posts, [breadcrumb links](https://mmistakes.github.io/minimal-mistakes/docs/configuration/#breadcrumb-navigation-beta), [navigation lists](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#navigation-list), and more.
26
+ - Commenting support (powered by [Disqus](https://disqus.com/), [Facebook](https://developers.facebook.com/docs/plugins/comments), Google+, [Discourse](https://www.discourse.org/), static-based via [Staticman](https://staticman.net/), and custom).
27
+ - [Google Analytics](https://www.google.com/analytics/) support.
28
+ - UI localized text in English (default), Brazilian Portuguese, Chinese, French, German, Italian, Spanish, and Turkish
29
+
30
+ ## Demo Pages
31
+
32
+ | Name | Description |
33
+ | ------------------------------------------- | ----------------------------------------------------- |
34
+ | [Post with Header Image][header-image-post] | A post with a large header image. |
35
+ | [HTML Tags and Formatting Post][html-tags-post] | A variety of common markup showing how the theme styles them. |
36
+ | [Syntax Highlighting Post][syntax-post] | Post displaying highlighted code. |
37
+ | [Post with a Gallery][gallery-post] | A post showing several images wrapped in `<figure>` elements. |
38
+ | [Sample Collection Page][sample-collection] | Single page from a collection. |
39
+ | [Categories Archive][categories-archive] | Posts grouped by category. |
40
+ | [Tags Archive][tags-archive] | Posts grouped by tags. |
41
+
42
+ Additional sample posts are available under [posts archive][year-archive] on the demo site. Source files for these (and the entire demo site) can be found in [`/docs`](docs).
43
+
44
+ [header-image-post]: https://mmistakes.github.io/minimal-mistakes/layout-header-image-text-readability/
45
+ [gallery-post]: https://mmistakes.github.io/minimal-mistakes/post%20formats/post-gallery/
46
+ [html-tags-post]: https://mmistakes.github.io/minimal-mistakes/markup/markup-html-tags-and-formatting/
47
+ [syntax-post]: https://mmistakes.github.io/minimal-mistakes/markup-syntax-highlighting/
48
+ [sample-collection]: https://mmistakes.github.io/minimal-mistakes/recipes/chocolate-chip-cookies/
49
+ [categories-archive]: https://mmistakes.github.io/minimal-mistakes/categories/
50
+ [tags-archive]: https://mmistakes.github.io/minimal-mistakes/tags/
51
+ [year-archive]: https://mmistakes.github.io/minimal-mistakes/year-archive/
52
+
53
+ ## Usage
54
+
55
+ For detailed instructions on how to configure, customize, add content, and more read the [theme's documentation](https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/).
56
+
57
+ **Note:** Gem version of the theme requires Jekyll v3.3+ and is not currently supported on [GitHub Pages](https://pages.github.com/). You can still use the theme with GitHub Pages, you'll just need to install using the old "[repo fork method](https://mmistakes.github.io/minimal-mistakes/docs/installation/)".
58
+
59
+ ## Quick Start
60
+
61
+ Add this line to your Jekyll site's `Gemfile`:
62
+
63
+ ```ruby
64
+ gem "minimal-mistakes-jekyll"
65
+ ```
66
+
67
+ Add this line to your Jekyll site's `_config.yml` file:
68
+
69
+ ```yaml
70
+ theme: minimal-mistakes-jekyll
71
+ ```
72
+
73
+ Then run Bundler to install the theme gem and dependencies:
74
+
75
+ ```bash
76
+ bundle install
77
+ ```
78
+
79
+ To update the theme run `bundle update`.
80
+
81
+ ---
82
+
83
+ ## Contributing
84
+
85
+ Having trouble working with the theme? Found a typo in the documentation? Interested in adding a feature or [fixing a bug](https://github.com/mmistakes/minimal-mistakes/issues)? Then by all means [submit an issue](https://github.com/mmistakes/minimal-mistakes/issues/new) or [pull request](https://help.github.com/articles/using-pull-requests/). If this is your first pull request, it may be helpful to read up on the [GitHub Flow](https://guides.github.com/introduction/flow/) first.
86
+
87
+ Minimal Mistakes has been designed as a base for you to customize and fit your site's unique needs. Please keep this in mind when requesting features and/or submitting pull requests. If it's not something that most people will use, I probably won't consider it. When in doubt ask.
88
+
89
+ This goes for author sidebar links and "share button" additions -- I have no intention of merging in every possibly option, the essentials are there to get you started :smile:.
90
+
91
+ ### Pull Requests
92
+
93
+ To help me out try to avoid creating pull requests on `master` and instead branch off of `develop`. It's much easier for me to test, merge, and roll them into new releases this way.
94
+
95
+ Theme documentation and demo pages can be found in the [`/docs`](docs) if submitting improvements, typo corrections, etc.
96
+
97
+ ---
98
+
99
+ ## Credits
100
+
101
+ ### Creator
102
+
103
+ **Michael Rose**
104
+
105
+ - <https://mademistakes.com>
106
+ - <https://twitter.com/mmistakes>
107
+ - <https://github.com/mmistakes>
108
+
109
+ ### Icons + Demo Images:
110
+
111
+ - [The Noun Project](https://thenounproject.com) -- Garrett Knoll, Arthur Shlain, and [tracy tam](https://thenounproject.com/tracytam)
112
+ - [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
113
+ - [Unsplash](https://unsplash.com/)
114
+
115
+ ### Other:
116
+
117
+ - [Jekyll](http://jekyllrb.com/)
118
+ - [jQuery](http://jquery.com/)
119
+ - [Susy](http://susy.oddbird.net/)
120
+ - [Breakpoint](http://breakpoint-sass.com/)
121
+ - [Magnific Popup](http://dimsemenov.com/plugins/magnific-popup/)
122
+ - [FitVids.JS](http://fitvidsjs.com/)
123
+ - Greedy Navigation - [lukejacksonn](http://codepen.io/lukejacksonn/pen/PwmwWV)
124
+ - [jQuery Smooth Scroll](https://github.com/kswedberg/jquery-smooth-scroll)
125
+ - [Stickyfill](https://github.com/wilddeer/stickyfill)
126
+
127
+ ---
128
+
129
+ ## License
130
+
131
+ The MIT License (MIT)
132
+
133
+ Copyright (c) 2016 Michael Rose
134
+
135
+ Permission is hereby granted, free of charge, to any person obtaining a copy
136
+ of this software and associated documentation files (the "Software"), to deal
137
+ in the Software without restriction, including without limitation the rights
138
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
139
+ copies of the Software, and to permit persons to whom the Software is
140
+ furnished to do so, subject to the following conditions:
141
+
142
+ The above copyright notice and this permission notice shall be included in all
143
+ copies or substantial portions of the Software.
144
+
145
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
146
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
147
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
148
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
149
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
150
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
151
+ SOFTWARE.
@@ -1,14 +1,13 @@
1
- {% if site.comments.discourse.server %}
2
- {% include base_path %}
3
- {% capture canonical %}{{ base_path }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
4
- <script type="text/javascript">
5
- DiscourseEmbed = { discourseUrl: '//{{ site.comments.discourse.server }}/',
6
- discourseEmbedUrl: '{{ canonical }}' };
7
- (function () {
8
- var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
9
- d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
10
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
11
- })();
12
- </script>
13
- <noscript>Please enable JavaScript to view the comments powered by [Discourse](http://forum.beta-europe.org/c/beta/website).</a></noscript>
1
+ {% if site.comments.discourse.server %}
2
+ {% capture canonical %}{% if site.permalink contains '.html' %}{{ page.url | absolute_url }}{% else %}{{ page.url | absolute_url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
3
+ <script type="text/javascript">
4
+ DiscourseEmbed = { discourseUrl: '//{{ site.comments.discourse.server }}/',
5
+ discourseEmbedUrl: '{{ canonical }}' };
6
+ (function () {
7
+ var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
8
+ d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
9
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
10
+ })();
11
+ </script>
12
+ <noscript>Please enable JavaScript to view the comments powered by [Discourse](http://forum.beta-europe.org/c/beta/website).</a></noscript>
14
13
  {% endif %}
@@ -1,68 +1,68 @@
1
- {% if paginator.total_pages > 1 %}
2
- <nav class="pagination">
3
- <ul>
4
- {% comment %} Link for previous page {% endcomment %}
5
- {% if paginator.previous_page %}
6
- {% if paginator.previous_page == 1 %}
7
- <li><a href="{{ '/' | absolute_url }}">{{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}</a></li>
8
- {% else %}
9
- <li><a href="{{ '/page' | absolute_url }}{{ paginator.previous_page | append: '/' }}">{{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}</a></li>
10
- {% endif %}
11
- {% else %}
12
- <li><a href="#" class="disabled"><span aria-hidden="true">{{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}</span></a></li>
13
- {% endif %}
14
-
15
- {% comment %} First page {% endcomment %}
16
- {% if paginator.page == 1 %}
17
- <li><a href="#" class="disabled current">1</a></li>
18
- {% else %}
19
- <li><a href="{{ '/' | absolute_url }}">1</a></li>
20
- {% endif %}
21
-
22
- {% assign page_start = 2 %}
23
- {% if paginator.page > 4 %}
24
- {% assign page_start = paginator.page | minus: 2 %}
25
- {% comment %} Ellipsis for truncated links {% endcomment %}
26
- <li><a href="#" class="disabled">&hellip;</a></li>
27
- {% endif %}
28
-
29
- {% assign page_end = paginator.total_pages | minus: 1 %}
30
- {% assign pages_to_end = paginator.total_pages | minus: paginator.page %}
31
- {% if pages_to_end > 4 %}
32
- {% assign page_end = paginator.page | plus: 2 %}
33
- {% endif %}
34
-
35
- {% for index in (page_start..page_end) %}
36
- {% if index == paginator.page %}
37
- <li><a href="{{ '/page' | absolute_url }}{{ index | append: '/' }}" class="disabled current">{{ index }}</a></li>
38
- {% else %}
39
- {% comment %} Distance from current page and this link {% endcomment %}
40
- {% assign dist = paginator.page | minus: index %}
41
- {% if dist < 0 %}
42
- {% comment %} Distance must be a positive value {% endcomment %}
43
- {% assign dist = 0 | minus: dist %}
44
- {% endif %}
45
- <li><a href="{{ '/page' | absolute_url }}{{ index | append: '/' }}">{{ index }}</a></li>
46
- {% endif %}
47
- {% endfor %}
48
-
49
- {% comment %} Ellipsis for truncated links {% endcomment %}
50
- {% if pages_to_end > 3 %}
51
- <li><a href="#" class="disabled">&hellip;</a></li>
52
- {% endif %}
53
-
54
- {% if paginator.page == paginator.total_pages %}
55
- <li><a href="#" class="disabled current">{{ paginator.page }}</a></li>
56
- {% else %}
57
- <li><a href="{{ base_path }}/page{{ paginator.total_pages }}/">{{ paginator.total_pages }}</a></li>
58
- {% endif %}
59
-
60
- {% comment %} Link next page {% endcomment %}
61
- {% if paginator.next_page %}
62
- <li><a href="{{ base_path }}/page{{ paginator.next_page }}/">{{ site.data.ui-text[site.locale].pagination_next | default: "Next" }}</a></li>
63
- {% else %}
64
- <li><a href="#" class="disabled"><span aria-hidden="true">{{ site.data.ui-text[site.locale].pagination_next | default: "Next" }}</span></a></li>
65
- {% endif %}
66
- </ul>
67
- </nav>
1
+ {% if paginator.total_pages > 1 %}
2
+ <nav class="pagination">
3
+ <ul>
4
+ {% comment %} Link for previous page {% endcomment %}
5
+ {% if paginator.previous_page %}
6
+ {% if paginator.previous_page == 1 %}
7
+ <li><a href="{{ '/' | absolute_url }}">{{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}</a></li>
8
+ {% else %}
9
+ <li><a href="{{ '/page' | absolute_url }}{{ paginator.previous_page | append: '/' }}">{{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}</a></li>
10
+ {% endif %}
11
+ {% else %}
12
+ <li><a href="#" class="disabled"><span aria-hidden="true">{{ site.data.ui-text[site.locale].pagination_previous | default: "Previous" }}</span></a></li>
13
+ {% endif %}
14
+
15
+ {% comment %} First page {% endcomment %}
16
+ {% if paginator.page == 1 %}
17
+ <li><a href="#" class="disabled current">1</a></li>
18
+ {% else %}
19
+ <li><a href="{{ '/' | absolute_url }}">1</a></li>
20
+ {% endif %}
21
+
22
+ {% assign page_start = 2 %}
23
+ {% if paginator.page > 4 %}
24
+ {% assign page_start = paginator.page | minus: 2 %}
25
+ {% comment %} Ellipsis for truncated links {% endcomment %}
26
+ <li><a href="#" class="disabled">&hellip;</a></li>
27
+ {% endif %}
28
+
29
+ {% assign page_end = paginator.total_pages | minus: 1 %}
30
+ {% assign pages_to_end = paginator.total_pages | minus: paginator.page %}
31
+ {% if pages_to_end > 4 %}
32
+ {% assign page_end = paginator.page | plus: 2 %}
33
+ {% endif %}
34
+
35
+ {% for index in (page_start..page_end) %}
36
+ {% if index == paginator.page %}
37
+ <li><a href="{{ '/page' | absolute_url }}{{ index | append: '/' }}" class="disabled current">{{ index }}</a></li>
38
+ {% else %}
39
+ {% comment %} Distance from current page and this link {% endcomment %}
40
+ {% assign dist = paginator.page | minus: index %}
41
+ {% if dist < 0 %}
42
+ {% comment %} Distance must be a positive value {% endcomment %}
43
+ {% assign dist = 0 | minus: dist %}
44
+ {% endif %}
45
+ <li><a href="{{ '/page' | absolute_url }}{{ index | append: '/' }}">{{ index }}</a></li>
46
+ {% endif %}
47
+ {% endfor %}
48
+
49
+ {% comment %} Ellipsis for truncated links {% endcomment %}
50
+ {% if pages_to_end > 3 %}
51
+ <li><a href="#" class="disabled">&hellip;</a></li>
52
+ {% endif %}
53
+
54
+ {% if paginator.page == paginator.total_pages %}
55
+ <li><a href="#" class="disabled current">{{ paginator.page }}</a></li>
56
+ {% else %}
57
+ <li><a href="{{ '/page' | absolute_url }}{{ paginator.total_pages }}/">{{ paginator.total_pages }}</a></li>
58
+ {% endif %}
59
+
60
+ {% comment %} Link next page {% endcomment %}
61
+ {% if paginator.next_page %}
62
+ <li><a href="{{ '/page' | absolute_url }}{{ paginator.next_page }}/">{{ site.data.ui-text[site.locale].pagination_next | default: "Next" }}</a></li>
63
+ {% else %}
64
+ <li><a href="#" class="disabled"><span aria-hidden="true">{{ site.data.ui-text[site.locale].pagination_next | default: "Next" }}</span></a></li>
65
+ {% endif %}
66
+ </ul>
67
+ </nav>
68
68
  {% endif %}