hamilton 0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d4f8b9d396d146e89ca5c48436ffb2d40907a856346886681f3807f29294edf2
4
+ data.tar.gz: bf423b2e1cd2727ec108986c740b1483cac8612c678424e8bb72d4cbadc7a803
5
+ SHA512:
6
+ metadata.gz: 2c9d83e59c8b9b7515a385e7871b635f498dfa50dfc0d13f700d4f6ec6277ed6df3605e96d043634fd51af8d24b01ca5bf7fca314ef6d835d2a903e494c41186
7
+ data.tar.gz: a13e644421b980cdefd163a1867bce24df439b868fff8aebfbaf1ff46116f2b03ef731e6c55123b56b18cc90ab88f19e7097fe25e57bd6903f27bc286e3e7ca5
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 hszhakka
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,162 @@
1
+ # Hamilton <!-- omit in toc -->
2
+
3
+ Another minimal style of Jekyll theme for writers. The original purpose of this theme is to be a replacement of the default Jekyll theme -- [Minima](https://github.com/jekyll/minima). Hamilton is an enhancement of Minima but still, keep in minimal.
4
+
5
+ Please check out the [demo](https://hszhakka.github.io/hamilton/).
6
+
7
+ ![screenshot](screenshot.png)
8
+
9
+ ## Features <!-- omit in toc -->
10
+
11
+ - [Jekyll SEO Tag](https://github.com/jekyll/jekyll-seo-tag)
12
+ - [Jekyll Feed](https://github.com/jekyll/jekyll-feed)
13
+ - [Jekyll Sitemap](https://github.com/jekyll/jekyll-sitemap)
14
+ - [Jekyll TOC](https://github.com/allejo/jekyll-toc)
15
+ - [Google Analytics](https://analytics.google.com/)
16
+ - [MathJax](https://www.mathjax.org/)
17
+ - [Disqus](https://disqus.com/)
18
+ - [Font Awesome](https://fontawesome.com/)
19
+ - Customizable head
20
+ - Configurable page navigation
21
+ - Customizable styles and skins
22
+ - Archive pages implemented in pure Liquid
23
+
24
+ ## Table of Contents <!-- omit in toc -->
25
+
26
+ - [Installation](#installation)
27
+ - [Configuration](#configuration)
28
+ - [Optional Parameters](#optional-parameters)
29
+ - [Archive Pages](#archive-pages)
30
+ - [TOC](#toc)
31
+ - [MathJax](#mathjax)
32
+ - [Customization](#customization)
33
+ - [Metadata](#metadata)
34
+ - [Navigation](#navigation)
35
+ - [Social Media](#social-media)
36
+ - [Skins](#skins)
37
+ - [More Customized Styles](#more-customized-styles)
38
+ - [License](#license)
39
+
40
+ ## Installation
41
+
42
+ You can choose one of the following methods to install Hamilton:
43
+
44
+ - Directly specify the `hamilton` gem.
45
+
46
+ 1. Add `gem 'hamilton'` into your `Gemfile`.
47
+ 2. Add the below lines into your `_config.yml`.
48
+
49
+ ```yml
50
+ plugins:
51
+ - hamilton
52
+ ```
53
+
54
+ - If your site is hosted on GitHub Pages, you can use [`jekyll-remote-theme`](https://github.com/benbalter/jekyll-remote-theme) to import the master branch of Hamilton.
55
+
56
+ 1. Add `gem 'jekyll-remote-theme'` into your `Gemfile`.
57
+ 2. Add the below lines into your `_config.yml`.
58
+
59
+ ```yml
60
+ plugins:
61
+ - jekyll-remote-theme
62
+
63
+ remote-theme: hszhakka/hamilton
64
+ ```
65
+
66
+ ## Configuration
67
+
68
+ After installation, you can run `jekyll serve` to check out your site, but before that, *make sure* the below **required parameters** are configured in your `_config.yml`.
69
+
70
+ | Parameters | Types | Specifications |
71
+ |:---------- |:----- |:-------------- |
72
+ | `title` | string | The site title |
73
+ | `disqus` | string | The Disqus shortname; Unless you don't want to enable the comments system, you must specify this parameter. It is used in the production environment. |
74
+ | `google_analytics` | string | The Google Analytics tracking ID; It is used in the production environment. |
75
+
76
+ ### Optional Parameters
77
+
78
+ | Parameters | Types | Specifications |
79
+ |:---------- |:----- |:-------------- |
80
+ | `author` | string | The author name of the site; It would be showed in the copyright statement. |
81
+ | `skin` | string | The skin name. See more information on the [Customization](#customization) section. |
82
+ | `lang` | string | The language of the site; The default value is `en`. |
83
+ | `paginate` | int | The number of posts on each page. To enable pagination, you must use a third-party plugin, e.g. [`jekyll-paginate`](https://github.com/jekyll/jekyll-paginate), [`jekyll-paginate-v2`](https://github.com/sverrirs/jekyll-paginate-v2), or [`jekyll-pagination`](https://github.com/prometheus-ev/jekyll-pagination). |
84
+ | `date_format` | string | The date format; The default value is `%b %-d, %Y`. |
85
+
86
+ ## Archive Pages
87
+
88
+ Hamilton implements some archive templates in pure Liquid. For example, if you want to create a category archive page, set the below parameters on that page:
89
+
90
+ ```yml
91
+ ---
92
+ layout: archive-taxonomies
93
+ type: categories
94
+ ---
95
+ ```
96
+
97
+ Or a tag archive page:
98
+
99
+ ```yml
100
+ layout: archive-taxonomies
101
+ type: tags
102
+ ```
103
+
104
+ Or archive by years:
105
+
106
+ ```yml
107
+ layout: archive-years
108
+ ```
109
+
110
+ ## TOC
111
+
112
+ You can enable a TOC on each post or page, just set `toc: true` on that page.
113
+
114
+ ## MathJax
115
+
116
+ You can enable MathJax on each post or page, just set `math: true` on that page.
117
+
118
+ ## Customization
119
+
120
+ ### Metadata
121
+
122
+ You can create a file `_includes/custom-head.html` in your repository, and add any metadata into that page, e.g. favicons.
123
+
124
+ ### Navigation
125
+
126
+ You can create a file `_data/navigation.yml` to configure links to some pages. For example,
127
+
128
+ ```yml
129
+ - title: About
130
+ url: /about/
131
+ - title: Categories
132
+ url: /categories/
133
+ - title: Tags
134
+ url: /tags/
135
+ ```
136
+
137
+ ### Social Media
138
+
139
+ You can create a file `_data/social.yml` to configure links to your social media. For example,
140
+
141
+ ```yml
142
+ - title: Twitter
143
+ url: https://twitter.com/hszhakka
144
+ icon: fab fa-twitter
145
+ - title: GitHub
146
+ url: https://github.com/hszhakka/hamilton
147
+ icon: fab fa-github
148
+ ```
149
+
150
+ ### Skins
151
+
152
+ You can select a skin by setting `skin` in `_config.yml`. The built-in skins include `daylight`, `midnight`, `sunrise`, and `sunset`. If you don't specify any skin, Hamilton would dynamically select one in these built-in skins according to different hours in a day.
153
+
154
+ You can also customize a new skin, for example, a skin called `solarized`. You need to copy [`_sass/hamilton/skins/daylight.scss`](_sass/hamilton/skins/daylight.scss) into your repository and then rename it to `solarized.scss`, and adjust some colors in that file. Finally, specify `skin: solarized` in `_config.yml`.
155
+
156
+ ### More Customized Styles
157
+
158
+ If you want to create more CSS styles in your site, creating a file `_sass/hamilton/custom-styles.scss`, and putting your code in there, Hamilton would automatically refer to them.
159
+
160
+ ## License
161
+
162
+ The theme is available as open source under the terms of the [MIT License](LICENSE.txt).
@@ -0,0 +1,6 @@
1
+ {% comment %}
2
+ Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons:
3
+
4
+ 1. Head over to https://realfavicongenerator.net/ to add your own favicons.
5
+ 2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet.
6
+ {% endcomment %}
@@ -0,0 +1,17 @@
1
+ <div id="disqus_thread"></div>
2
+ <script>
3
+ var disqus_config = function () {
4
+ this.page.url = '{{ page.url | absolute_url }}';
5
+ this.page.identifier = '{{ page.url | absolute_url }}';
6
+ };
7
+
8
+ (function() {
9
+ var d = document, s = d.createElement('script');
10
+
11
+ s.src = 'https://{{ site.disqus }}.disqus.com/embed.js';
12
+
13
+ s.setAttribute('data-timestamp', +new Date());
14
+ (d.head || d.body).appendChild(s);
15
+ })();
16
+ </script>
17
+ <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
@@ -0,0 +1,29 @@
1
+ <footer id="footer" class="site-footer">
2
+ <div class="wrapper">
3
+ <p class="feed-subscribe">
4
+ <a href="{{ 'feed.xml' | relative_url }}">
5
+ <i class="feed-icon fas fa-rss"></i><span>Subscribe</span>
6
+ </a>
7
+ </p>
8
+
9
+ {% if site.data.social %}
10
+ <div class="social-icons">
11
+ {% for social in site.data.social %}
12
+ <a class="social-icon" href="{{ social.url }}"><i class="{{ social.icon | default: 'fas fa-link' }} fa-2x" title="{{ social.title }}"></i></a>
13
+ {% endfor %}
14
+ </div>
15
+ {% endif %}
16
+
17
+ <div class="copyright">
18
+ {% assign year_from = site.posts[-1].date | date: '%Y' %}
19
+ {% assign year_to = site.time | date: '%Y' %}
20
+ {% if year_from == nil or year_from == year_to %}
21
+ {% assign year_string = year_from %}
22
+ {% else %}
23
+ {% assign year_string = year_from | append: '&nbsp;' | append: '-' | append: '&nbsp;' | append: year_to %}
24
+ {% endif %}
25
+ <p>© {{ year_string }} {% if site.author %}{{ site.author }}{% endif %}; Powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/hszhakka/hamilton">Hamilton</a>. All rights reserved.</p>
26
+ </div>
27
+ </div>
28
+ </footer>
29
+
@@ -0,0 +1,9 @@
1
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
2
+ <script>
3
+ window['ga-disable-{{ site.google_analytics }}'] = window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1";
4
+ window.dataLayer = window.dataLayer || [];
5
+ function gtag(){dataLayer.push(arguments);}
6
+ gtag('js', new Date());
7
+
8
+ gtag('config', '{{ site.google_analytics }}');
9
+ </script>
@@ -0,0 +1,43 @@
1
+ <meta charset="utf-8">
2
+
3
+ {% seo %}
4
+
5
+ {% feed_meta %}
6
+
7
+ {% if jekyll.environment == 'production' and site.google_analytics %}
8
+ {% include google-analytics.html %}
9
+ {% endif %}
10
+
11
+ {% if page.math %}
12
+ {% include mathjax.html %}
13
+ {% endif %}
14
+
15
+ <link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
16
+ <link rel="stylesheet" href="{{ '/assets/css/skin.css' | relative_url }}">
17
+
18
+ <!-- Begin selecting skin -->
19
+ {% unless site.skin %}
20
+ <script>
21
+ const hour = (new Date()).getHours();
22
+ let filename = "";
23
+ if (hour >= 5 && hour < 7) {
24
+ filename = "{{ '/assets/css/skin-sunrise.css' | relative_url }}";
25
+ } else if (hour >= 7 && hour < 17) {
26
+ filename = "{{ '/assets/css/skin-daylight.css' | relative_url }}";
27
+ } else if (hour >= 17 && hour < 19) {
28
+ filename = "{{ '/assets/css/skin-sunset.css' | relative_url }}";
29
+ } else {
30
+ filename = "{{ '/assets/css/skin-midnight.css' | relative_url }}";
31
+ }
32
+ const elem = document.createElement("link");
33
+ elem.setAttribute("rel", "stylesheet");
34
+ elem.setAttribute("type", "text/css");
35
+ elem.setAttribute("href", filename);
36
+ document.getElementsByTagName("head")[0].appendChild(elem);
37
+ </script>
38
+ {% endunless %}
39
+ <!-- End selecting skin -->
40
+
41
+ <script src="https://use.fontawesome.com/releases/v5.0.12/js/all.js"></script>
42
+
43
+ {% include custom-head.html %}
@@ -0,0 +1,27 @@
1
+ <header class="site-header">
2
+
3
+ <div class="wrapper">
4
+ <a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
5
+
6
+ {% if site.data.navigation %}
7
+ <nav class="site-nav">
8
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
9
+ <label for="nav-trigger">
10
+ <span class="menu-icon">
11
+ <svg viewBox="0 0 18 15" width="18px" height="15px">
12
+ <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
13
+ </svg>
14
+ </span>
15
+ </label>
16
+
17
+ <div class="trigger">
18
+ {% for nav in site.data.navigation %}
19
+ {% if nav.title %}
20
+ <a class="page-link {% if page.url == nav.url %}current-page{% endif %}" href="{{ nav.url | relative_url }}">{{ nav.title | escape }}</a>
21
+ {% endif %}
22
+ {% endfor %}
23
+ </div>
24
+ </nav>
25
+ {% endif %}
26
+ </div>
27
+ </header>
@@ -0,0 +1,9 @@
1
+ {% capture align %}align-{{ include.align | default: "center" }}{% endcapture %}
2
+ {% if include.caption %}
3
+ <figure class="{{ align }}">
4
+ <img class="{{ align }}" src="{{ include.src | absolute_url }}" alt="{{ include.caption }}" {% if include.width %}width="{{ include.width }}"{% endif %} {% if include.height %}height="{{ include.height }}"{% endif %}/>
5
+ <figcaption class="{{ align }}">{{ include.caption }}</figcaption>
6
+ </figure>
7
+ {% else %}
8
+ <img class="{{ align }}" src="{{ include.src | absolute_url }}" alt="{{ include.alt }}" {% if include.width %}width="{{ include.width }}"{% endif %} {% if include.height %}height="{{ include.height }}"{% endif %}/>
9
+ {% endif %}
@@ -0,0 +1,2 @@
1
+ <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
2
+ <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
@@ -0,0 +1,96 @@
1
+ {% capture tocWorkspace %}
2
+ {% comment %}
3
+ Version 1.0.10
4
+ https://github.com/allejo/jekyll-toc
5
+
6
+ "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
7
+
8
+ Usage:
9
+ {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
10
+
11
+ Parameters:
12
+ * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
13
+
14
+ Optional Parameters:
15
+ * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
16
+ * class (string) : '' - a CSS class assigned to the TOC
17
+ * id (string) : '' - an ID to assigned to the TOC
18
+ * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
19
+ * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
20
+ * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
21
+ * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
22
+ * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
23
+ * anchor_class (string) : '' - add custom class(es) for each anchor element
24
+
25
+ Output:
26
+ An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
27
+ generate the table of contents and will NOT output the markdown given to it
28
+ {% endcomment %}
29
+
30
+ {% capture my_toc %}{% endcapture %}
31
+ {% assign orderedList = include.ordered | default: false %}
32
+ {% assign minHeader = include.h_min | default: 1 %}
33
+ {% assign maxHeader = include.h_max | default: 6 %}
34
+ {% assign nodes = include.html | split: '<h' %}
35
+ {% assign firstHeader = true %}
36
+
37
+ {% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}
38
+
39
+ {% for node in nodes %}
40
+ {% if node == "" %}
41
+ {% continue %}
42
+ {% endif %}
43
+
44
+ {% assign headerLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
45
+
46
+ {% if headerLevel < minHeader or headerLevel > maxHeader %}
47
+ {% continue %}
48
+ {% endif %}
49
+
50
+ {% if firstHeader %}
51
+ {% assign firstHeader = false %}
52
+ {% assign minHeader = headerLevel %}
53
+ {% endif %}
54
+
55
+ {% assign indentAmount = headerLevel | minus: minHeader %}
56
+ {% assign _workspace = node | split: '</h' %}
57
+
58
+ {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
59
+ {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
60
+ {% assign html_id = _idWorkspace[0] %}
61
+
62
+ {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
63
+ {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
64
+ {% assign html_class = _classWorkspace[0] %}
65
+
66
+ {% if html_class contains "no_toc" %}
67
+ {% continue %}
68
+ {% endif %}
69
+
70
+ {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
71
+ {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
72
+
73
+ {% assign space = '' %}
74
+ {% for i in (1..indentAmount) %}
75
+ {% assign space = space | prepend: ' ' %}
76
+ {% endfor %}
77
+
78
+ {% if include.item_class and include.item_class != blank %}
79
+ {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %}
80
+ {% endif %}
81
+
82
+ {% capture heading_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
83
+ {% capture my_toc %}{{ my_toc }}
84
+ {{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %}
85
+ {% endfor %}
86
+
87
+ {% if include.class and include.class != blank %}
88
+ {% capture my_toc %}{:.{{ include.class }}}
89
+ {{ my_toc | lstrip }}{% endcapture %}
90
+ {% endif %}
91
+
92
+ {% if include.id %}
93
+ {% capture my_toc %}{: #{{ include.id }}}
94
+ {{ my_toc | lstrip }}{% endcapture %}
95
+ {% endif %}
96
+ {% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }}
@@ -0,0 +1,76 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ {{ content }}
6
+
7
+ {% comment %} Check the type of archive {% endcomment %}
8
+ {%- if page.type == 'categories' -%}
9
+ {%- assign taxonomies = site.categories -%}
10
+ {%- elsif page.type == 'tags' -%}
11
+ {%- assign taxonomies = site.tags -%}
12
+ {%- else -%}
13
+ {%- assign taxonomies = none -%}
14
+ {%- endif -%}
15
+
16
+ {% comment %} Calculate the max count of taxonomies {% endcomment %}
17
+ {%- assign max_count = 0 -%}
18
+ {%- for taxonomy in taxonomies -%}
19
+ {%- assign posts = taxonomy[1] -%}
20
+ {%- if posts.size > max_count -%}
21
+ {%- assign max_count = posts.size -%}
22
+ {%- endif -%}
23
+ {%- endfor -%}
24
+
25
+ <div class="taxonomies-wrapper">
26
+ <ul class="taxonomies">
27
+ {%- for i in (1..max_count) reversed -%}
28
+ {%- for taxonomy in taxonomies -%}
29
+ {%- assign taxonomy_name = taxonomy[0] -%}
30
+ {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%}
31
+ {%- assign posts = taxonomy[1] -%}
32
+ {%- if posts.size == i -%}
33
+ <li>
34
+ {%- capture link -%}{{ page.permalink }}#{{ slugified_taxonomy_name }}{%- endcapture -%}
35
+ <a class="taxonomy" href="{{ link | relative_url }}">
36
+ <span>
37
+ {%- if page.type == 'tags' -%}
38
+ {{ slugified_taxonomy_name }}
39
+ {%- else -%}
40
+ {{ taxonomy_name }}
41
+ {%- endif -%}
42
+ </span>
43
+ <span class="taxonomy-count">{{ posts.size }}</span>
44
+ </a>
45
+ </li>
46
+ {%- endif -%}
47
+ {%- endfor -%}
48
+ {%- endfor -%}
49
+ </ul>
50
+ </div>
51
+
52
+ {% comment %} Show posts by taxonomy {% endcomment %}
53
+ {%- for i in (1..max_count) reversed -%}
54
+ {%- for taxonomy in taxonomies -%}
55
+ {%- assign taxonomy_name = taxonomy[0] -%}
56
+ {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%}
57
+ {%- assign posts = taxonomy[1] -%}
58
+ {%- if posts.size == i -%}
59
+ <h2 id="{{ slugified_taxonomy_name }}">
60
+ {%- if page.type == 'tags' -%}
61
+ {{ slugified_taxonomy_name }}
62
+ {%- else -%}
63
+ {{ taxonomy_name }}
64
+ {%- endif -%}
65
+ </h2>
66
+ <ul class="post-list-by-taxonomy">
67
+ {%- for post in posts -%}
68
+ <li>
69
+ <time datetime="{{ page.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time> &raquo; <a href="{{ post.url }}">{{ post.title | escape }}</a>
70
+ </li>
71
+ {%- endfor -%}
72
+ </ul>
73
+ <a href="#" class="back-to-top">Top &#8648;</a>
74
+ {%- endif -%}
75
+ {%- endfor -%}
76
+ {%- endfor -%}
@@ -0,0 +1,37 @@
1
+ ---
2
+ layout: page
3
+ ---
4
+
5
+ {{ content }}
6
+
7
+ {%- assign taxonomies = site.posts | group_by_exp: "post", "post.date | date: '%Y'" -%}
8
+
9
+ <div class="taxonomies-wrapper">
10
+ <ul class="taxonomies">
11
+ {%- for taxonomy in taxonomies -%}
12
+ <li>
13
+ {%- capture link -%}{{ page.permalink }}#{{ taxonomy.name }}{%- endcapture -%}
14
+ <a class="taxonomy" href="{{ link | relative_url }}">
15
+ <span>{{ taxonomy.name }}</span>
16
+ <span class="taxonomy-count">{{ taxonomy.size }}</span>
17
+ </a>
18
+ </li>
19
+ {%- endfor -%}
20
+ </ul>
21
+ </div>
22
+
23
+ {% comment %} Show posts by taxonomy {% endcomment %}
24
+ {%- for taxonomy in taxonomies -%}
25
+ <h2 id="{{ taxonomy.name }}">
26
+ {{ taxonomy.name }}
27
+ </h2>
28
+ <ul class="post-list-by-taxonomy">
29
+ {%- assign posts = taxonomy.items -%}
30
+ {%- for post in posts -%}
31
+ <li>
32
+ <time datetime="{{ page.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time> &raquo; <a href="{{ post.url }}">{{ post.title | escape }}</a>
33
+ </li>
34
+ {%- endfor -%}
35
+ </ul>
36
+ <a href="#" class="back-to-top">Top &#8648;</a>
37
+ {%- endfor -%}
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ page.lang | default: site.lang | default: "en" }}">
3
+
4
+ <head>
5
+ {% include head.html %}
6
+ </head>
7
+
8
+ <body>
9
+
10
+ {% include header.html %}
11
+
12
+ <main class="page-content" aria-label="Content">
13
+ {{ content }}
14
+ </main>
15
+
16
+ {% include footer.html %}
17
+
18
+ </body>
19
+
20
+ </html>
@@ -0,0 +1,56 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <div class="home wrapper">
6
+
7
+ {{ content }}
8
+
9
+ {% if site.paginate %}
10
+ {% assign posts = paginator.posts %}
11
+ {% else %}
12
+ {% assign posts = site.posts %}
13
+ {% endif %}
14
+
15
+ {%- if posts.size > 0 -%}
16
+ {%- if page.list_title -%}
17
+ <h2 class="post-list-heading">{{ page.list_title }}</h2>
18
+ {%- endif -%}
19
+ <ul class="post-list">
20
+ {%- assign date_format = site.date_format | default: "%b %-d, %Y" -%}
21
+ {%- for post in posts -%}
22
+ <li>
23
+ <h3>
24
+ <a class="post-link" href="{{ post.url | relative_url }}">
25
+ {{ post.title | escape }}
26
+ </a>
27
+ </h3>
28
+ <span class="post-meta">{{ post.date | date: date_format }}</span>
29
+ {%- if page.show_excerpts != false -%}
30
+ <p>{{ post.excerpt }}</p>
31
+ {%- endif -%}
32
+ </li>
33
+ {%- endfor -%}
34
+ </ul>
35
+
36
+ {% if site.paginate %}
37
+ <div class="pager">
38
+ <ul class="pagination">
39
+ {%- if paginator.previous_page %}
40
+ <li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page">{{ paginator.previous_page }}</a></li>
41
+ {%- else %}
42
+ <li><div class="pager-edge">•</div></li>
43
+ {%- endif %}
44
+ <li><div class="current-page">{{ paginator.page }}</div></li>
45
+ {%- if paginator.next_page %}
46
+ <li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page">{{ paginator.next_page }}</a></li>
47
+ {%- else %}
48
+ <li><div class="pager-edge">•</div></li>
49
+ {%- endif %}
50
+ </ul>
51
+ </div>
52
+ {%- endif %}
53
+
54
+ {%- endif -%}
55
+
56
+ </div>
@@ -0,0 +1,32 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <article class="post">
6
+
7
+ <header class="post-header">
8
+ <div class="wrapper">
9
+ <h1 class="post-title">{{ page.title | escape }}</h1>
10
+ </div>
11
+ </header>
12
+
13
+ <div class="wrapper post-body-wrapper">
14
+
15
+ <div class="post-content">
16
+ {{ content }}
17
+ </div>
18
+
19
+ {% if page.toc %}
20
+ <aside class="post-aside">
21
+ <div class="post-toc-container">
22
+ <h2 class="post-toc-title">Table of Contents</h2>
23
+ <nav class="post-toc">
24
+ {% include toc.html html=content %}
25
+ </nav>
26
+ </div>
27
+ </aside>
28
+ {% endif %}
29
+
30
+ </div>
31
+
32
+ </article>