sparrow-jekyll-theme 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +162 -0
- data/_includes/analytics.html +13 -0
- data/_includes/breadcrumbs.html +32 -0
- data/_includes/comments.html +26 -0
- data/_includes/figure +12 -0
- data/_includes/paginator.html +69 -0
- data/_includes/post-entry.html +16 -0
- data/_includes/seo.html +77 -0
- data/_includes/social-share.html +42 -0
- data/_includes/topnav.html +47 -0
- data/_layouts/default.html +46 -0
- data/_layouts/home.html +12 -0
- data/_layouts/page.html +17 -0
- data/_layouts/post.html +38 -0
- data/_sass/_base.scss +359 -0
- data/_sass/_buttons.scss +62 -0
- data/_sass/_footer.scss +53 -0
- data/_sass/_navigation.scss +217 -0
- data/_sass/_page.scss +59 -0
- data/_sass/_post.scss +85 -0
- data/_sass/_reset.scss +187 -0
- data/_sass/_rrssb.scss +277 -0
- data/_sass/_slimmenu.scss +177 -0
- data/_sass/_syntax.scss +126 -0
- data/_sass/_utilities.scss +67 -0
- data/_sass/_variables.scss +72 -0
- data/_sass/vendor/breakpoint/_breakpoint.scss +114 -0
- data/_sass/vendor/breakpoint/_context.scss +95 -0
- data/_sass/vendor/breakpoint/_helpers.scss +151 -0
- data/_sass/vendor/breakpoint/_legacy-settings.scss +50 -0
- data/_sass/vendor/breakpoint/_no-query.scss +15 -0
- data/_sass/vendor/breakpoint/_parsers.scss +215 -0
- data/_sass/vendor/breakpoint/_respond-to.scss +82 -0
- data/_sass/vendor/breakpoint/_settings.scss +71 -0
- data/_sass/vendor/breakpoint/parsers/_double.scss +33 -0
- data/_sass/vendor/breakpoint/parsers/_query.scss +82 -0
- data/_sass/vendor/breakpoint/parsers/_resolution.scss +31 -0
- data/_sass/vendor/breakpoint/parsers/_single.scss +26 -0
- data/_sass/vendor/breakpoint/parsers/_triple.scss +36 -0
- data/_sass/vendor/breakpoint/parsers/double/_default-pair.scss +21 -0
- data/_sass/vendor/breakpoint/parsers/double/_default.scss +22 -0
- data/_sass/vendor/breakpoint/parsers/double/_double-string.scss +22 -0
- data/_sass/vendor/breakpoint/parsers/resolution/_resolution.scss +60 -0
- data/_sass/vendor/breakpoint/parsers/single/_default.scss +13 -0
- data/_sass/vendor/breakpoint/parsers/triple/_default.scss +18 -0
- data/_sass/vendor/font-awesome/_animated.scss +34 -0
- data/_sass/vendor/font-awesome/_bordered-pulled.scss +25 -0
- data/_sass/vendor/font-awesome/_core.scss +12 -0
- data/_sass/vendor/font-awesome/_fixed-width.scss +6 -0
- data/_sass/vendor/font-awesome/_font-awesome.scss +18 -0
- data/_sass/vendor/font-awesome/_icons.scss +789 -0
- data/_sass/vendor/font-awesome/_larger.scss +13 -0
- data/_sass/vendor/font-awesome/_list.scss +19 -0
- data/_sass/vendor/font-awesome/_mixins.scss +60 -0
- data/_sass/vendor/font-awesome/_path.scss +15 -0
- data/_sass/vendor/font-awesome/_rotated-flipped.scss +20 -0
- data/_sass/vendor/font-awesome/_screen-reader.scss +5 -0
- data/_sass/vendor/font-awesome/_stacked.scss +20 -0
- data/_sass/vendor/font-awesome/_variables.scss +800 -0
- data/_sass/vendor/susy/_su.scss +4 -0
- data/_sass/vendor/susy/_susy.scss +4 -0
- data/_sass/vendor/susy/_susyone.scss +4 -0
- data/_sass/vendor/susy/susy/_su.scss +7 -0
- data/_sass/vendor/susy/susy/language/_susy.scss +24 -0
- data/_sass/vendor/susy/susy/language/_susyone.scss +13 -0
- data/_sass/vendor/susy/susy/language/susy/_background.scss +385 -0
- data/_sass/vendor/susy/susy/language/susy/_bleed.scss +200 -0
- data/_sass/vendor/susy/susy/language/susy/_box-sizing.scss +47 -0
- data/_sass/vendor/susy/susy/language/susy/_breakpoint-plugin.scss +185 -0
- data/_sass/vendor/susy/susy/language/susy/_container.scss +81 -0
- data/_sass/vendor/susy/susy/language/susy/_context.scss +36 -0
- data/_sass/vendor/susy/susy/language/susy/_gallery.scss +94 -0
- data/_sass/vendor/susy/susy/language/susy/_grids.scss +64 -0
- data/_sass/vendor/susy/susy/language/susy/_gutters.scss +154 -0
- data/_sass/vendor/susy/susy/language/susy/_isolate.scss +77 -0
- data/_sass/vendor/susy/susy/language/susy/_margins.scss +94 -0
- data/_sass/vendor/susy/susy/language/susy/_padding.scss +74 -0
- data/_sass/vendor/susy/susy/language/susy/_rows.scss +138 -0
- data/_sass/vendor/susy/susy/language/susy/_settings.scss +216 -0
- data/_sass/vendor/susy/susy/language/susy/_span.scss +163 -0
- data/_sass/vendor/susy/susy/language/susy/_validation.scss +16 -0
- data/_sass/vendor/susy/susy/language/susyone/_background.scss +18 -0
- data/_sass/vendor/susy/susy/language/susyone/_functions.scss +377 -0
- data/_sass/vendor/susy/susy/language/susyone/_grid.scss +312 -0
- data/_sass/vendor/susy/susy/language/susyone/_isolation.scss +51 -0
- data/_sass/vendor/susy/susy/language/susyone/_margin.scss +93 -0
- data/_sass/vendor/susy/susy/language/susyone/_media.scss +105 -0
- data/_sass/vendor/susy/susy/language/susyone/_padding.scss +92 -0
- data/_sass/vendor/susy/susy/language/susyone/_settings.scss +60 -0
- data/_sass/vendor/susy/susy/output/_float.scss +9 -0
- data/_sass/vendor/susy/susy/output/_shared.scss +15 -0
- data/_sass/vendor/susy/susy/output/_support.scss +9 -0
- data/_sass/vendor/susy/susy/output/float/_container.scss +16 -0
- data/_sass/vendor/susy/susy/output/float/_end.scss +40 -0
- data/_sass/vendor/susy/susy/output/float/_isolate.scss +22 -0
- data/_sass/vendor/susy/susy/output/float/_span.scss +35 -0
- data/_sass/vendor/susy/susy/output/shared/_background.scss +26 -0
- data/_sass/vendor/susy/susy/output/shared/_container.scss +21 -0
- data/_sass/vendor/susy/susy/output/shared/_direction.scss +42 -0
- data/_sass/vendor/susy/susy/output/shared/_inspect.scss +25 -0
- data/_sass/vendor/susy/susy/output/shared/_margins.scss +23 -0
- data/_sass/vendor/susy/susy/output/shared/_output.scss +14 -0
- data/_sass/vendor/susy/susy/output/shared/_padding.scss +23 -0
- data/_sass/vendor/susy/susy/output/support/_background.scss +58 -0
- data/_sass/vendor/susy/susy/output/support/_box-sizing.scss +19 -0
- data/_sass/vendor/susy/susy/output/support/_clearfix.scss +18 -0
- data/_sass/vendor/susy/susy/output/support/_prefix.scss +19 -0
- data/_sass/vendor/susy/susy/output/support/_rem.scss +22 -0
- data/_sass/vendor/susy/susy/output/support/_support.scss +85 -0
- data/_sass/vendor/susy/susy/su/_grid.scss +103 -0
- data/_sass/vendor/susy/susy/su/_settings.scss +73 -0
- data/_sass/vendor/susy/susy/su/_utilities.scss +111 -0
- data/_sass/vendor/susy/susy/su/_validation.scss +57 -0
- data/assets/css/main.scss +43 -0
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.eot +0 -0
- data/assets/fonts/fontawesome-webfont.svg +2671 -0
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/js/main.js +35 -0
- data/assets/js/plugins/jquery-1.12.4.min.js +5 -0
- data/assets/js/plugins/rrssb.min.js +1 -0
- data/assets/js/slimmenu.js +155 -0
- metadata +226 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7349aca7e9f1506bb304f59683e0eae8a184dc77
|
4
|
+
data.tar.gz: aec4bdbb31e5c3d94064087c2e0b67f4ea029750
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d3bd5b460d489a8001ae5b5e8bf8970c6a1db54f1846dc593d9fe9693cb037d5fdbe86f8e8d05cd85e7a13b166ca85e35630dfef7fceb2d7c852c458effa064
|
7
|
+
data.tar.gz: 1f548527d6d1384c8f1683e3fda87f340a65f07877f62945c3c793842bbe4e56a07b49b5ab102c95a0cb3c848cc901b13d3b8b3332922277ed9b48a63f0a0e78
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Lingyi Hu
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
# Sparrow
|
2
|
+
|
3
|
+
A clean minimal Jekyll theme for writers.
|
4
|
+
|
5
|
+
[Live Demo](http://theconfused.me/sparrow)
|
6
|
+
|
7
|
+
- [Features](#features)
|
8
|
+
- [Why the name?](#why-the-name)
|
9
|
+
- [Install](#install)
|
10
|
+
- [General configuration](#general-configuration)
|
11
|
+
- [Disqus](#disqus)
|
12
|
+
- [Google analytics](#google-analytics)
|
13
|
+
- [Collections](#collections)
|
14
|
+
- [Pagination](#pagination)
|
15
|
+
- [Navigation](#navigation)
|
16
|
+
- [Front matter defaults](#front-matter-defaults)
|
17
|
+
- [Other](#other)
|
18
|
+
- [Credits](#credits)
|
19
|
+
|
20
|
+
## Screenshot
|
21
|
+
|
22
|
+
![](screenshot.png)
|
23
|
+
|
24
|
+
## Features
|
25
|
+
|
26
|
+
- Fully compatible with Github Pages
|
27
|
+
- Configurable and responsive multi layer menu, adapted from [slimmenu](https://github.com/adnantopal/slimmenu)
|
28
|
+
- Disqus integration
|
29
|
+
- [Font Awesome icons](http://fontawesome.io/) included
|
30
|
+
- Google analytics
|
31
|
+
- Social sharing using [rrssb](https://www.rrssb.ml/)
|
32
|
+
- 404 page included
|
33
|
+
- Typographic optimization for Chinese fonts
|
34
|
+
- Atom feed generated with [jekyll-feed](https://github.com/jekyll/jekyll-feed)
|
35
|
+
- Pagination enabled for blog using [jekyll-paginate](https://github.com/jekyll/jekyll-paginate)
|
36
|
+
- Basic SEO with Facebook Open Graph tags and Twitter cards
|
37
|
+
|
38
|
+
## Why the name?
|
39
|
+
|
40
|
+
In Chinese there's a saying that goes 麻雀虽小,五脏俱全。It roughly translates to: small though a sparrow is, it possesses all internal organs. Small but complete is what this theme aspires to be. Minimal but includes all the essential aspects to building a blog.
|
41
|
+
|
42
|
+
## Install
|
43
|
+
|
44
|
+
Just fork this repo and replace the posts with your own. Also rename the sample poetry collection to replace it with your own collection, or just delete it if you don't need to use collections. The example is poetry, but you can easily revamp this into essays, short stories, portfolio, or whatever your creative work is.
|
45
|
+
|
46
|
+
To run your site locally, do `bundle exec jekyll serve`.
|
47
|
+
|
48
|
+
For customization, see below.
|
49
|
+
|
50
|
+
### General configuration
|
51
|
+
|
52
|
+
Customize these values in the `_config.yml` file:
|
53
|
+
|
54
|
+
```yaml
|
55
|
+
title : "Sparrow"
|
56
|
+
title_separator : "-"
|
57
|
+
description : "A clean and minimal theme for writers."
|
58
|
+
favicon : "/assets/images/bird.png"
|
59
|
+
avatar : "/assets/images/bird.png"
|
60
|
+
url : "https://theconfused.me" # the base hostname & protocol for your site e.g. "https://mmistakes.github.io"
|
61
|
+
baseurl : "/sparrow"
|
62
|
+
|
63
|
+
# Site Author
|
64
|
+
author:
|
65
|
+
name : "Lingyi" # appears in the footer and atom feed
|
66
|
+
```
|
67
|
+
|
68
|
+
|
69
|
+
### Disqus
|
70
|
+
|
71
|
+
To activate Disqus, fill in your disqus shortname:
|
72
|
+
|
73
|
+
```yaml
|
74
|
+
comments : true # set it to false to disable comments
|
75
|
+
disqus:
|
76
|
+
shortname : your_shortname
|
77
|
+
```
|
78
|
+
|
79
|
+
### Google analytics
|
80
|
+
|
81
|
+
Enable google analytics by filling in your tracking ID:
|
82
|
+
|
83
|
+
```yaml
|
84
|
+
analytics:
|
85
|
+
google:
|
86
|
+
tracking_id : # add your google tracking id here
|
87
|
+
```
|
88
|
+
|
89
|
+
### Collections
|
90
|
+
|
91
|
+
If you are using collections, be sure to replace this with your collection name:
|
92
|
+
|
93
|
+
```yaml
|
94
|
+
collections:
|
95
|
+
poetry:
|
96
|
+
output: true
|
97
|
+
permalink: /:collection/:title/
|
98
|
+
```
|
99
|
+
|
100
|
+
### Pagination
|
101
|
+
|
102
|
+
Currently, pagination is set to a the blog page. Unfortunately Jekyll does not yet support pagination on multiple pages.
|
103
|
+
|
104
|
+
If you want to paginate on a different page, simply change the `paginate_path` value in the config file and create the relevant page.
|
105
|
+
|
106
|
+
```yaml
|
107
|
+
paginate: 5 # amount of posts to show
|
108
|
+
paginate_path: "/blog/page:num/"
|
109
|
+
timezone: # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
110
|
+
```
|
111
|
+
|
112
|
+
### Navigation
|
113
|
+
|
114
|
+
You can change the navigation links in `_data/navigation.yml`.
|
115
|
+
|
116
|
+
### Front matter defaults
|
117
|
+
|
118
|
+
At the bottom of the config file, you can also set [front matter defaults](https://jekyllrb.com/docs/configuration/#front-matter-defaults) so that you don't have to repeat the same front matter for every post. This is an example:
|
119
|
+
|
120
|
+
```yaml
|
121
|
+
# Front matter defaults
|
122
|
+
defaults:
|
123
|
+
# _pages
|
124
|
+
- scope:
|
125
|
+
path: ""
|
126
|
+
type: pages
|
127
|
+
values:
|
128
|
+
layout: page
|
129
|
+
comments: false
|
130
|
+
# _posts
|
131
|
+
- scope:
|
132
|
+
path: ""
|
133
|
+
type: posts
|
134
|
+
values:
|
135
|
+
layout: post
|
136
|
+
comments: true
|
137
|
+
share: true
|
138
|
+
# _poetry
|
139
|
+
- scope:
|
140
|
+
path: ""
|
141
|
+
type: poetry
|
142
|
+
values:
|
143
|
+
layout: post
|
144
|
+
share: false
|
145
|
+
```
|
146
|
+
|
147
|
+
### Other
|
148
|
+
|
149
|
+
To enhance SEO, you can add your twitter username to `_config.yml`.
|
150
|
+
|
151
|
+
You can also add a image path for the `og_image` value in the config file, for a default open graph sharing image. This value can be overridden in individual posts.
|
152
|
+
|
153
|
+
For the various config options see the [sample config file for the demo site](https://github.com/lingxz/sparrow/blob/master/_config.yml)
|
154
|
+
|
155
|
+
There are also helper classes for ease of inserting image and their captions, adapted from the [Minimal Mistakes theme by Michael Rose](https://github.com/mmistakes/minimal-mistakes). You can find a [sample post with images](https://theconfused.me/sparrow/blog/post-with-image/) on the [demo site](https://theconfused.me/sparrow).
|
156
|
+
|
157
|
+
The color schemes and fonts can also be customized through scss, by editing the relevant variable in `_variables.scss`.
|
158
|
+
|
159
|
+
## Credits
|
160
|
+
|
161
|
+
- Bird icon made by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com) and is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).
|
162
|
+
- Photos from [Unsplash](https://unsplash.com/)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{% if site.analytics and page.analytics != false %}
|
2
|
+
|
3
|
+
<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');
|
8
|
+
|
9
|
+
ga('create', '{{ site.analytics.google.tracking_id }}', 'auto');
|
10
|
+
ga('send', 'pageview');
|
11
|
+
</script>
|
12
|
+
|
13
|
+
{% endif %}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{% if page.collection != 'posts' %}
|
2
|
+
{% assign path_type = nil %}
|
3
|
+
{% assign crumb_path = '/' %}
|
4
|
+
{% else %}
|
5
|
+
{% assign crumb_path = site.categories.path %}
|
6
|
+
{% endif %}
|
7
|
+
|
8
|
+
<nav class="breadcrumbs">
|
9
|
+
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
|
10
|
+
{% assign crumbs = page.url | split: '/' %}
|
11
|
+
{% assign i = 1 %}
|
12
|
+
{% for crumb in crumbs offset: 1 %}
|
13
|
+
{% if forloop.first %}
|
14
|
+
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
15
|
+
<a href="{{ site.url }}{{ site.baseurl }}/" itemprop="item"><span itemprop="name">Home</span></a>
|
16
|
+
<meta itemprop="position" content="{{ i }}" />
|
17
|
+
</li>
|
18
|
+
<span class="sep">/</span>
|
19
|
+
{% endif %}
|
20
|
+
{% if forloop.last %}
|
21
|
+
<li class="current">{{ page.title }}</li>
|
22
|
+
{% else %}
|
23
|
+
{% assign i = i | plus: 1 %}
|
24
|
+
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
25
|
+
<a href="{{ crumb | downcase | replace: '%20', '-' | prepend: path_type | prepend: crumb_path | absolute_url }}" itemprop="item"><span itemprop="name">{{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }}</span></a>
|
26
|
+
<meta itemprop="position" content="{{ i }}" />
|
27
|
+
</li>
|
28
|
+
<span class="sep">/</span>
|
29
|
+
{% endif %}
|
30
|
+
{% endfor %}
|
31
|
+
</ol>
|
32
|
+
</nav>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div class="page__comments">
|
2
|
+
|
3
|
+
{% if site.disqus.shortname %}
|
4
|
+
<div id="disqus_thread"></div>
|
5
|
+
<script type="text/javascript">
|
6
|
+
var disqus_shortname = '{{ site.disqus.shortname }}';
|
7
|
+
var disqus_url = '{{ site.url }}/{{ page.url }}';
|
8
|
+
|
9
|
+
/* * * DON'T EDIT BELOW THIS LINE * * */
|
10
|
+
(function() {
|
11
|
+
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
12
|
+
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
13
|
+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
14
|
+
})();
|
15
|
+
|
16
|
+
/* * * DON'T EDIT BELOW THIS LINE * * */
|
17
|
+
(function () {
|
18
|
+
var s = document.createElement('script'); s.async = true;
|
19
|
+
s.type = 'text/javascript';
|
20
|
+
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
|
21
|
+
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
22
|
+
}());
|
23
|
+
</script>
|
24
|
+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
25
|
+
{% endif %}
|
26
|
+
</div>
|
data/_includes/figure
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<figure class="{{ include.class }}">
|
2
|
+
<img src=
|
3
|
+
{% if include.image_path contains "://" %}
|
4
|
+
"{{ include.image_path }}"
|
5
|
+
{% else %}
|
6
|
+
"{{ include.image_path | absolute_url }}"
|
7
|
+
{% endif %}
|
8
|
+
alt="{% if include.alt %}{{ include.alt }}{% endif %}">
|
9
|
+
{% if include.caption %}
|
10
|
+
<figcaption>{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}</figcaption>
|
11
|
+
{% endif %}
|
12
|
+
</figure>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
{% if paginator.total_pages > 1 %}
|
2
|
+
<nav class="pagination">
|
3
|
+
{% assign first_page_path = site.paginate_path | replace: 'page:num', '' | replace: '//', '/' | absolute_url %}
|
4
|
+
<ul>
|
5
|
+
{% comment %} Link for previous page {% endcomment %}
|
6
|
+
{% if paginator.previous_page %}
|
7
|
+
{% if paginator.previous_page == 1 %}
|
8
|
+
<li><a href="{{ first_page_path }}">Previous</a></li>
|
9
|
+
{% else %}
|
10
|
+
<li><a href="{{ site.paginate_path | replace: ':num', paginator.previous_page | replace: '//', '/' | absolute_url }}">Previous</a></li>
|
11
|
+
{% endif %}
|
12
|
+
{% else %}
|
13
|
+
<li><a href="#" class="disabled"><span aria-hidden="true">Previous</span></a></li>
|
14
|
+
{% endif %}
|
15
|
+
|
16
|
+
{% comment %} First page {% endcomment %}
|
17
|
+
{% if paginator.page == 1 %}
|
18
|
+
<li><a href="#" class="disabled current">1</a></li>
|
19
|
+
{% else %}
|
20
|
+
<li><a href="{{ first_page_path }}">1</a></li>
|
21
|
+
{% endif %}
|
22
|
+
|
23
|
+
{% assign page_start = 2 %}
|
24
|
+
{% if paginator.page > 4 %}
|
25
|
+
{% assign page_start = paginator.page | minus: 2 %}
|
26
|
+
{% comment %} Ellipsis for truncated links {% endcomment %}
|
27
|
+
<li><a href="#" class="disabled">…</a></li>
|
28
|
+
{% endif %}
|
29
|
+
|
30
|
+
{% assign page_end = paginator.total_pages | minus: 1 %}
|
31
|
+
{% assign pages_to_end = paginator.total_pages | minus: paginator.page %}
|
32
|
+
{% if pages_to_end > 4 %}
|
33
|
+
{% assign page_end = paginator.page | plus: 2 %}
|
34
|
+
{% endif %}
|
35
|
+
|
36
|
+
{% for index in (page_start..page_end) %}
|
37
|
+
{% if index == paginator.page %}
|
38
|
+
<li><a href="{{ site.paginate_path | replace: ':num', index | replace: '//', '/' | absolute_url }}" class="disabled current">{{ index }}</a></li>
|
39
|
+
{% else %}
|
40
|
+
{% comment %} Distance from current page and this link {% endcomment %}
|
41
|
+
{% assign dist = paginator.page | minus: index %}
|
42
|
+
{% if dist < 0 %}
|
43
|
+
{% comment %} Distance must be a positive value {% endcomment %}
|
44
|
+
{% assign dist = 0 | minus: dist %}
|
45
|
+
{% endif %}
|
46
|
+
<li><a href="{{ site.paginate_path | replace: ':num', index | absolute_url }}">{{ index }}</a></li>
|
47
|
+
{% endif %}
|
48
|
+
{% endfor %}
|
49
|
+
|
50
|
+
{% comment %} Ellipsis for truncated links {% endcomment %}
|
51
|
+
{% if pages_to_end > 3 %}
|
52
|
+
<li><a href="#" class="disabled">…</a></li>
|
53
|
+
{% endif %}
|
54
|
+
|
55
|
+
{% if paginator.page == paginator.total_pages %}
|
56
|
+
<li><a href="#" class="disabled current">{{ paginator.page }}</a></li>
|
57
|
+
{% else %}
|
58
|
+
<li><a href="{{ site.paginate_path | replace: ':num', paginator.total_pages | replace: '//', '/' | absolute_url }}">{{ paginator.total_pages }}</a></li>
|
59
|
+
{% endif %}
|
60
|
+
|
61
|
+
{% comment %} Link next page {% endcomment %}
|
62
|
+
{% if paginator.next_page %}
|
63
|
+
<li><a href="{{ site.paginate_path | replace: ':num', paginator.next_page | replace: '//', '/' | absolute_url }}">Next</a></li></a></li>
|
64
|
+
{% else %}
|
65
|
+
<li><a href="#" class="disabled"><span aria-hidden="true">Next</span></a></li>
|
66
|
+
{% endif %}
|
67
|
+
</ul>
|
68
|
+
</nav>
|
69
|
+
{% endif %}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div class="list__item">
|
2
|
+
<article class="page__item" itemscope itemtype="http://schema.org/CreativeWork">
|
3
|
+
|
4
|
+
<h3 class="page__item-title" itemprop="headline">
|
5
|
+
{% if post.link %}
|
6
|
+
<a href="{{ post.link }}">{{ post.title }}</a> <a href="{{ post.url | absolute_url }}" rel="permalink"><i class="fa fa-link" aria-hidden="true" title="permalink"></i><span class="sr-only">Permalink</span></a>
|
7
|
+
{% else %}
|
8
|
+
<a href="{{ post.url | absolute_url }}" rel="permalink">{{ post.title }}</a>
|
9
|
+
{% endif %}
|
10
|
+
</h3>
|
11
|
+
|
12
|
+
{% if post.date %}
|
13
|
+
<p class="page__meta"> <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }} </time></p>
|
14
|
+
{% endif %}
|
15
|
+
</article>
|
16
|
+
</div>
|
data/_includes/seo.html
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
<!-- begin SEO -->
|
2
|
+
{% if site.url %}
|
3
|
+
{% assign seo_url = site.url | append: site.baseurl %}
|
4
|
+
{% endif %}
|
5
|
+
{% assign seo_url = seo_url | default: site.github.url %}
|
6
|
+
|
7
|
+
{% if page.title %}
|
8
|
+
{% assign seo_title = page.title | append: " " | append: site.title_separator | append: " " | append: site.title %}
|
9
|
+
{% endif %}
|
10
|
+
|
11
|
+
{% if seo_title %}
|
12
|
+
{% assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once %}
|
13
|
+
{% endif %}
|
14
|
+
|
15
|
+
{% if site.url %}
|
16
|
+
{% assign canonical_url = page.url | replace: "index.html", "" | prepend: site.url %}
|
17
|
+
{% endif %}
|
18
|
+
|
19
|
+
<title>{{ seo_title | default: site.title }}{% if paginator %}{% unless paginator.page == 1 %} {{ site.title_separator }} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}{% endif %}</title>
|
20
|
+
|
21
|
+
{% assign seo_description = page.description | default: page.excerpt | default: site.description %}
|
22
|
+
{% if seo_description %}
|
23
|
+
{% assign seo_description = seo_description | markdownify | strip_html | strip_newlines | escape_once %}
|
24
|
+
{% endif %}
|
25
|
+
|
26
|
+
<meta name="description" content="{{ seo_description }}">
|
27
|
+
|
28
|
+
{% assign seo_author = page.author | default: page.author[0] | default: site.author.name %}
|
29
|
+
|
30
|
+
<meta name="author" content="{{ seo_author }}">
|
31
|
+
|
32
|
+
<meta property="og:locale" content="{{ site.locale | replace: "-", "_" | default: "en_US" }}">
|
33
|
+
<meta property="og:site_name" content="{{ site.title }}">
|
34
|
+
<meta property="og:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
|
35
|
+
|
36
|
+
{% if seo_url %}
|
37
|
+
<link rel="canonical" href="{{ page.url | prepend: seo_url | replace: "/index.html", "/" }}">
|
38
|
+
<meta property="og:url" content="{{ page.url | prepend: seo_url | replace: "/index.html", "/" }}">
|
39
|
+
{% endif %}
|
40
|
+
|
41
|
+
{% if page.excerpt %}
|
42
|
+
<meta property="og:description" content="{{ seo_description }}">
|
43
|
+
{% endif %}
|
44
|
+
|
45
|
+
{% if site.twitter.username %}
|
46
|
+
<meta name="twitter:site" content="@{{ site.twitter.username | replace: "@", "" }}">
|
47
|
+
<meta name="twitter:title" content="{{ page.title | default: site.title | markdownify | strip_html | strip_newlines | escape_once }}">
|
48
|
+
<meta name="twitter:description" content="{{ seo_description }}">
|
49
|
+
<meta name="twitter:url" content="{{ canonical_url }}">
|
50
|
+
|
51
|
+
<meta name="twitter:card" content="summary">
|
52
|
+
{% if page.og_image %}
|
53
|
+
<meta name="twitter:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | absolute_url }}{% endif %}">
|
54
|
+
{% elsif site.og_image %}
|
55
|
+
<meta name="twitter:image" content="{{ site.og_image | absolute_url }}">
|
56
|
+
{% endif %}
|
57
|
+
<meta name="twitter:creator" content="@{{ site.twitter.username }}">
|
58
|
+
{% endif %}
|
59
|
+
|
60
|
+
{% if page.og_image %}
|
61
|
+
<meta property="og:image" content="{% if page.header.image contains "://" %}{{ page.header.image }}{% else %}{{ page.header.image | absolute_url }}{% endif %}">
|
62
|
+
{% elsif site.og_image %}
|
63
|
+
<meta property="og:image" content="{% if site.og_image contains "://" %}{{ site.og_image }}{% else %}{{ site.og_image | absolute_url }}{% endif %}">
|
64
|
+
{% endif %}
|
65
|
+
|
66
|
+
{% if page.date %}
|
67
|
+
<meta property="og:type" content="article">
|
68
|
+
<meta property="article:published_time" content="{{ page.date | date_to_xmlschema }}">
|
69
|
+
{% endif %}
|
70
|
+
|
71
|
+
{% if paginator.previous_page %}
|
72
|
+
<link rel="prev" href="{{ paginator.previous_page_path | prepend: seo_url }}">
|
73
|
+
{% endif %}
|
74
|
+
{% if paginator.next_page %}
|
75
|
+
<link rel="next" href="{{ paginator.next_page_path | prepend: seo_url }}">
|
76
|
+
{% endif %}
|
77
|
+
|