jekyll-text-theme 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/_data/locale.yml +12 -0
  4. data/_includes/analytics-providers/google.html +7 -9
  5. data/_includes/article-info.html +19 -35
  6. data/_includes/article-list.html +73 -0
  7. data/_includes/author-links.html +7 -0
  8. data/_includes/header.html +13 -9
  9. data/_includes/markdown-enhancements.html +3 -3
  10. data/_includes/paginator.html +73 -72
  11. data/_includes/scripts/archieve.js +57 -160
  12. data/_includes/scripts/aside/affix.js +2 -0
  13. data/_includes/scripts/lib/affix.js +8 -6
  14. data/_includes/scripts/lib/toc.js +3 -5
  15. data/_includes/scripts/search-data.js +14 -0
  16. data/_includes/scripts/search.js +177 -0
  17. data/_includes/scripts/utils.js +1 -1
  18. data/_includes/scripts/variables.html +6 -0
  19. data/_includes/search.html +24 -0
  20. data/_includes/snippets/is_collection.html +6 -0
  21. data/_includes/snippets/prepend-baseurl.html +4 -1
  22. data/_includes/snippets/prepend-path.html +1 -0
  23. data/_includes/svg/icon/social/npm.svg +9 -0
  24. data/_includes/tags.html +2 -2
  25. data/_layouts/archive.html +3 -9
  26. data/_layouts/base.html +1 -0
  27. data/_layouts/home.html +1 -28
  28. data/_layouts/landing.html +11 -4
  29. data/_layouts/page.html +18 -8
  30. data/_sass/common/_classes.scss +1 -0
  31. data/_sass/common/_function.scss +2 -2
  32. data/_sass/common/_reset.scss +5 -5
  33. data/_sass/common/_variables.scss +22 -14
  34. data/_sass/common/classes/_animation.scss +1 -1
  35. data/_sass/common/classes/_clearfix.scss +7 -3
  36. data/_sass/common/classes/_clickable.scss +13 -13
  37. data/_sass/common/classes/_display.scss +3 -0
  38. data/_sass/common/classes/_flex.scss +131 -131
  39. data/_sass/common/classes/_grid.scss +3 -3
  40. data/_sass/common/classes/_horizontal-rules.scss +3 -3
  41. data/_sass/common/classes/_overflow.scss +3 -3
  42. data/_sass/common/classes/_spacing.scss +24 -24
  43. data/_sass/common/classes/_transform.scss +1 -1
  44. data/_sass/common/classes/_transition.scss +1 -1
  45. data/_sass/common/classes/_user-select.scss +3 -3
  46. data/_sass/common/components/_button.scss +19 -9
  47. data/_sass/common/components/_card.scss +2 -2
  48. data/_sass/common/components/_item.scss +90 -0
  49. data/_sass/common/components/_menu.scss +8 -4
  50. data/_sass/common/components/_toc.scss +7 -2
  51. data/_sass/components/_article-content.scss +25 -18
  52. data/_sass/components/_article-info.scss +2 -2
  53. data/_sass/components/_article-list.scss +3 -0
  54. data/_sass/components/_author-links.scss +3 -0
  55. data/_sass/components/_author-profile.scss +5 -5
  56. data/_sass/components/_footer.scss +13 -5
  57. data/_sass/components/_header.scss +80 -46
  58. data/_sass/components/_main.scss +3 -3
  59. data/_sass/components/_search.scss +97 -0
  60. data/_sass/components/_tags.scss +3 -2
  61. data/_sass/layout/_archive.scss +5 -82
  62. data/_sass/layout/_article.scss +2 -2
  63. data/_sass/layout/_base.scss +1 -1
  64. data/_sass/layout/_home.scss +10 -68
  65. data/_sass/layout/_landing.scss +5 -6
  66. data/_sass/layout/_page.scss +34 -12
  67. data/_sass/skins/_chocolate.scss +2 -1
  68. data/_sass/skins/_dark.scss +3 -2
  69. data/_sass/skins/_default.scss +2 -1
  70. data/_sass/skins/_forest.scss +2 -1
  71. data/_sass/skins/_ocean.scss +2 -1
  72. data/_sass/skins/_orange.scss +2 -1
  73. data/_sass/skins/highlight/tomorrow/_highlight.scss +65 -65
  74. data/_sass/skins/highlight/tomorrow/_night-blue.scss +2 -2
  75. data/_sass/skins/highlight/tomorrow/_night-bright.scss +1 -1
  76. data/_sass/skins/highlight/tomorrow/_night-eighties.scss +7 -7
  77. data/_sass/skins/highlight/tomorrow/_night.scss +1 -1
  78. data/assets/css/main.scss +4 -1
  79. data/assets/search.js +3 -0
  80. metadata +14 -3
  81. data/_includes/scripts/article-list.html +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c2ae404cd71049373be71e77b4e6b49722cff9c
4
- data.tar.gz: 671c1dc0fe48624aa30d2cea2495969e499ca8bc
3
+ metadata.gz: 14c04996b1129a62fc3ff58d0bb57e110dc0319f
4
+ data.tar.gz: f452946f4ab9eb877ef00d9e68bf0de94d54ba20
5
5
  SHA512:
6
- metadata.gz: d142b51db0bff8f34498fe524fcad922baa8c4ba4fd8478fdfa3b9e2ffdf31bf53b8439d69cc1eeed6ec62b9c74d1eb0387f79282010cec9090247102cf68417
7
- data.tar.gz: 85f644f5def91d033c514e43210bbb858019709d31268520bdbad4c6a38623de2944aa16554dbd52fce9fa7effba058e2d4e774d16df3ae8072d74cfdaf367f3
6
+ metadata.gz: ad3852f278e417abf9e263d8bc8b95c9bff1e7db6a8f5da6569d60a39e6c531ffdb44197a69fe6888aa3fff32c6b09109131a4051bc9508c5695faf3b9abcd92
7
+ data.tar.gz: f881cc2df0868bb6f3245eb5ab7e6b5e950091f3e0e599105715c77d625fdb2cc224299fbcac6eea6a0fe1ba74e7ba3599732fd32a1b85f0bc585c3f83c26a88
data/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  ![TeXt Theme Details](https://raw.githubusercontent.com/kitian616/jekyll-TeXt-theme/master/screenshots/TeXt-layouts.png)
10
10
 
11
- TeXt is a Jekyll theme for personal site, team site, blog, project, documentation, etc. Similar to iOS 11 style, it has large and prominent titles, round buttons and cards.
11
+ TeXt is a customizable Jekyll theme for personal site, team site, blog, project, documentation, etc. Similar to iOS 11 style, it has large and prominent titles, round buttons and cards.
12
12
 
13
- [中文文档](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-zh.md)
13
+ [Change Log](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/CHANGELOG.md) | [中文文档](https://github.com/kitian616/jekyll-TeXt-theme/blob/master/README-zh.md)
14
14
 
15
15
  ## Features
16
16
 
@@ -21,6 +21,18 @@ READMORE:
21
21
  zh-Hans: "阅读更多"
22
22
  zh-Hant: "閱讀更多"
23
23
 
24
+ SEARCH:
25
+ en: "Search"
26
+ zh: "搜索"
27
+ zh-Hans: "搜索"
28
+ zh-Hant: "搜索"
29
+
30
+ CANCEL:
31
+ en: "Cancel"
32
+ zh: "取消"
33
+ zh-Hans: "取消"
34
+ zh-Hant: "取消"
35
+
24
36
  VIEWS:
25
37
  en: "views"
26
38
  zh: "阅读"
@@ -1,16 +1,14 @@
1
1
  {%- if site.analytics.google.tracking_id -%}
2
-
2
+ <!-- Global site tag (gtag.js) - Google Analytics -->
3
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.tracking_id }}"></script>
3
4
  <script>
4
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
5
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
6
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
7
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
5
+ window.dataLayer = window.dataLayer || [];
6
+ function gtag(){dataLayer.push(arguments);}
7
+ gtag('js', new Date());
8
8
 
9
- ga('create', '{{ site.analytics.google.tracking_id }}', 'auto');
10
- ga('send', 'pageview');
9
+ gtag('config', '{{ site.analytics.google.tracking_id }}');
11
10
  {% if site.analytics.google.anonymize_ip == true %}
12
- ga('set', 'anonymizeIp', true);
11
+ gtag('config', '{{ site.analytics.google.tracking_id }}', { 'anonymize_ip': true });
13
12
  {% endif %}
14
13
  </script>
15
-
16
14
  {%- endif -%}
@@ -1,16 +1,10 @@
1
- {%- if post -%}
2
- {%- assign _cur_page = post -%}
3
- {%- elsif page -%}
4
- {%- assign _cur_page = page -%}
5
- {%- endif -%}
6
-
7
1
  {%- include snippets/assign.html target=site.data.variables.default.pageview source0=page.pageview -%}
8
2
  {%- assign _pageview = __return -%}
9
3
 
10
4
  {%- assign _paths_archive = site.paths.archive | default: site.data.variables.default.paths.archive -%}
11
5
 
12
- {%- if _cur_page.author -%}
13
- {%- assign _author = site.data.authors[_cur_page.author] -%}
6
+ {%- if include.article.author -%}
7
+ {%- assign _author = site.data.authors[include.article.author] -%}
14
8
  {%- else -%}
15
9
  {%- assign _author = site.author -%}
16
10
  {%- endif -%}
@@ -22,57 +16,47 @@
22
16
  <meta itemprop="author" content="{{ _author.name }}"/>
23
17
  {%- endif -%}
24
18
 
25
- {%- if _cur_page.tags[0] -%}
19
+ {%- if include.article.tags[0] -%}
26
20
  <ul class="left-col menu">
27
21
 
28
- {%- assign _keywords = '' -%}
29
- {%- for _tag in _cur_page.tags -%}
22
+ {%- assign _tag_path = _paths_archive | append: '?tag=' -%}
23
+ {%- include snippets/prepend-baseurl.html path=_tag_path -%}
24
+
25
+ {%- for _tag in include.article.tags -%}
26
+ {%- assign _tag_path = __return -%}
30
27
  {%- assign _tag_encode = _tag | strip | url_encode } -%}
31
- {%- if forloop.last -%}
32
- {%- assign _keywords = _keywords | append: _tag -%}
33
- {%- else -%}
34
- {%- assign _keywords = _keywords | append: _tag | append: ',' -%}
35
- {%- endif -%}
36
- {%- assign _tag_path = _paths_archive | append: '?tag=' -%}
37
- {%- include snippets/prepend-baseurl.html path=_tag_path -%}
38
28
  <li>
39
29
  <a class="button button--secondary button--pill button--sm"
40
- href="{{ __return | append: _tag_encode | replace: '//', '/' }}">{{ _tag }}</a>
30
+ href="{{ _tag_path | append: _tag_encode | replace: '//', '/' }}">{{ _tag }}</a>
41
31
  </li>
42
32
  {%- endfor -%}
43
- <meta itemprop="keywords" content="{{ _keywords }}">
33
+ {%- assign _keywords = include.article.tags | join: ',' %}
44
34
  </ul>
35
+ <meta itemprop="keywords" content="{{ _keywords }}">
45
36
  {%- endif -%}
46
37
 
47
38
 
48
- {%- if (_pageview or post) or _cur_page.date -%}
39
+ {%- if include.article.author or include.article.date or _pageview or post -%}
49
40
  <ul class="right-col menu">
50
- {%- if !_cur_page.author -%}
51
- <li><i class="fas fa-user"></i> <span>{{ _author.name }}</span></li>
41
+ {%- if include.article.author -%}
42
+ <li><i class="fas fa-user"></i> <span>{{ _author.name }}</span></li>
52
43
  {%- endif -%}
53
44
 
54
- {%- if _cur_page.date -%}
45
+ {%- if include.article.date -%}
55
46
  <li>
56
47
  {%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_DATE_FORMAT -%}
57
- {%- if post -%}
58
- <i class="far fa-calendar-alt"></i> <span itemprop="datePublished">{{ _cur_page.date | date: __return }}</span>
59
- {%- elsif page -%}
60
- <i class="far fa-calendar-alt"></i> <time datetime="{{ page.date | date_to_xmlschema }}"
61
- itemprop="datePublished">{{ _cur_page.date | date: __return }}
62
- </time>
63
- {%- endif -%}
48
+ <i class="far fa-calendar-alt"></i> <span>{{ include.article.date | date: __return }}</span>
49
+ <meta itemprop="datePublished" content="{{ include.article.date | date_to_xmlschema }}">
64
50
  </li>
65
51
  {%- endif -%}
66
52
 
67
- {%- if _pageview or post -%}
53
+ {%- if _pageview or include.show_pageview -%}
68
54
  {%- if site.pageview.provider -%}
69
-
70
55
  {%- include snippets/locale-to-string.html locale=site.data.locale.VIEWS -%}
71
56
  {%- assign _locale_views = __return -%}
72
-
73
57
  <li itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter">
74
58
  <link itemprop="interactionType" href="http://schema.org/WatchAction"/>
75
- <i class="far fa-eye"></i> <span class="js-pageview" data-page-key="{{ _cur_page.key }}">0</span> {{ _locale_views }}
59
+ <i class="far fa-eye"></i> <span class="js-pageview" data-page-key="{{ include.article.key }}">0</span> {{ _locale_views }}
76
60
  </li>
77
61
  {%- endif -%}
78
62
  {%- endif -%}
@@ -0,0 +1,73 @@
1
+ {%- assign _excerpt_truncate = include.excerpt_truncate | default: 350 -%}
2
+
3
+ {%- assign _excerpt_type = include.excerpt_type | default: site.data.variables.default.excerpt_type -%}
4
+
5
+ {%- assign _sorted_list = include.articles -%}
6
+ {%- if include.group_by == 'year' -%}
7
+ {%- assign _sorted_list = _sorted_list | sort: 'date' -%}
8
+ {%- endif -%}
9
+ {%- if include.reverse -%}
10
+ {%- assign _sorted_list = _sorted_list | reverse -%}
11
+ {%- endif -%}
12
+
13
+ {%- if include.type == 'common' -%}
14
+ <div class="items items--divided">
15
+ {%- elsif include.type == 'brief' -%}
16
+ <div class="items">
17
+ {%- endif -%}
18
+
19
+ {%- for _article in _sorted_list -%}
20
+
21
+ {%- include snippets/prepend-baseurl.html path=_article.url -%}
22
+ {%- assign _href = __return -%}
23
+
24
+ {%- include snippets/locale-to-string.html locale=site.data.locale.READMORE -%}
25
+ {%- assign _locale_readmore = __return -%}
26
+
27
+ {%- if include.type == 'common' -%}
28
+ <article class="item" itemscope itemtype="http://schema.org/BlogPosting">
29
+ <div class="item__content">
30
+ <header><h2 itemprop="headline" class="item__header"><a href="{{ _href }}">{{ _article.title }}</a></h2></header>
31
+ <div class="item__description">
32
+ {%- if _article.excerpt and include.show_excerpt -%}
33
+ <div class="article__content" itemprop="description articleBody">
34
+ {%- if _excerpt_type == 'html' -%}
35
+ {{ _article.excerpt }}
36
+ {%- else -%}
37
+ {{ _article.excerpt | strip_html | truncate: _excerpt_truncate }}
38
+ {%- endif -%}
39
+ </div>
40
+ {%- endif -%}
41
+ <p><a href="{{ _href }}">{{ _locale_readmore }}</a></p>
42
+ </div>
43
+ {%- include article-info.html article=_article show_pageview=true -%}
44
+ </div>
45
+ </article>
46
+
47
+
48
+ {%- elsif include.type == 'brief' -%}
49
+ {%- assign _tags = '' -%}
50
+ {%- for _tag in _article.tags -%}
51
+ {%- assign _tag_encode = _tag | strip | url_encode } -%}
52
+ {%- if forloop.last -%}
53
+ {%- assign _tags = _tags | append: _tag_encode -%}
54
+ {%- else -%}
55
+ {%- assign _tags = _tags | append: _tag_encode | append: ',' -%}
56
+ {%- endif -%}
57
+ {%- endfor -%}
58
+ {%- if include.group_by == 'year' -%}
59
+ {%- assign _currentdate = _article.date | date: '%Y' -%}
60
+ {%- if _currentdate != _date -%}
61
+ {%- unless forloop.first -%}</ul></section>{%- endunless -%}
62
+ <section><h2 class="article-list__group-header">{{ _currentdate }}</h2><ul>
63
+ {%- assign _date = _currentdate -%}
64
+ {%- endif -%}
65
+ {%- endif -%}
66
+ {%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_LIST_DATE_FORMAT -%}
67
+ <li class="item" itemscope itemtype="http://schema.org/BlogPosting" data-tags="{{ _tags }}">
68
+ <div class="item__content"><span class="item__meta">{{ _article.date | date: __return }}</span><a itemprop="headline" class="item__header" href="{{ _href }}">{{ _article.title }}</a></div>
69
+ </li>
70
+ {%- endif -%}
71
+
72
+ {%- endfor -%}
73
+ </div>
@@ -74,5 +74,12 @@
74
74
  </li>
75
75
  {%- endif -%}
76
76
 
77
+ {%- if _author.npm -%}
78
+ <li title="{{ __return | replace: '[NAME]', 'npm' }}">
79
+ <a class="button button--circle npm-button" itemprop="sameAs" href="https://www.npmjs.com/~{{ _author.npm }}" target="_blank">
80
+ <div class="icon">{%- include svg/icon/social/npm.svg -%}</div>
81
+ </a>
82
+ </li>
83
+ {%- endif -%}
77
84
  </ul>
78
85
  </div>
@@ -1,15 +1,18 @@
1
1
  <header class="header">
2
- <div class="main clearfix">
3
- <div class="logo">
4
- {%- include svg/logo.svg -%}
5
- {%- assign _paths_root = site.paths.root | default: site.data.variables.default.paths.root -%}
6
- {%- include snippets/get-nav-url.html path=_paths_root -%}
7
- {%- if site.title -%}
8
- <a title="{%- if site.description -%}{{ site.description }}{%- endif -%}" href="{{ __return }}">{{ site.title }}</a>
9
- {%- endif -%}
2
+ <div class="main">
3
+ <div class="header__main">
4
+ <div class="logo">
5
+ {%- include svg/logo.svg -%}
6
+ {%- assign _paths_root = site.paths.root | default: site.data.variables.default.paths.root -%}
7
+ {%- include snippets/get-nav-url.html path=_paths_root -%}
8
+ {%- if site.title -%}
9
+ <a title="{%- if site.description -%}{{ site.description }}{%- endif -%}" href="{{ __return }}">{{ site.title }}</a>
10
+ {%- endif -%}
11
+ </div>
12
+ <button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button>
10
13
  </div>
11
14
  {%- if site.data.navigation.header -%}
12
- <nav>
15
+ <nav class="navigation">
13
16
  <ul>
14
17
  {%- for _item in site.data.navigation.header -%}
15
18
  {%- include snippets/get-nav-url.html path=_item.url -%}
@@ -23,6 +26,7 @@
23
26
  <li><a href="{{ _nav_url }}">{%- if _item.title -%}{{ _item.title }}{%- else -%}{{ __return }}{%- endif -%}</a></li>
24
27
  {%- endif -%}
25
28
  {%- endfor -%}
29
+ <li><button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button></li>
26
30
  </ul>
27
31
  </nav>
28
32
  {%- endif -%}
@@ -1,18 +1,18 @@
1
- {%- include snippets/assign.html target = site.data.variables.default.chart source0=site.chart -%}
1
+ {%- include snippets/assign.html target=site.data.variables.default.chart source0=site.chart -%}
2
2
  {%- include snippets/assign.html target=__return source0=page.chart -%}
3
3
 
4
4
  {%- if __return == true -%}
5
5
  {%- include markdown-enhancements/chart.html -%}
6
6
  {%- endif -%}
7
7
 
8
- {%- include snippets/assign.html target = site.data.variables.default.mathjax source0=site.mathjax -%}
8
+ {%- include snippets/assign.html target=site.data.variables.default.mathjax source0=site.mathjax -%}
9
9
  {%- include snippets/assign.html target=__return source0=page.mathjax -%}
10
10
 
11
11
  {%- if __return == true -%}
12
12
  {%- include markdown-enhancements/mathjax.html -%}
13
13
  {%- endif -%}
14
14
 
15
- {%- include snippets/assign.html target = site.data.variables.default.mermaid source0=site.mermaid -%}
15
+ {%- include snippets/assign.html target=site.data.variables.default.mermaid source0=site.mermaid -%}
16
16
  {%- include snippets/assign.html target=__return source0=page.mermaid -%}
17
17
 
18
18
  {%- if __return == true -%}
@@ -1,5 +1,5 @@
1
1
  {%- if paginator.total_pages > 1 -%}
2
- <nav class="pagination">
2
+ <div class="pagination">
3
3
 
4
4
  {%- include snippets/locale-to-string.html locale=site.data.locale.STATISTICS -%}
5
5
  {%- assign _locale_statistics = __return -%}
@@ -7,63 +7,70 @@
7
7
  {%- assign _post_count = site.posts | size -%}
8
8
  {%- assign _page_count = paginator.total_pages -%}
9
9
  <p>{{ _locale_statistics | replace: '[POST_COUNT]', _post_count | replace: '[PAGE_COUNT]', _page_count }}</p>
10
+ <div class="pagination__menu">
11
+ <ul class="menu menu--nowrap">
12
+ {%- assign _max_show = 5 -%}
13
+ {%- assign _max_show_modulo_two = _max_show | modulo: 2 -%}
14
+ {%- assign _length = paginator.total_pages -%}
15
+ {%- assign _length_mimus_one = _length | minus: 1 -%}
16
+ {%- assign _cur = paginator.page -%}
17
+ {%- assign _extra = _max_show | minus: 3 -%}
18
+ {%- assign _extra_half = _extra | divided_by: 2 -%}
10
19
 
11
- <ul class="menu menu--nowrap">
12
- {%- assign _max_show = 5 -%}
13
- {%- assign _max_show_modulo_two = _max_show | modulo: 2 -%}
14
- {%- assign _length = paginator.total_pages -%}
15
- {%- assign _length_mimus_one = _length | minus: 1 -%}
16
- {%- assign _cur = paginator.page -%}
17
- {%- assign _extra = _max_show | minus: 3 -%}
18
- {%- assign _extra_half = _extra | divided_by: 2 -%}
20
+ {%- if _max_show > 4 and _max_show_modulo_two == 1 and paginator.total_pages > _max_show -%}
21
+ {%- assign _condition0 = _extra | divided_by: 2 | plus: 1 -%}
22
+ {%- assign _condition1 = _length | minus: _extra_half -%}
23
+ {%- if _cur <= _condition0 -%}
24
+ {%- assign _n0 = 2 -%}
25
+ {%- assign _n1 = _extra | plus: 2 -%}
26
+ {%- elsif _cur >= _condition1 -%}
27
+ {%- assign _n0 = _length | minus: _extra | minus: 1 -%}
28
+ {%- assign _n1 = _length | minus: 1 -%}
29
+ {%- else -%}
30
+ {%- assign _n0 = _cur | minus: _extra_half -%}
31
+ {%- assign _n1 = _cur | plus: _extra_half -%}
32
+ {%- endif -%}
33
+ {%- endif -%}
19
34
 
20
- {%- if _max_show > 4 and _max_show_modulo_two == 1 and paginator.total_pages > _max_show -%}
21
- {%- assign _condition0 = _extra | divided_by: 2 | plus: 1 -%}
22
- {%- assign _condition1 = _length | minus: _extra_half -%}
23
- {%- if _cur <= _condition0 -%}
24
- {%- assign _n0 = 2 -%}
25
- {%- assign _n1 = _extra | plus: 2 -%}
26
- {%- elsif _cur >= _condition1 -%}
27
- {%- assign _n0 = _length | minus: _extra | minus: 1 -%}
28
- {%- assign _n1 = _length | minus: 1 -%}
35
+ {%- if paginator.previous_page -%}
36
+ {%- include snippets/prepend-baseurl.html path=paginator.previous_page_path -%}
37
+ {%- assign _href = __return -%}
38
+ <li><a class="button button--secondary button--circle" href="{{ _href }}">
39
+ <i class="fas fa-angle-left"></i>
40
+ </a></li>
29
41
  {%- else -%}
30
- {%- assign _n0 = _cur | minus: _extra_half -%}
31
- {%- assign _n1 = _cur | plus: _extra_half -%}
42
+ <li><div class="button button--secondary button--circle disabled">
43
+ <i class="fas fa-angle-left"></i>
44
+ </div></li>
32
45
  {%- endif -%}
33
- {%- endif -%}
34
-
35
- {%- if paginator.previous_page -%}
36
- {%- include snippets/prepend-baseurl.html path=paginator.previous_page_path -%}
37
- {%- assign _href = __return -%}
38
- <li><a class="button button--secondary button--circle" href="{{ _href }}">
39
- <i class="fas fa-angle-left"></i>
40
- </a></li>
41
- {%- else -%}
42
- <li><div class="button button--secondary button--circle disabled">
43
- <i class="fas fa-angle-left"></i>
44
- </div></li>
45
- {%- endif -%}
46
46
 
47
- {%- for page in (1.._length) -%}
48
- {%- if page == _cur -%}
49
- <li>
50
- <div class="button button--primary button--circle focus"><span>{{ page }}</span></div>
51
- </li>
47
+ {%- for page in (1.._length) -%}
48
+ {%- if page == _cur -%}
49
+ <li>
50
+ <div class="button button--primary button--circle focus"><span>{{ page }}</span></div>
51
+ </li>
52
52
 
53
- {%- elsif page == 1 -%}
54
- {%- assign _home_path = site.paths.home | default: site.data.variables.default.paths.home -%}
55
- {%- include snippets/prepend-baseurl.html path=_home_path -%}
56
- {%- assign _href = __return -%}
57
- <li>
58
- <a class="button button--secondary button--circle" href="{{ _href }}"><span>{{ page }}</span></a>
59
- </li>
53
+ {%- elsif page == 1 -%}
54
+ {%- assign _home_path = site.paths.home | default: site.data.variables.default.paths.home -%}
55
+ {%- include snippets/prepend-baseurl.html path=_home_path -%}
56
+ {%- assign _href = __return -%}
57
+ <li>
58
+ <a class="button button--secondary button--circle" href="{{ _href }}"><span>{{ page }}</span></a>
59
+ </li>
60
60
 
61
- {%- else -%}
62
- {%- if _n0 and _n1 -%}
63
- {%- if page > 1 and page < _n0 -%}
64
- {%- if page == 2 -%}<li><span class="pagination__omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
65
- {%- elsif page > _n1 and page < _length -%}
66
- {%- if page == _length_mimus_one -%}<li><span class="omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
61
+ {%- else -%}
62
+ {%- if _n0 and _n1 -%}
63
+ {%- if page > 1 and page < _n0 -%}
64
+ {%- if page == 2 -%}<li><span class="pagination__omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
65
+ {%- elsif page > _n1 and page < _length -%}
66
+ {%- if page == _length_mimus_one -%}<li><span class="pagination__omit"><i class="fas fa-ellipsis-h"></i></span></li>{%- endif -%}
67
+ {%- else -%}
68
+ {%- include snippets/prepend-baseurl.html path=site.paginate_path -%}
69
+ {%- assign _href = __return -%}
70
+ <li>
71
+ <a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
72
+ </li>
73
+ {%- endif -%}
67
74
  {%- else -%}
68
75
  {%- include snippets/prepend-baseurl.html path=site.paginate_path -%}
69
76
  {%- assign _href = __return -%}
@@ -71,27 +78,21 @@
71
78
  <a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
72
79
  </li>
73
80
  {%- endif -%}
74
- {%- else -%}
75
- {%- include snippets/prepend-baseurl.html path=site.paginate_path -%}
76
- {%- assign _href = __return -%}
77
- <li>
78
- <a class="button button--secondary button--circle" href="{{ _href | replace: ':num', page }}"><span>{{ page }}</span></a>
79
- </li>
80
81
  {%- endif -%}
81
- {%- endif -%}
82
- {%- endfor -%}
82
+ {%- endfor -%}
83
83
 
84
- {%- if paginator.next_page -%}
85
- {%- include snippets/prepend-baseurl.html path=paginator.next_page_path -%}
86
- {%- assign _href = __return -%}
87
- <li><a class="button button--secondary button--circle" href="{{ _href }}">
88
- <i class="fas fa-angle-right"></i>
89
- </a></li>
90
- {%- else -%}
91
- <li><div class="button button--secondary button--circle disabled">
92
- <i class="fas fa-angle-right"></i>
93
- </div></li>
94
- {%- endif -%}
95
- </ul>
96
- </nav>
84
+ {%- if paginator.next_page -%}
85
+ {%- include snippets/prepend-baseurl.html path=paginator.next_page_path -%}
86
+ {%- assign _href = __return -%}
87
+ <li><a class="button button--secondary button--circle" href="{{ _href }}">
88
+ <i class="fas fa-angle-right"></i>
89
+ </a></li>
90
+ {%- else -%}
91
+ <li><div class="button button--secondary button--circle disabled">
92
+ <i class="fas fa-angle-right"></i>
93
+ </div></li>
94
+ {%- endif -%}
95
+ </ul>
96
+ </div>
97
+ </div>
97
98
  {%- endif -%}