jekyll-theme-editorial 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +70 -2
- data/_config.yml +1 -0
- data/_includes/authors_byline.html +8 -5
- data/_includes/mini-posts.html +2 -2
- data/_includes/project.html +57 -0
- data/_includes/projects.html +6 -72
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bfa4f15c18670ce1b6a98e57c3c4e9cc7d328556f0b509eeaf5e392b1370e6c
|
4
|
+
data.tar.gz: 7bbb29941b7d2877635f9c5649fc6be620c39870c636747d270b043931f4fa86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd69f9070261ccd67fe2419a761858cc257e781a3d7b251c5ade1e8f5cb19b544f1422faf41a1bf55f9313db2f87c5e225de820a8f89dc4fbfa4e1ef5a42e58d
|
7
|
+
data.tar.gz: 7b28ee9d890714636a1d2894afc617fd06d5cde420354155af9ff6212babfe5f3271675f78417a721e31060c0df75d0899a7f9c47f3f98f13c369714f0413fe9
|
data/README.md
CHANGED
@@ -1090,7 +1090,7 @@ collections:
|
|
1090
1090
|
```
|
1091
1091
|
|
1092
1092
|
#### People page defaults
|
1093
|
-
We'll also need to add some page defaults to the `_config.yml` file for people pages, under the `defaults` key:
|
1093
|
+
We'll also need to add some page defaults to the `_config.yml` file for people pages, under the `defaults` key that we defined earlier:
|
1094
1094
|
|
1095
1095
|
```yaml
|
1096
1096
|
- scope:
|
@@ -1193,7 +1193,75 @@ Now restart our Jekyll server since we changed our site config, and refresh the
|
|
1193
1193
|
|
1194
1194
|
### Add Projects
|
1195
1195
|
|
1196
|
-
|
1196
|
+
Projects are just another type of collection that are neither date-based posts nor people. You can use them for any kind of collection you'd like, visually renaming the collection to something more suitable to your purposes, even if the theme calls the collection "projects" internally. We'll largely go through the same steps as adding people.
|
1197
|
+
|
1198
|
+
#### Set up the Projects collection
|
1199
|
+
As with the people collection, configure Jekyll in the `_config.yml` file to output our projects collection:
|
1200
|
+
|
1201
|
+
```yaml
|
1202
|
+
###################
|
1203
|
+
# Collections
|
1204
|
+
###################
|
1205
|
+
collections:
|
1206
|
+
people:
|
1207
|
+
output: true
|
1208
|
+
pages:
|
1209
|
+
output: true
|
1210
|
+
projects: # find/put projects in `\_projects`
|
1211
|
+
output: true
|
1212
|
+
```
|
1213
|
+
|
1214
|
+
#### Project page defaults
|
1215
|
+
Let's add in the relevant page defaults to the `_config.yml` file under the `defaults` key we defined earlier:
|
1216
|
+
|
1217
|
+
```yaml
|
1218
|
+
- scope:
|
1219
|
+
path: ""
|
1220
|
+
type: "projects"
|
1221
|
+
values:
|
1222
|
+
layout: "project"
|
1223
|
+
menus: 'projects' # used by jekyll-menus plugin
|
1224
|
+
type: "projects"
|
1225
|
+
image_path: "/assets/images/"
|
1226
|
+
comments: false
|
1227
|
+
published: false
|
1228
|
+
```
|
1229
|
+
#### Create some projects
|
1230
|
+
As before, nothing will have changed at this point until we add some projects. We'll again just copy them from the Editorial theme gem rather than create them from scratch. If necessary, use `bundle info` again to find the theme gem from which to copy the `_projects` folder with its 4 project files inside into your site folder:
|
1231
|
+
|
1232
|
+
```sh
|
1233
|
+
:~/my-jekyll-site$ bundle info --path jekyll-theme-editorial
|
1234
|
+
```
|
1235
|
+
Then, after you save the `_config.yml` file, restart, and refresh the browser, you should see three new menu items under "Projects" in the menu sidebar for the added project pages (as with authors, the 4th is unpublished). By the way, now that we have some projects, we're showing their mini-post cards in the sidebar as well!
|
1236
|
+
|
1237
|
+
|
1238
|
+
### Add the Projects index page
|
1239
|
+
|
1240
|
+
Similar to what we did with authors, we'll use the theme's `projects.html` include to list out standard project blocks for the projects index page. We set the page's `permalink` in the front matter to `/projects/` so that it overrides the ugly default HTML index page. If there are no published projects, we'll just show a little message stating as much. Save this file as `_pages/projects.html` (not to be confused with `_includes/projects.html` which is provided by the Editorial theme gem).
|
1241
|
+
|
1242
|
+
```liquid
|
1243
|
+
---
|
1244
|
+
title: Projects
|
1245
|
+
date: 2020-03-01 01:23:45 -0800
|
1246
|
+
permalink: /projects/
|
1247
|
+
---
|
1248
|
+
|
1249
|
+
<p>These projects are the bomb. Well, not really a bomb, but <em>da bomb</em>, y'know, like awesome but more explosive or something. Anyway check em out and make happy noises <em>en masse</em>.</p>
|
1250
|
+
|
1251
|
+
{% include projects.html %}
|
1252
|
+
```
|
1253
|
+
Now you can click on "Projects" in the sidebar menu and hopefully see a nicely formatted list of the 3 published projects. You can toggle the `published` status of the fourth project to see that one as well.
|
1254
|
+
|
1255
|
+
### Toggle summaries and dates for project pages
|
1256
|
+
|
1257
|
+
Our sample project pages have extended summaries which we'd like to show. At the same time, our projects index page is displaying a page creation date that looks odd in the upper right corner of page content area. We can fix both via two site configuration settings in `_config.yml`:
|
1258
|
+
|
1259
|
+
```yaml
|
1260
|
+
include_summary: [projects] # collections for which to show the summary in the header
|
1261
|
+
exclude_dates: [people, pages] # collections for which to not show dates in the header
|
1262
|
+
```
|
1263
|
+
Add these two lines to `_config.yml` and restart Jekyll to see the date disappear on the projects index page (which is part of the `pages` collection, not the `projects` colllection) and summaries on each of the individual published project pages (which *are* part of the `projects` collection). While we're at it, we removed publication dates from people pages too.
|
1264
|
+
|
1197
1265
|
|
1198
1266
|
## Setup Notes
|
1199
1267
|
|
data/_config.yml
CHANGED
@@ -24,6 +24,7 @@ timezone: America/Los_Angeles # set this to a standardized TZ na
|
|
24
24
|
date_format: # optional; set the way dates are formatted throughout the site - see https://ruby-doc.org/core/Time.html#method-i-strftime
|
25
25
|
|
26
26
|
|
27
|
+
|
27
28
|
###################
|
28
29
|
# Build settings
|
29
30
|
###################
|
@@ -22,7 +22,10 @@ local:
|
|
22
22
|
{%-assign authors = include.author | default: page.author-%}
|
23
23
|
{%-assign peeps = site.collections | where: "label", 'people' | first-%}
|
24
24
|
|
25
|
-
{%-if site.show.
|
25
|
+
{%-if site.show.authors and include.page_type=="index"-%}
|
26
|
+
{%-assign show_authors = true-%}
|
27
|
+
{%-assign has_author_cards = false-%}
|
28
|
+
{%-elsif site.show.post_authors and page.type=="posts"-%}
|
26
29
|
{%-assign show_authors = true-%}
|
27
30
|
{%-assign has_author_cards = true-%}
|
28
31
|
{%-elsif site.show.project_authors and page.type=="projects"-%}
|
@@ -49,13 +52,13 @@ local:
|
|
49
52
|
{%-assign author = site.people | where: 'handle', slug | first-%}
|
50
53
|
{%-assign author_name = author.name | default: slug-%}
|
51
54
|
{%-if author.published and has_author_cards %}
|
52
|
-
<li><a href="#{{-author.handle-}}" class="p-author" title="Read {{ author.handle-}}'s excerpt below">{{-author_name-}}</a></li>
|
55
|
+
<li><a href="#{{-author.handle-}}" class="p-author" itemprop="author" title="Read {{ author.handle-}}'s excerpt below">{{-author_name-}}</a></li>
|
53
56
|
{%-elsif author.published and peeps.output-%}
|
54
|
-
<li><a href="{{-author.url-}}" rel="author" class="p-author u-author" title="Read {{
|
57
|
+
<li><a href="{{-author.url-}}" rel="author" class="p-author u-author" itemprop="author" title="Read {{ author_name | split: ' ' | first-}}'s bio">{{-author_name-}}</a></li>
|
55
58
|
{%-elsif author.published-%}
|
56
|
-
<li class="p-author">{{-author_name-}}</li>
|
59
|
+
<li class="p-author" itemprop="author">{{-author_name-}}</li>
|
57
60
|
{%-elsif has_author_cards %}
|
58
|
-
<li><a href="#{{-slug-}}" class="p-author" title="Read {{ slug-}}'s excerpt below">{{-slug-}}</a></li>
|
61
|
+
<li><a href="#{{-slug-}}" class="p-author" itemprop="author" title="Read {{ slug-}}'s excerpt below">{{-slug-}}</a></li>
|
59
62
|
{%-else-%}
|
60
63
|
<li class="p-author">{{-slug-}}</li>
|
61
64
|
{%-endif-%}
|
data/_includes/mini-posts.html
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
{%-assign published_projects = site.projects | where: 'published', true
|
2
|
-
{%-assign project_menu = site.data.menus.sidebar | find: 'identifier', 'projects'
|
1
|
+
{%-assign published_projects = site.projects | where: 'published', true-%}
|
2
|
+
{%-assign project_menu = site.data.menus.sidebar | find: 'identifier', 'projects'-%}
|
3
3
|
{%-if published_projects != empty %}
|
4
4
|
<!-- Section - Mini-posts -->
|
5
5
|
<section>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
{%-comment-%}
|
2
|
+
lists a project as a section card given a project hash
|
3
|
+
|
4
|
+
inputs:
|
5
|
+
project the project to render
|
6
|
+
dependencies:
|
7
|
+
site.show.authors used to determine whether to show authors
|
8
|
+
site.show.project_authors used to determine whether to show authors
|
9
|
+
site.title used to determine whether to show separator
|
10
|
+
local:
|
11
|
+
modified_date the proejct's modification date, if any, that differs from project.date
|
12
|
+
{%-endcomment-%}
|
13
|
+
|
14
|
+
{%-if project.published %}
|
15
|
+
<article itemid="{{-project.url|absolute_url-}}" class="h-entry project-card row gtr-50 gtr-uniform" itemscope itemtype="http://schema.org/Article">
|
16
|
+
{% if project.images-%}
|
17
|
+
<div class="col-4 col-12-small">
|
18
|
+
<figure>
|
19
|
+
<a href="{{-project.url-}}" class="image fit" title="Learn more about '{{-project.title-}}'">
|
20
|
+
{% include item_image.html-%}
|
21
|
+
</a>
|
22
|
+
</figure>
|
23
|
+
<div class="snug smaller categories">{%-include categories.html %}</div>
|
24
|
+
{%-if project.series %}
|
25
|
+
<div class="snug series" title="This project is part of a series">{{ project.series | replace: '-',' ' | split: " " | join: "-----" | camelcase | split: "-----" | join: " "-}}</div>
|
26
|
+
{%-endif %}
|
27
|
+
</div>
|
28
|
+
{%-endif %}
|
29
|
+
<div class="col-8 col-12-small">
|
30
|
+
{%-assign modified_date = project.modified_date | default: project.last_modified_at-%}
|
31
|
+
{%-if modified_date-%}
|
32
|
+
{% include date_modified.html item_date=modified_date lead_in='last modified: '-%}
|
33
|
+
{%-endif %}
|
34
|
+
<header class="tight">
|
35
|
+
<span class="header-aside">{% include item_date.html %}</span>
|
36
|
+
<h3><a href="{{-project.url-}}" itemprop="name" class="u-url p-name" title="Learn more about '{{-project.title-}}'">{{-project.title-}}</a></h3>
|
37
|
+
<p class="subtitle p-subtitle" itemprop="alternativeHeadline">{{-project.subtitle-}}</p>
|
38
|
+
{%-if site.show.project_authors and site.show.authors and project.author or project.location-%}
|
39
|
+
<div class="byline">
|
40
|
+
{% include authors_byline.html page_type="index" author=project.author-%}
|
41
|
+
{%-if project.location-%}
|
42
|
+
{% if project.author or site.title-%}{{-" | "-}}{%-endif %}
|
43
|
+
<span class="p-location" itemprop="location" title="Post location">{{-project.location-}}</span>
|
44
|
+
{%-endif %}
|
45
|
+
</div>
|
46
|
+
{%-endif-%}
|
47
|
+
</header>
|
48
|
+
{% if include.summary or project.summary or project.excerpt-%}
|
49
|
+
<div class="summary p-summary" itemprop="abstract">
|
50
|
+
{{-include.summary | default: project.summary | default: project.excerpt | markdownify-}}
|
51
|
+
</div>
|
52
|
+
{%-endif %}
|
53
|
+
{%-include tags.html %}
|
54
|
+
</div>
|
55
|
+
</article>
|
56
|
+
<hr class="major"/>
|
57
|
+
{% endif %}
|
data/_includes/projects.html
CHANGED
@@ -1,88 +1,22 @@
|
|
1
1
|
{%-comment-%}
|
2
2
|
lists projects as section cards given a projects hash
|
3
3
|
|
4
|
-
inputs:
|
5
|
-
dependencies:
|
4
|
+
inputs:
|
6
5
|
projects the projects to render
|
6
|
+
dependencies:
|
7
7
|
site.projects used as the default if `projects` isn't available already
|
8
|
-
|
9
|
-
site.show.authors used to determine whether to show authors
|
10
|
-
site.show.project_authors used to determine whether to show authors
|
11
|
-
site.people lookup authors in the people array
|
12
|
-
site.title use as the author, as a last resort
|
8
|
+
page.layout used to see if projects should be set to site.projects
|
13
9
|
local:
|
14
10
|
projects default to site.projects if not already provided
|
15
11
|
published_projects projects filtered for `published==true`
|
16
|
-
placeholder placeholder.png file to use in case no other page image is available
|
17
|
-
auth the author's handle, used for unpublished authors in place of their name
|
18
|
-
author the looked-up author in site.people
|
19
12
|
{%-endcomment-%}
|
20
13
|
|
21
|
-
{%-if page.layout == "page"-%}
|
22
|
-
|
23
|
-
{%-endif-%}
|
24
|
-
{%-assign published_projects = projects | where: 'published', true-%}
|
14
|
+
{%-if page.layout == "page"-%}{%-assign projects = site.projects-%}{%-endif-%}
|
15
|
+
{%-assign published_projects = projects | where: 'published', true-%}
|
25
16
|
|
26
17
|
{%-if published_projects != empty %}
|
27
18
|
{%-for project in published_projects %}
|
28
|
-
{
|
29
|
-
<article itemid="{{-project.url|absolute_url-}}" class="h-entry project-card row gtr-50 gtr-uniform" itemscope itemtype="http://schema.org/Article">
|
30
|
-
{% if project.images-%}
|
31
|
-
<div class="col-4 col-12-small">
|
32
|
-
<figure>
|
33
|
-
<a href="{{-project.url-}}" class="image fit" title="Learn more about '{{-project.title-}}'">
|
34
|
-
{% include item_image.html-%}
|
35
|
-
</a>
|
36
|
-
</figure>
|
37
|
-
<div class="snug smaller categories">{%-include categories.html %}</div>
|
38
|
-
{%-if project.series %}
|
39
|
-
<div class="snug series" title="This project is part of a series">{{ project.series | replace: '-',' ' | split: " " | join: "-----" | camelcase | split: "-----" | join: " "-}}</div>
|
40
|
-
{%-endif %}
|
41
|
-
</div>
|
42
|
-
{%-endif %}
|
43
|
-
<div class="col-8 col-12-small">
|
44
|
-
{%-assign modified_date = project.modified_date | default: project.last_modified_at-%}
|
45
|
-
{%-if modified_date-%}
|
46
|
-
{% include date_modified.html item_date=modified_date lead_in='last modified: '-%}
|
47
|
-
{%-endif %}
|
48
|
-
<header class="tight">
|
49
|
-
<span class="header-aside">{% include item_date.html %}</span>
|
50
|
-
<h3><a href="{{-project.url-}}" itemprop="name" class="u-url p-name" title="Learn more about '{{-project.title-}}'">{{-project.title-}}</a></h3>
|
51
|
-
<p class="subtitle p-subtitle" itemprop="alternativeHeadline">{{-project.subtitle-}}</p>
|
52
|
-
{%-if site.show.project_authors and site.show.authors and project.author or project.location-%}
|
53
|
-
<p class="byline">
|
54
|
-
{%-if site.show.authors %}
|
55
|
-
{%-for auth in project.author-%}
|
56
|
-
{%-assign author = site.people | find: 'handle', auth-%}
|
57
|
-
{%-if author.published and author.url-%}
|
58
|
-
<a href="{{-author.url-}}" rel="author" itemprop="author" class="u-author p-author" title="Read {{ author.name | split: ' ' | first-}}'s bio">{{-author.name-}}</a>
|
59
|
-
{%-elsif author.published-%}
|
60
|
-
<span itemprop="author" class="p-author">{{-author.name-}}</span>
|
61
|
-
{%-else-%}
|
62
|
-
<span itemprop="author" class="p-author">{{-auth-}}</span>
|
63
|
-
{%-endif-%}
|
64
|
-
{%-unless forloop.last %}, {% endunless-%}
|
65
|
-
{%-else-%}
|
66
|
-
<span itemprop="author" class="p-author">{{-site.title-}}</span>
|
67
|
-
{%-endfor-%}
|
68
|
-
{%-if project.location and project.author or site.title-%}{{-" | "-}}{%-endif-%}
|
69
|
-
{%-endif %}
|
70
|
-
{%-if project.location %}
|
71
|
-
<span class="p-location" itemprop="location" title="Post location">{{-project.location-}}</span>
|
72
|
-
{%-endif %}
|
73
|
-
</p>
|
74
|
-
{%-endif-%}
|
75
|
-
</header>
|
76
|
-
{% if include.summary or project.summary or project.excerpt-%}
|
77
|
-
<div class="summary p-summary" itemprop="abstract">
|
78
|
-
{{-include.summary | default: project.summary | default: project.excerpt | markdownify-}}
|
79
|
-
</div>
|
80
|
-
{%-endif %}
|
81
|
-
{%-include tags.html %}
|
82
|
-
</div>
|
83
|
-
</article>
|
84
|
-
<hr class="major"/>
|
85
|
-
{% endif %}
|
19
|
+
{% include project.html %}
|
86
20
|
{% endfor %}
|
87
21
|
{% else %}
|
88
22
|
<h2>Oof!</h2>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-editorial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Middle Bear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- _includes/post_header.html
|
144
144
|
- _includes/post_nav.html
|
145
145
|
- _includes/posts.html
|
146
|
+
- _includes/project.html
|
146
147
|
- _includes/projects.html
|
147
148
|
- _includes/responsive_banner.html
|
148
149
|
- _includes/scripts.html
|