hitchens-theme 0.2.0 → 0.3.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 +4 -4
- data/README.md +46 -2
- data/_includes/back-link.html +1 -1
- data/_includes/menu.html +26 -0
- data/_includes/post-excerpt.html +19 -0
- data/_includes/post-list-item.html +19 -0
- data/_layouts/default.html +3 -1
- data/_layouts/home.html +8 -44
- data/_layouts/post.html +10 -4
- data/_sass/_article.scss +5 -9
- data/_sass/_base.scss +30 -3
- data/_sass/_masthead.scss +1 -29
- data/_sass/_menu.scss +30 -0
- data/_sass/_post-list.scss +18 -10
- data/assets/css/main.scss +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a44b2fbee7f856bab2e1bbb8730259c12603459d
|
4
|
+
data.tar.gz: ef4e540d2cdd6843e2b608222bc2da1bb8a745a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2f7145178c2dbf3fc02f13565892831cf839820d77ef3cea3a14605cfb0985a5eec46c4c24801989e9f0904f48c5078827822869eafe502d4a6b8c4e4f9948
|
7
|
+
data.tar.gz: f7f58b53a7eafef024dc1288c64c82662f7b328e748ee2eb62c6f538e5818be37622560e82b2c48e06610041a72ab2cb1b0f12902e99bf64c0819d9d4092ac90
|
data/README.md
CHANGED
@@ -46,12 +46,15 @@ To include navigation in your site's masthead:
|
|
46
46
|
|
47
47
|
```
|
48
48
|
- title: About
|
49
|
-
url: /about
|
49
|
+
url: /about.html
|
50
|
+
|
51
|
+
- title: Source
|
52
|
+
url: https://github.com/patdryburgh/hitchens
|
50
53
|
```
|
51
54
|
|
52
55
|
Be sure to start your `url`s with a `/`.
|
53
56
|
|
54
|
-
|
57
|
+
#### Pagination
|
55
58
|
|
56
59
|
To paginate your posts, add the following line to your site's `Gemfile`:
|
57
60
|
|
@@ -71,10 +74,51 @@ paginate_path: "/page/:num/"
|
|
71
74
|
|
72
75
|
You can set the `paginate` and `paginate_path` settings to whatever best suits you.
|
73
76
|
|
77
|
+
#### Excerpts
|
78
|
+
|
79
|
+
To show [excerpts](https://jekyllrb.com/docs/posts/#post-excerpts) of your blog posts on the home page, add the following settings to your site's `_config.yml` file:
|
80
|
+
|
81
|
+
```
|
82
|
+
show_excerpts: true
|
83
|
+
```
|
84
|
+
|
85
|
+
By default, excerpts that have more than 140 characters will be truncated to 20 words. In order to override the number of words you'd like to show for your excerpts, add the following setting to your site's `_config.yml` file:
|
86
|
+
|
87
|
+
```
|
88
|
+
excerpt_length: 20
|
89
|
+
```
|
90
|
+
|
91
|
+
To disable excerpt truncation entirely, simply set `excerpt_length` to `0` in your site's `_config.yml` file, like so:
|
92
|
+
|
93
|
+
```
|
94
|
+
excerpt_length: 0
|
95
|
+
```
|
96
|
+
|
97
|
+
If you do this, the theme will still respect Jekyll's `excerpt_separator` feature as [described in the Jekyll documentation](https://jekyllrb.com/docs/posts/#post-excerpts).
|
98
|
+
|
99
|
+
|
100
|
+
#### Title-less Posts
|
101
|
+
|
102
|
+
If you want to publish posts that don't have a title, add the following setting to the [front matter](https://jekyllrb.com/docs/frontmatter/) of the post:
|
103
|
+
|
104
|
+
```
|
105
|
+
title: ""
|
106
|
+
```
|
107
|
+
|
108
|
+
When you do this, the home page will display a truncated [excerpt](https://jekyllrb.com/docs/posts/#post-excerpts) of the first paragraph of your post.
|
109
|
+
|
110
|
+
Note that setting `excerpt_length` in your site's `_config.yml` file will set the length of _all_ excerpts, regardless of whether the post has a title or not. For posts with a title, the excerpt will appear under the title and slightly lighter. For title-less posts, the excerpt will appear as if it were a title.
|
111
|
+
|
74
112
|
### Post Layout
|
75
113
|
|
76
114
|
A sparsely decorated layout designed to present long-form writing in a manner that's pleasing to read.
|
77
115
|
|
116
|
+
To use the post layout, add the following to your post's [front matter](https://jekyllrb.com/docs/frontmatter/):
|
117
|
+
|
118
|
+
```
|
119
|
+
layout: post
|
120
|
+
```
|
121
|
+
|
78
122
|
### Credits
|
79
123
|
|
80
124
|
The theme credits that appear at the bottom of each page can be turned off by including the following line in your site's `_config.yml` file:
|
data/_includes/back-link.html
CHANGED
data/_includes/menu.html
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{% assign menu = site.data.menu %}
|
2
|
+
|
3
|
+
{% if menu %}
|
4
|
+
<nav class="site-navigation">
|
5
|
+
<ul>
|
6
|
+
<li>
|
7
|
+
<a href="{{ '/' | prepend: site.baseurl }}">
|
8
|
+
Home
|
9
|
+
</a>
|
10
|
+
</li>
|
11
|
+
{% for item in site.data.menu %}
|
12
|
+
<li {% if page.url == item.url %}class="active"{% endif %}>
|
13
|
+
{% if item.url contains 'http' %}
|
14
|
+
<a href="{{ item.url }}">
|
15
|
+
{{ item.title }}
|
16
|
+
</a>
|
17
|
+
{% else %}
|
18
|
+
<a href="{{ item.url | prepend: site.baseurl }}">
|
19
|
+
{{ item.title }}
|
20
|
+
</a>
|
21
|
+
{% endif %}
|
22
|
+
</li>
|
23
|
+
{% endfor %}
|
24
|
+
</ul>
|
25
|
+
</nav>
|
26
|
+
{% endif %}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{% capture excerpt %}
|
2
|
+
{{ post.excerpt | replace: "<p>", "" | replace: "</p>", "" }}
|
3
|
+
{% endcapture %}
|
4
|
+
|
5
|
+
{% if site.excerpt_length %}
|
6
|
+
{% assign excerpt_length = site.excerpt_length %}
|
7
|
+
{% else %}
|
8
|
+
{% assign excerpt_length = 20 %}
|
9
|
+
{% endif %}
|
10
|
+
|
11
|
+
{% assign excerpt_size = excerpt | size %}
|
12
|
+
|
13
|
+
<span class="post-link__excerpt">
|
14
|
+
{% if excerpt_size > 140 and excerpt_length > 0 %}
|
15
|
+
{{ excerpt | truncatewords: excerpt_length, '…' }}
|
16
|
+
{% else %}
|
17
|
+
{{ excerpt }}
|
18
|
+
{% endif %}
|
19
|
+
</span>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<li>
|
2
|
+
<a href="{{ post.url | absolute_url }}" class="post-link">
|
3
|
+
<div class="post-link__heading">
|
4
|
+
{% unless post.title == "" %}
|
5
|
+
<h1 class="post-link__title">
|
6
|
+
{{ post.title }}
|
7
|
+
</h1>
|
8
|
+
{% else %}
|
9
|
+
{% include post-excerpt.html %}
|
10
|
+
{% endunless %}
|
11
|
+
{% if post.title != "" and site.show_excerpts == true %}
|
12
|
+
{% include post-excerpt.html %}
|
13
|
+
{% endif %}
|
14
|
+
</div>
|
15
|
+
<span class="post-date">
|
16
|
+
{{ post.date | date: "%b %-d, '%y" }}
|
17
|
+
</span>
|
18
|
+
</a>
|
19
|
+
</li>
|
data/_layouts/default.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
|
9
|
-
<title>{{ site.title }}{% if page.title %} — {{ page.title }}{% endif %}</title>
|
9
|
+
<title>{{ site.title }}{% if page.title and page.title != "" %} — {{ page.title }}{% endif %}</title>
|
10
10
|
|
11
11
|
<link rel="stylesheet" href="{{ '/assets/css/main.css' | absolute_url }}?{{ site.time | date: '%s%N' }}">
|
12
12
|
|
@@ -19,6 +19,8 @@
|
|
19
19
|
|
20
20
|
{{ content }}
|
21
21
|
|
22
|
+
{% include menu.html %}
|
23
|
+
|
22
24
|
{% unless site.hide_credits %}
|
23
25
|
<aside class="site-credits">
|
24
26
|
<p>
|
data/_layouts/home.html
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
layout: default
|
3
3
|
---
|
4
4
|
|
5
|
-
{%
|
6
|
-
|
7
|
-
{%
|
5
|
+
{% if site.data.menu and site.paginate and site.paginate_path and paginator.page > 1 %}
|
6
|
+
{% include menu.html %}
|
7
|
+
{% elsif site.paginate and site.paginate_path and paginator.page > 1 %}
|
8
8
|
{% include back-link.html %}
|
9
9
|
{% else %}
|
10
10
|
<header class="site-masthead">
|
@@ -18,31 +18,13 @@ layout: default
|
|
18
18
|
{{ site.description }}
|
19
19
|
</h2>
|
20
20
|
{% endif %}
|
21
|
-
{%
|
22
|
-
<nav class="site-navigation">
|
23
|
-
<ul>
|
24
|
-
{% for item in site.data.menu %}
|
25
|
-
<li>
|
26
|
-
{% if item.url contains 'http' %}
|
27
|
-
<a href="{{ item.url }}">
|
28
|
-
{{ item.title }}
|
29
|
-
</a>
|
30
|
-
{% else %}
|
31
|
-
<a href="{{ item.url | prepend: site.baseurl }}">
|
32
|
-
{{ item.title }}
|
33
|
-
</a>
|
34
|
-
{% endif %}
|
35
|
-
</li>
|
36
|
-
{% endfor %}
|
37
|
-
</ul>
|
38
|
-
</nav>
|
39
|
-
{% endif %}
|
21
|
+
{% include menu.html %}
|
40
22
|
</header>
|
41
23
|
{% endif %}
|
42
24
|
|
43
25
|
<main class="home" aria-label="Content">
|
44
26
|
|
45
|
-
<h1 class="divided">
|
27
|
+
<h1 class="content-title divided">
|
46
28
|
{% if site.paginate and site.paginate_path and paginator.page > 1 %}
|
47
29
|
Page {{ paginator.page }}
|
48
30
|
{% else %}
|
@@ -54,20 +36,11 @@ layout: default
|
|
54
36
|
|
55
37
|
<ul class="post-list">
|
56
38
|
{% for post in paginator.posts %}
|
57
|
-
|
58
|
-
<a href="{{ post.url | absolute_url }}" class="post-link">
|
59
|
-
<span class="post-title">
|
60
|
-
{{ post.title }}
|
61
|
-
</span>
|
62
|
-
<span class="post-date">
|
63
|
-
{{ post.date | date: "%b %-d, '%y" }}
|
64
|
-
</span>
|
65
|
-
</a>
|
66
|
-
</li>
|
39
|
+
{% include post-list-item.html %}
|
67
40
|
{% endfor %}
|
68
41
|
</ul>
|
69
42
|
|
70
|
-
{% if paginator.
|
43
|
+
{% if paginator.total_pages > 1 %}
|
71
44
|
|
72
45
|
<div class="post-pagination">
|
73
46
|
{% if paginator.next_page %}
|
@@ -89,16 +62,7 @@ layout: default
|
|
89
62
|
|
90
63
|
<ul class="post-list">
|
91
64
|
{% for post in site.posts %}
|
92
|
-
|
93
|
-
<a href="{{ post.url | absolute_url }}" class="post-link">
|
94
|
-
<span class="post-title">
|
95
|
-
{{ post.title }}
|
96
|
-
</span>
|
97
|
-
<span class="post-date">
|
98
|
-
{{ post.date | date: "%b %-d, '%y" }}
|
99
|
-
</span>
|
100
|
-
</a>
|
101
|
-
</li>
|
65
|
+
{% include post-list-item.html %}
|
102
66
|
{% endfor %}
|
103
67
|
</ul>
|
104
68
|
|
data/_layouts/post.html
CHANGED
@@ -2,13 +2,19 @@
|
|
2
2
|
layout: default
|
3
3
|
---
|
4
4
|
|
5
|
-
{%
|
5
|
+
{% if site.data.menu %}
|
6
|
+
{% include menu.html %}
|
7
|
+
{% else %}
|
8
|
+
{% include back-link.html %}
|
9
|
+
{% endif %}
|
6
10
|
|
7
11
|
<article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
{% unless page.title == "" %}
|
14
|
+
<h1 class="post-title divided p-name" itemprop="name headline">
|
15
|
+
{{ page.title }}
|
16
|
+
</h1>
|
17
|
+
{% endunless %}
|
12
18
|
|
13
19
|
<div class="post-content e-content" itemprop="articleBody">
|
14
20
|
{{ content }}
|
data/_sass/_article.scss
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
.post p {
|
16
16
|
text-align: justify;
|
17
|
-
text-indent: 1.
|
17
|
+
text-indent: 1.5em;
|
18
18
|
text-justify: inter-word;
|
19
19
|
}
|
20
20
|
|
@@ -23,19 +23,15 @@
|
|
23
23
|
text-indent: 0;
|
24
24
|
}
|
25
25
|
|
26
|
-
.post img {
|
27
|
-
margin-left: -1em;
|
28
|
-
display: flex;
|
29
|
-
max-width: 100%;
|
30
|
-
height: auto;
|
31
|
-
margin: 2em auto;
|
32
|
-
}
|
33
|
-
|
34
26
|
.post li {
|
35
27
|
margin-left: 1.5rem;
|
36
28
|
margin-right: 1.5rem;
|
37
29
|
}
|
38
30
|
|
31
|
+
.post-content:first-child {
|
32
|
+
margin-top: 4em;
|
33
|
+
}
|
34
|
+
|
39
35
|
.post-meta {
|
40
36
|
margin-bottom: 2em;
|
41
37
|
margin-top: 2em;
|
data/_sass/_base.scss
CHANGED
@@ -38,6 +38,14 @@ h6 {
|
|
38
38
|
text-align: center;
|
39
39
|
}
|
40
40
|
|
41
|
+
em {
|
42
|
+
font-style: italic;
|
43
|
+
}
|
44
|
+
|
45
|
+
strong {
|
46
|
+
font-weight: bold;
|
47
|
+
}
|
48
|
+
|
41
49
|
a {
|
42
50
|
color: $text-color;
|
43
51
|
}
|
@@ -46,7 +54,7 @@ blockquote {
|
|
46
54
|
margin: 2em auto;
|
47
55
|
opacity: .8;
|
48
56
|
> * {
|
49
|
-
padding: 0
|
57
|
+
padding: 0 3em;
|
50
58
|
}
|
51
59
|
}
|
52
60
|
|
@@ -70,6 +78,25 @@ hr {
|
|
70
78
|
margin: 4em 0;
|
71
79
|
}
|
72
80
|
|
81
|
+
img {
|
82
|
+
display: flex;
|
83
|
+
max-width: 100%;
|
84
|
+
height: auto;
|
85
|
+
margin: 2em auto;
|
86
|
+
}
|
87
|
+
|
88
|
+
figure img {
|
89
|
+
margin: 2em auto 1em;
|
90
|
+
}
|
91
|
+
|
92
|
+
figcaption {
|
93
|
+
font-size: .875em;
|
94
|
+
font-style: italic;
|
95
|
+
text-align: center;
|
96
|
+
margin-bottom: 2em;
|
97
|
+
opacity: .7;
|
98
|
+
}
|
99
|
+
|
73
100
|
.divided::after {
|
74
101
|
content: "";
|
75
102
|
@include divider;
|
@@ -81,7 +108,7 @@ hr {
|
|
81
108
|
padding: 4em 1em;
|
82
109
|
}
|
83
110
|
|
84
|
-
.
|
111
|
+
.content-title {
|
85
112
|
font-size: 2em;
|
86
113
|
margin-bottom: 2em;
|
87
114
|
text-align: center;
|
@@ -99,7 +126,7 @@ hr {
|
|
99
126
|
}
|
100
127
|
|
101
128
|
.site-credits {
|
102
|
-
margin:
|
129
|
+
margin: 0 auto 2em;
|
103
130
|
padding: 0 2em;
|
104
131
|
text-align: center;
|
105
132
|
}
|
data/_sass/_masthead.scss
CHANGED
@@ -21,37 +21,9 @@
|
|
21
21
|
|
22
22
|
.site-masthead h2 {
|
23
23
|
color: $muted-text-color;
|
24
|
-
font-size: 1.
|
24
|
+
font-size: 1.25em;
|
25
25
|
margin: 0;
|
26
26
|
@media (min-width: $on-tablet) {
|
27
27
|
font-size: 3em;
|
28
28
|
}
|
29
|
-
}
|
30
|
-
|
31
|
-
.site-navigation {
|
32
|
-
margin-top: 4rem;
|
33
|
-
}
|
34
|
-
|
35
|
-
.site-navigation ul {
|
36
|
-
margin: 0;
|
37
|
-
display: flex;
|
38
|
-
flex-wrap: wrap;
|
39
|
-
justify-content: center;
|
40
|
-
}
|
41
|
-
|
42
|
-
.site-navigation li {
|
43
|
-
list-style: none;
|
44
|
-
font-size: .875em;
|
45
|
-
font-variant: small-caps;
|
46
|
-
margin: 0;
|
47
|
-
}
|
48
|
-
|
49
|
-
.site-navigation a {
|
50
|
-
display: block;
|
51
|
-
padding: .25em .5em;
|
52
|
-
text-decoration: none;
|
53
|
-
&:hover,
|
54
|
-
&:focus {
|
55
|
-
text-decoration: underline;
|
56
|
-
}
|
57
29
|
}
|
data/_sass/_menu.scss
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
.site-navigation {
|
2
|
+
margin-top: 4rem;
|
3
|
+
}
|
4
|
+
|
5
|
+
.site-navigation ul {
|
6
|
+
margin: 0;
|
7
|
+
display: flex;
|
8
|
+
flex-wrap: wrap;
|
9
|
+
justify-content: center;
|
10
|
+
}
|
11
|
+
|
12
|
+
.site-navigation li {
|
13
|
+
list-style: none;
|
14
|
+
font-size: .875em;
|
15
|
+
font-variant: small-caps;
|
16
|
+
margin: 0;
|
17
|
+
&.active a {
|
18
|
+
text-decoration: underline;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.site-navigation a {
|
23
|
+
display: block;
|
24
|
+
padding: .25em .5em;
|
25
|
+
text-decoration: none;
|
26
|
+
&:hover,
|
27
|
+
&:focus {
|
28
|
+
text-decoration: underline;
|
29
|
+
}
|
30
|
+
}
|
data/_sass/_post-list.scss
CHANGED
@@ -3,30 +3,38 @@
|
|
3
3
|
list-style: none;
|
4
4
|
}
|
5
5
|
|
6
|
+
.post-list li {
|
7
|
+
margin-bottom: 1em;
|
8
|
+
}
|
9
|
+
|
6
10
|
.post-link {
|
7
11
|
color: $text-color;
|
8
12
|
display: flex;
|
9
13
|
flex-direction: column-reverse;
|
10
14
|
text-decoration: none;
|
11
15
|
padding: .25em 0;
|
12
|
-
.post-title {
|
13
|
-
display: block;
|
14
|
-
padding: .25em 0;
|
15
|
-
}
|
16
|
-
&:hover .post-title,
|
17
|
-
&:focus .post-title {
|
18
|
-
text-decoration: underline;
|
19
|
-
}
|
20
16
|
@media (min-width: $on-tablet) {
|
21
17
|
display: flex;
|
22
18
|
flex-direction: row;
|
23
19
|
justify-content: space-between;
|
24
|
-
.post-
|
25
|
-
margin-
|
20
|
+
.post-date {
|
21
|
+
margin-left: auto;
|
26
22
|
}
|
27
23
|
}
|
28
24
|
}
|
29
25
|
|
26
|
+
.post-link__heading {
|
27
|
+
display: block;
|
28
|
+
margin-right: 4em;
|
29
|
+
@media (min-width: $on-tablet) {
|
30
|
+
padding: .25em 0;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
.post-link__title + .post-link__excerpt {
|
35
|
+
opacity: .6;
|
36
|
+
}
|
37
|
+
|
30
38
|
.post-pagination {
|
31
39
|
margin-top: 4rem;
|
32
40
|
font-size: .75em;
|
data/assets/css/main.scss
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hitchens-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Dryburgh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -64,6 +64,9 @@ files:
|
|
64
64
|
- _includes/back-link.html
|
65
65
|
- _includes/disqus-comments.html
|
66
66
|
- _includes/google-analytics.html
|
67
|
+
- _includes/menu.html
|
68
|
+
- _includes/post-excerpt.html
|
69
|
+
- _includes/post-list-item.html
|
67
70
|
- _layouts/default.html
|
68
71
|
- _layouts/home.html
|
69
72
|
- _layouts/page.html
|
@@ -72,6 +75,7 @@ files:
|
|
72
75
|
- _sass/_base.scss
|
73
76
|
- _sass/_font.scss
|
74
77
|
- _sass/_masthead.scss
|
78
|
+
- _sass/_menu.scss
|
75
79
|
- _sass/_mixins.scss
|
76
80
|
- _sass/_post-list.scss
|
77
81
|
- _sass/_reset.scss
|