jekyll-theme-hydure 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '09aea078f2a505f24217466dddee107de01ff95af903f8f3e34a9a7e764dab60'
4
+ data.tar.gz: eb65132368b6b7b195403b86587ce0679a8e33c3e9814ed04dec76acd7c55de6
5
+ SHA512:
6
+ metadata.gz: 16598957d05cc43f152bfd38dfe90546325614cba4c0f8b2145f5152ce8c38cc00f83835885429671fcaf49f3a344797b13538233d92c0addca433794e8e3d03
7
+ data.tar.gz: 8d20f03f502e02781585ebe5816ae9645fdb15bdcf1aacec460887dd0c5cb90942807b5fb6790a9a9e0d1e6549d204eaeebbacf810c3bd0e0acf1bd93d2eec5a
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 zivong
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,184 @@
1
+ # Hydure <!-- omit in toc -->
2
+
3
+ Hydure is a concise two-column blog theme for Jekyll. It is built on the [Pure.css](https://github.com/pure-css/pure) framework.
4
+
5
+ Check out the [demo](https://zivong.blog/jekyll-theme-hydure/).
6
+
7
+ | | Mobile | Desktop |
8
+ | ----- | ------ | ------- |
9
+ | Light | ![Screenshot mobile light](screenshot-mobile-light.png) | ![Screenshot desktop light](screenshot-desktop-light.png) |
10
+ | Dark | ![Screenshot mobile dark](screenshot-mobile-dark.png) | ![Screenshot desktop dark](screenshot-desktop-dark.png) |
11
+
12
+ ## Highlight Features <!-- omit in toc -->
13
+
14
+ - [Open Color](https://github.com/yeun/open-color)
15
+ - Dark mode, via [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
16
+ - [Font Awesome](https://fontawesome.com/)
17
+ - [Jekyll Paginate](https://github.com/jekyll/jekyll-paginate)
18
+ - [Jekyll Feed](https://github.com/jekyll/jekyll-feed/)
19
+ - [Jekyll SEO Tag](https://github.com/jekyll/jekyll-seo-tag/)
20
+ - [MathJax](https://www.mathjax.org/)
21
+ - [Disqus](https://disqus.com/)
22
+ - [Google Analytics 4](https://support.google.com/analytics/answer/10089681?hl=en)
23
+ - Archive implemented by pure [Liquid](https://shopify.github.io/liquid/)
24
+
25
+ ## Table of Contents <!-- omit in toc -->
26
+
27
+ - [Installation](#installation)
28
+ - [Usage](#usage)
29
+ - [Global Configuration](#global-configuration)
30
+ - [Post Configuration](#post-configuration)
31
+ - [Homepage](#homepage)
32
+ - [Custom Head](#custom-head)
33
+ - [Navigation](#navigation)
34
+ - [Social Links](#social-links)
35
+ - [Alert Messages](#alert-messages)
36
+ - [Archive](#archive)
37
+ - [Contributing](#contributing)
38
+ - [Development](#development)
39
+ - [License](#license)
40
+
41
+ ## Installation
42
+
43
+ Add this line to your Jekyll site's `Gemfile`:
44
+
45
+ ```ruby
46
+ gem "jekyll-theme-hydure"
47
+ ```
48
+
49
+ And add this line to your Jekyll site's `_config.yml`:
50
+
51
+ ```yaml
52
+ theme: jekyll-theme-hydure
53
+ ```
54
+
55
+ And then execute:
56
+
57
+ ```shell
58
+ bundle
59
+ ```
60
+
61
+ Or install it yourself as:
62
+
63
+ ```shell
64
+ gem install jekyll-theme-hydure
65
+ ```
66
+
67
+ If your website is hosted on GitHub Pages, you can install this theme via [`jekyll-remote-theme`](https://github.com/benbalter/jekyll-remote-theme).
68
+
69
+ Add the following to your `Gemfile`:
70
+
71
+ ```ruby
72
+ gem "jekyll-remote-theme"
73
+ ```
74
+
75
+ And add this line to your Jekyll site's `_config.yml`:
76
+
77
+ ```yml
78
+ plugins:
79
+ - jekyll-remote-theme
80
+ ```
81
+
82
+ Add the following to your site's `_config.yml`:
83
+
84
+ ```yml
85
+ remote_theme: zivong/jekyll-theme-hydure
86
+ ```
87
+
88
+ ## Usage
89
+
90
+ ### Global Configuration
91
+
92
+ | Variable | Type | Default | Specification |
93
+ | -------- | ---- | ------- | ------------- |
94
+ | `lang` | String | `en` | The language of pages; The value can be overwritten by the `lang` variable on each page. |
95
+ | `title` | String | --- | The title of the website |
96
+ | `tagline` | String | --- | The tagline of the website |
97
+ | `cover` | String | --- | The URL of the sidebar cover image; The value can be overwritten by the `cover` variable on each page. |
98
+ | `author.name` | String | --- | The name of the website author |
99
+ | `author.url` | String | --- | A URL of the website author |
100
+ | `disqus` | String | --- | Disqus short name |
101
+ | `google_analytics` | String | --- | Google Analytics 4 Measurement ID |
102
+ | `tags_path` | String | --- | A path to the archive-by-tags page; It is used by tags on each post |
103
+ | `categories_path` | String | --- | A path to the archive-by-categories page; It is used by categories on each post |
104
+
105
+ ### Post Configuration
106
+
107
+ | Variable | Type | Default | Specification |
108
+ | -------- | ---- | ------- | ------------- |
109
+ | `description` | String | --- | A description of the current post |
110
+ | `last_modified_at` | String | --- | The date of the last modification you made on a post after its publishing |
111
+ | `author` | String or Array | --- | The author name(s) of the post |
112
+ | `math` | Boolean | `false` | Does enable MathJax on this page |
113
+ | `comments` | Boolean | `true` | Does enable the Disqus comment system |
114
+
115
+ ### Homepage
116
+
117
+ You can create a homepage for your site by setting `layout: home` in your `index.html`.
118
+
119
+ ### Custom Head
120
+
121
+ Hydure leaves a placeholder to allow defining custom head. All you need to do is putting data into `_includes/custom-head.html`, and they would be automatically included in `<head>`.
122
+
123
+ ### Navigation
124
+
125
+ The navigation menu of Hydure is configurable. You just need to specify titles and URLs in the file `_data/navigation.yml`, for example,
126
+
127
+ ```yml
128
+ - title: Home
129
+ url: /
130
+ - title: About
131
+ url: /about/
132
+ - title: Archive
133
+ url: /archive/
134
+ ```
135
+
136
+ ### Social Links
137
+
138
+ Hydure allows you to show social links on your website. All you need to do is creating a file `_data/social.yml`, for example,
139
+
140
+ ```yml
141
+ - title: Email
142
+ url: mailto:zivong@protonmail.com
143
+ icon: fas fa-envelope
144
+ - title: Twitter
145
+ url: https://twitter.com/zivong91
146
+ icon: fab fa-twitter
147
+ - title: GitHub
148
+ url: https://github.com/zivong
149
+ icon: fab fa-github
150
+ ```
151
+
152
+ ### Alert Messages
153
+
154
+ Hydure provides a predefined class `message` to specify **alert messages**. You may add it to single elements like a `<p>`, or to a parent if there are multiple elements to show.
155
+
156
+ ### Archive
157
+
158
+ Hydure provides some built-in archive pages. It is implemented in pure Liquid. If you want to archive posts by years, you can create a page and put these code in it:
159
+
160
+ ```yml
161
+ ---
162
+ layout: archive
163
+ type: years
164
+ ---
165
+ ```
166
+
167
+ Similarly, if you want to archive posts by categories or tags, you can set the `type` property as `categories` or `tags`.
168
+
169
+ ## Contributing
170
+
171
+ Bug reports and pull requests are welcome on GitHub at https://github.com/zivong/jekyll-theme-hydure. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
172
+
173
+ ## Development
174
+
175
+ To set up your environment to develop this theme, run `bundle install`.
176
+
177
+ Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
178
+
179
+ When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
180
+ To add a custom directory to your theme-gem, please edit the regexp in `jekyll-theme-hydure.gemspec` accordingly.
181
+
182
+ ## License
183
+
184
+ The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,68 @@
1
+ {%- if page.type == 'categories' -%}
2
+ {%- assign taxonomies = site.categories -%}
3
+ {%- elsif page.type == 'tags' -%}
4
+ {%- assign taxonomies = site.tags -%}
5
+ {%- else -%}
6
+ {%- assign taxonomies = none -%}
7
+ {%- endif -%}
8
+
9
+ {%- assign max_count = 0 -%}
10
+ {%- for taxonomy in taxonomies -%}
11
+ {%- assign posts = taxonomy[1] -%}
12
+ {%- if posts.size > max_count -%}
13
+ {%- assign max_count = posts.size -%}
14
+ {%- endif -%}
15
+ {%- endfor -%}
16
+
17
+ <div class="taxonomies-wrapper">
18
+ <ul class="taxonomies">
19
+ {%- for i in (1..max_count) reversed -%}
20
+ {%- for taxonomy in taxonomies -%}
21
+ {%- assign taxonomy_name = taxonomy[0] -%}
22
+ {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%}
23
+ {%- assign posts = taxonomy[1] -%}
24
+ {%- if posts.size == i -%}
25
+ <li>
26
+ {%- capture link -%}{{ page.permalink }}#{{ slugified_taxonomy_name }}{%- endcapture -%}
27
+ <a class="taxonomy" href="{{ link | relative_url }}">
28
+ <span>
29
+ {%- if page.type == 'tags' -%}
30
+ {{ slugified_taxonomy_name }}
31
+ {%- else -%}
32
+ {{ taxonomy_name }}
33
+ {%- endif -%}
34
+ </span>
35
+ <span class="taxonomy-count">{{ posts.size }}</span>
36
+ </a>
37
+ </li>
38
+ {%- endif -%}
39
+ {%- endfor -%}
40
+ {%- endfor -%}
41
+ </ul>
42
+ </div>
43
+
44
+ {%- for i in (1..max_count) reversed -%}
45
+ {%- for taxonomy in taxonomies -%}
46
+ {%- assign taxonomy_name = taxonomy[0] -%}
47
+ {%- assign slugified_taxonomy_name = taxonomy_name | slugify -%}
48
+ {%- assign posts = taxonomy[1] -%}
49
+ {%- if posts.size == i -%}
50
+ <h2 id="{{ slugified_taxonomy_name }}">
51
+ {%- if page.type == 'tags' -%}
52
+ {{ slugified_taxonomy_name }}
53
+ {%- else -%}
54
+ {{ taxonomy_name }}
55
+ {%- endif -%}
56
+ </h2>
57
+ <ul class="post-list-by-taxonomy">
58
+ {%- for post in posts -%}
59
+ <li>
60
+ <time datetime="{{ page.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time>
61
+ &raquo;
62
+ <a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
63
+ </li>
64
+ {%- endfor -%}
65
+ </ul>
66
+ {%- endif -%}
67
+ {%- endfor -%}
68
+ {%- endfor -%}
@@ -0,0 +1,29 @@
1
+ {% assign taxonomies = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %}
2
+
3
+ <div class="taxonomies-wrapper">
4
+ <ul class="taxonomies">
5
+ {%- for taxonomy in taxonomies -%}
6
+ <li>
7
+ {%- capture link -%}{{ page.permalink }}#{{ taxonomy.name }}{%- endcapture -%}
8
+ <a class="taxonomy" href="{{ link | relative_url }}">
9
+ <span>{{ taxonomy.name }}</span>
10
+ <span class="taxonomy-count">{{ taxonomy.size }}</span>
11
+ </a>
12
+ </li>
13
+ {%- endfor -%}
14
+ </ul>
15
+ </div>
16
+
17
+ {%- for taxonomy in taxonomies -%}
18
+ <h2 id="{{ taxonomy.name }}">{{ taxonomy.name }}</h2>
19
+ <ul class="post-list-by-taxonomy">
20
+ {%- assign posts = taxonomy.items -%}
21
+ {%- for post in posts -%}
22
+ <li>
23
+ <time datetime="{{ page.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time>
24
+ &raquo;
25
+ <a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a>
26
+ </li>
27
+ {%- endfor -%}
28
+ </ul>
29
+ {%- endfor -%}
@@ -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,25 @@
1
+ <footer class="footer pure-g">
2
+ <div class="pure-u-1 pure-u-md-1-2">
3
+ <small>
4
+ &copy;&nbsp;
5
+ {%- assign date_from = site.posts[-1].date | date_to_xmlschema -%}
6
+ {%- assign year_from = date_from | date: '%Y' -%}
7
+ {%- assign date_to = site.time | date_to_xmlschema -%}
8
+ {%- assign year_to = date_to | date: '%Y' -%}
9
+ {%- unless year_from == nil or year_from == year_to -%}
10
+ <time datetime="{{ date_from }}">{{ year_from }}</time>-
11
+ {%- endunless -%}
12
+ <time datetime="{{ date_to }}">{{ year_to }}</time>
13
+ {%- if site.author -%}
14
+ &nbsp;<a href="{{ site.author.url }}" target="_blank">{{ site.author.name }}</a>
15
+ {%- endif -%}
16
+ . All right reserved.
17
+ </small>
18
+ </div>
19
+
20
+ <div class="pure-u-1 pure-u-md-1-2">
21
+ <small>
22
+ Powered by <a href="https://jekyllrb.com/" target="_blank">Jekyll</a> & <a href="https://github.com/zivong/jekyll-theme-hydure" target="_blank">Hydure</a>
23
+ </small>
24
+ </div>
25
+ </footer>
@@ -0,0 +1,9 @@
1
+ <!-- Global site tag (gtag.js) - Google Analytics -->
2
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
3
+ <script>
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,15 @@
1
+ <head>
2
+ <meta charset="utf-8">
3
+ <meta name="viewport" content="width=device-width, initial-scale=1">
4
+ {% feed_meta %}
5
+ {% seo %}
6
+
7
+ <link rel="stylesheet" href="https://unpkg.com/purecss@2.0.5/build/pure-min.css" crossorigin="anonymous">
8
+ <link rel="stylesheet" href="https://unpkg.com/purecss@2.0.5/build/grids-responsive-min.css">
9
+ <link rel="stylesheet" href="{{ 'assets/css/open-color.css' | relative_url }}">
10
+ <link rel="stylesheet" href="{{ 'assets/css/hydure.css' | relative_url }}">
11
+
12
+ <script async src="https://use.fontawesome.com/releases/v5.0.12/js/all.js"></script>
13
+
14
+ {% include custom-head.html %}
15
+ </head>
@@ -0,0 +1,32 @@
1
+ <header class="header">
2
+ <a class="brand-title" href="{{ '/' | relative_url }}">{{ site.title }}</a>
3
+ <p class="brand-tagline">{{ site.tagline }}</p>
4
+
5
+ {% if site.data.navigation %}
6
+ <nav class="nav pure-menu">
7
+ <ul class="pure-menu-list">
8
+ {% for item in site.data.navigation %}
9
+ <li class="nav-item pure-menu-item">
10
+ <a href="{{ item.url | relative_url }}" class="pure-menu-link {% if page.url == item.url %}current{% endif %}">
11
+ {{ item.title }}
12
+ </a>
13
+ </li>
14
+ {% endfor %}
15
+ </ul>
16
+ </nav>
17
+ {% endif %}
18
+
19
+ {% if site.data.social %}
20
+ <div class="social pure-menu pure-menu-horizontal">
21
+ <ul class="social-list pure-menu-list">
22
+ {% for social in site.data.social %}
23
+ <li class="social-item pure-menu-item">
24
+ <a class="pure-menu-link pure-button" href="{{ social.url }}" target="_blank">
25
+ <i class="{{ social.icon | default: 'fas fa-link' }}" title="{{ social.title }}"></i>
26
+ </a>
27
+ </li>
28
+ {% endfor %}
29
+ </ul>
30
+ </div>
31
+ {% endif %}
32
+ </header>
@@ -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,15 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <article>
6
+ <h1>{{ page.title }}</h1>
7
+
8
+ {{ content }}
9
+
10
+ {% if page.type == "years" %}
11
+ {% include archive-by-years.html %}
12
+ {% else %}
13
+ {% include archive-by-tagories.html %}
14
+ {% endif %}
15
+ </article>