jekyll-theme-editorial 1.0.9 → 1.0.10
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 +171 -2
- data/_includes/banner.html +14 -7
- data/_includes/responsive_banner.html +18 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35a176b8f2ff001b1a27a292dd19b85037aa5a04af8200b9f6d2e3773f3ae0aa
|
4
|
+
data.tar.gz: 072a4dbd98ac269aac446f68c4eecbffffc79e51aef15c184d921069c3742d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfd768be320f4bd7d986ce7f50f097b0cb06a6f4ffba2f285b31f2fc6ac1e841dfeda6e98956f58c2d1ecec17e26869944aa4d355b4e7aace5c0a0f51a7a6f06
|
7
|
+
data.tar.gz: 07e6be2cf3736bc4eea152defe10c39d6983e20083d125b20b0c0297ec1f4c940fabd93275e75aeb877b9729fdd0141ec9f0b888ad41a5cd5012b6379c2f32cf
|
data/README.md
CHANGED
@@ -1189,7 +1189,7 @@ show: # series of switches to customize
|
|
1189
1189
|
authors: true # single author blogs may want to disable showing the same author everywhere
|
1190
1190
|
post_authors: true # you may still want to show the author(s) at the bottom of posts
|
1191
1191
|
```
|
1192
|
-
Now restart our Jekyll server since we changed our site config, and refresh the post page to see the changes. You'll notice two author
|
1192
|
+
Now restart our Jekyll server since we changed our site config, and refresh the post page to see the changes. You'll notice two author cards, one each for julia and petunia, at the bottom of the post. Our byline now helpfully links down to those author cards instead of directly to the author pages. The cards link to the full author pages instead. Notice that petunia's card doesn't link, since she's unpublished, and therefore doesn't have an author page yet.
|
1193
1193
|
|
1194
1194
|
### Add Projects
|
1195
1195
|
|
@@ -1210,6 +1210,7 @@ collections:
|
|
1210
1210
|
projects: # find/put projects in `\_projects`
|
1211
1211
|
output: true
|
1212
1212
|
```
|
1213
|
+
Now we have three entries—one each for people, pages, and projects—under the `collections` key in our `_config.yml` file.
|
1213
1214
|
|
1214
1215
|
#### Project page defaults
|
1215
1216
|
Let's add in the relevant page defaults to the `_config.yml` file under the `defaults` key we defined earlier:
|
@@ -1226,6 +1227,7 @@ Let's add in the relevant page defaults to the `_config.yml` file under the `def
|
|
1226
1227
|
comments: false
|
1227
1228
|
published: false
|
1228
1229
|
```
|
1230
|
+
|
1229
1231
|
#### Create some projects
|
1230
1232
|
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
1233
|
|
@@ -1252,7 +1254,7 @@ permalink: /projects/
|
|
1252
1254
|
```
|
1253
1255
|
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
1256
|
|
1255
|
-
|
1257
|
+
#### Toggle summaries and dates for project pages
|
1256
1258
|
|
1257
1259
|
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
1260
|
|
@@ -1262,6 +1264,173 @@ exclude_dates: [people, pages] # collections for which to not sho
|
|
1262
1264
|
```
|
1263
1265
|
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
1266
|
|
1267
|
+
#### Add Author cards to projects
|
1268
|
+
|
1269
|
+
Like posts, we can show author cards at the bottom of projects, and link those to the full author pages. To do so, we'll add a `project_authors` configuration key to `_config.yml` under the `show` key:
|
1270
|
+
|
1271
|
+
```yaml
|
1272
|
+
show: # series of switches to customize what appears on the site
|
1273
|
+
authors: true # single author blogs may want to disable showing the same author everywhere
|
1274
|
+
post_authors: true # you may still want to show the author(s) at the bottom of posts
|
1275
|
+
page_authors: true # you may still want to show the author(s) for pages
|
1276
|
+
project_authors: true # you may still want to show the author(s) for projects
|
1277
|
+
```
|
1278
|
+
While here, we also added the `page_authors` key. Note that no pages so far have authors defined in their front matter, so you shouldn't see authors on any pages in the pages collection. This is only for pages you explicily want authors to show, by including them in the front matter. Restart the Jekyll server and refresh any published project page to see author cards at the bottom.
|
1279
|
+
|
1280
|
+
### Post decorations
|
1281
|
+
|
1282
|
+
Posts can be decorated with more than the titles, authors, body content, tags, and categories we've seen so far. The Editorial theme supports an array of images, metadata, and supplementary fields to make your posts. Let's pull up the relevant `_sample` file, `post-template.md` to get an overview:
|
1283
|
+
|
1284
|
+
```yaml
|
1285
|
+
---
|
1286
|
+
# defaults assumed for these jekyll variables: layout, permalink, published, excerpt
|
1287
|
+
# name the file similar to title (slugified - replace spaces with underscores & remove punctuation)
|
1288
|
+
title: "" # used in the page/post header, HTML title, menus & SEO
|
1289
|
+
subtitle: "" # optional; shown under the page/post header
|
1290
|
+
author: [] # use the handle of the author, not their name
|
1291
|
+
date: 2020-01-01 00:00:00 -0800 # publication date; overrides the file save date
|
1292
|
+
last_modified_at: # optional; date to show in addition to/in place of create date
|
1293
|
+
categories: [] # choose one best category, ideally
|
1294
|
+
tags: [] # choose 3-7 tags, ideally
|
1295
|
+
series: "Build a blog" # optional; use `series` to group posts and show a sidebar of posts in the series (limited to 1 for now)
|
1296
|
+
location: "New York, NY" # optional; location where the post was made
|
1297
|
+
website: https://example.com/ # optional; external, related website, possibly featured
|
1298
|
+
image: "" # default image for SEO & jekyll-feed
|
1299
|
+
images: # all images are optional; banner and either default or thumbnail are recommended
|
1300
|
+
default: # general-use size, default for lists if no thumbnail
|
1301
|
+
file: "" # no path, just the filename (e.g., "my great image.png")
|
1302
|
+
# default images generally use the default image texts, but can be specified here
|
1303
|
+
banner: # largest, full-page width landscape at top of page
|
1304
|
+
file: "" # no path, just the filename (e.g., "my great image.png")
|
1305
|
+
alt_text: "" # describe the image for screen readers
|
1306
|
+
caption: "" # optional explanatory text, can be used for attributions
|
1307
|
+
title: "" # optional; usually shown as a tooltip on hover
|
1308
|
+
thumbnail: # smaller image for lists/grids (like index pages)
|
1309
|
+
file: "" # no path, just the filename (e.g., "my great image.png")
|
1310
|
+
# thumbnails generally use the default image texts, but can be specified here
|
1311
|
+
# these texts are defaults for all images in the images array, if not individually specified:
|
1312
|
+
alt_text: "" # describe the image for screen readers
|
1313
|
+
caption: "" # optional explanatory text, can be used for attributions
|
1314
|
+
title: "" # optional; usually shown as a tooltip on hover
|
1315
|
+
canonical_url: "" # optional; customize the canonical URL for this page
|
1316
|
+
lang: "" # optional; language for the page, `en_US` by default
|
1317
|
+
description: "" # optional; short description of the page's content used for SEO
|
1318
|
+
# NOTE that the first paaragraph below is the excerpt, if no excerpt is defined here in the front matter.
|
1319
|
+
---
|
1320
|
+
```
|
1321
|
+
|
1322
|
+
#### Adding textual elements
|
1323
|
+
We'll first start by adding some textual elements, like subtitle and location. Add the following to our blog post's front matter:
|
1324
|
+
|
1325
|
+
```yaml
|
1326
|
+
subtitle: "How Jekyll Makes It All So Easy!"
|
1327
|
+
location: "San Francisco, CA"
|
1328
|
+
website: https://jekyllrb.com/docs/home
|
1329
|
+
description: Let's make sure Google and company know enough about this page that it will pop up higher in search results
|
1330
|
+
```
|
1331
|
+
Refresh our blog post page, and you should see the page title is now linked (visually indicated with a superscripted link icon), a subtitle under it, and the location listed in the byline. The description field is purely for <abbr title="Search Engine Optimization">SEO</abbr> purposes, and can only be seen by viewing the source of the page (in the HTML HEAD section).
|
1332
|
+
|
1333
|
+
#### Adding a post to a series
|
1334
|
+
|
1335
|
+
Sometimes you want to group a few posts together as a series of posts in a way that's unsuitable for tags or categories. You can do this grouping with series. It's a single title for the series, like "Build a blog", that must be the exact same for each post you want grouped together. In fact, let's add this exact series to our lone blog post. Add the following line to the blog post's front matter:
|
1336
|
+
|
1337
|
+
```yaml
|
1338
|
+
series: "build-a-blog"
|
1339
|
+
```
|
1340
|
+
Now refresh the blog post page in your browser and you should see a new series sidebar appear on the right. Note that you don't have to "slugify" the series name. This sames series name just happens to be that way.
|
1341
|
+
|
1342
|
+
### Adding a post image
|
1343
|
+
|
1344
|
+
The Editorial theme, like many blog themes, features a prominent banner image for most pages, including blog posts. To define this images, we have a few different methods. We'll go through them from simplest to most flexible.
|
1345
|
+
|
1346
|
+
#### The Simplest, but least flexible, way to add an image
|
1347
|
+
|
1348
|
+
Because many Jekyll themes will simply use an `image` key in the post front matter, the Editorial theme includes this option as a backwards compatibility measure. We'll use the [Jekyll logo](https://jekyllrb.com/img/logo-2x.png) as a convenient sample image. Be sure to save this image file to your site's `/assets/images/` folder (creating these folders along the way, if necessary), which is the theme-wide default location for image assets. Then add the following to our blog post's front matter:
|
1349
|
+
|
1350
|
+
```yaml
|
1351
|
+
image: "logo-2x.png"
|
1352
|
+
```
|
1353
|
+
Save the changes and then refresh our blog post page to see a nice, and possibly blurry (due to its lower resolution), Jekyll logo pop up as a banner image on the post.
|
1354
|
+
|
1355
|
+
#### Adding alt text, title, and caption
|
1356
|
+
|
1357
|
+
Because HTML images have some textual metadata often attached to them, the Editorial theme introduces these extra fields for the common image metadata in the post's front matter:
|
1358
|
+
|
1359
|
+
```yaml
|
1360
|
+
alt_text: "The Jekyll logo, featuring stylized script and a test tube filled with red, bubbling liquid"
|
1361
|
+
image_title: "The Jekyll logo is so cool!"
|
1362
|
+
caption: "Jekyll lets you create static websites quickly and easily!"
|
1363
|
+
```
|
1364
|
+
Add these lines, save, and refresh the page, and you should see a caption added to the bottom of the logo.
|
1365
|
+
|
1366
|
+
#### A more flexible middle option for images
|
1367
|
+
|
1368
|
+
One problem you might recognize right away is that this method only ever allows one image per post. What if you what 2 different sizes, like a thumbnail and a high resolution version? Our Editorial theme handles this with a slightly more complex yaml structure (replace the *four* previous lines with this):
|
1369
|
+
|
1370
|
+
```yaml
|
1371
|
+
images:
|
1372
|
+
default:
|
1373
|
+
file: "logo-2x.png"
|
1374
|
+
alt_text: "The Jekyll logo, featuring stylized script and a test tube filled with red, bubbling liquid"
|
1375
|
+
title: "The Jekyll logo is so cool!"
|
1376
|
+
caption: "Jekyll lets you create static websites quickly and easily!"
|
1377
|
+
```
|
1378
|
+
or alternatively,
|
1379
|
+
|
1380
|
+
```yaml
|
1381
|
+
images:
|
1382
|
+
default: "logo-2x.png"
|
1383
|
+
alt_text: "The Jekyll logo, featuring stylized script and a test tube filled with red, bubbling liquid"
|
1384
|
+
title: "The Jekyll logo is so cool!"
|
1385
|
+
caption: "Jekyll lets you create static websites quickly and easily!"
|
1386
|
+
```
|
1387
|
+
|
1388
|
+
You can even mix and match the prior two styles, for backwards compatibility:
|
1389
|
+
|
1390
|
+
```yaml
|
1391
|
+
image: "logo-2x.png"
|
1392
|
+
images:
|
1393
|
+
alt_text: "The Jekyll logo, featuring stylized script and a test tube filled with red, bubbling liquid"
|
1394
|
+
title: "The Jekyll logo is so cool!"
|
1395
|
+
caption: "Jekyll lets you create static websites quickly and easily!"
|
1396
|
+
```
|
1397
|
+
|
1398
|
+
#### The most flexible option for images
|
1399
|
+
|
1400
|
+
The prior structure sets us up to be able to add a few different versions of the image (`default`, `banner`, and `thumbnail`):
|
1401
|
+
|
1402
|
+
```yaml
|
1403
|
+
images:
|
1404
|
+
default:
|
1405
|
+
file: "pic02.jpg"
|
1406
|
+
banner:
|
1407
|
+
file: "logo-2x.png"
|
1408
|
+
thumbnail:
|
1409
|
+
file: "pic06.jpg"
|
1410
|
+
alt_text: "A thumbnail version of the Jekyll logo, featuring stylized script and a red-liquid-filled test tube"
|
1411
|
+
title: "Read more about how to use Jekyll!"
|
1412
|
+
alt_text: "The Jekyll logo, featuring stylized script and a test tube filled with red, bubbling liquid"
|
1413
|
+
title: "The Jekyll logo is so cool!"
|
1414
|
+
caption: "Jekyll lets you create static websites quickly and easily!"
|
1415
|
+
```
|
1416
|
+
|
1417
|
+
You'll notice that you can customize the metadata for each image along with the image file itself. Now if you save and then navigate to the posts index page (clicking "All Posts" in the post nav area or "Recent Posts" in the sidebar menu), you should notice the thumbnail image is different and has different hover text from that on the post page.
|
1418
|
+
|
1419
|
+
#### Missing image
|
1420
|
+
|
1421
|
+
Note that if you happen to misspell the name of your image in the front matter config, you'll get a helpful "Missing image" message with the file name and image title in a box instead of the image that Jekyll couldn't find during build.
|
1422
|
+
|
1423
|
+
### Multiple posts and post navigation
|
1424
|
+
|
1425
|
+
To see post navigation in action, we'll need more than one post to navigate to. Rather than making up a bunch of posts, we'll simply copy sample posts from the theme gem, as we've done for other demo content. Remember to `bundle info` to find the theme gem folder:
|
1426
|
+
|
1427
|
+
```sh
|
1428
|
+
:~/my-jekyll-site$ bundle info --path jekyll-theme-editorial
|
1429
|
+
```
|
1430
|
+
And then copy the posts in the `_posts` directory from the theme gem to your site directory's `_posts` folder. Refresh the browser and see these new posts show up in the sidebar menu. You should also see a "previous" post navigation link (likely to the "Look at my great tatoos everybody!" post) at the top and bottom of the post content. You'll also notice that our "Welcome to Jekyll!" post now has some sibling posts in the "Build A Blog" series of posts. Finally, a set of "Latest Posts" (or "Related Posts" if you have Jekyll's `site.related_posts` LSI functionality enabled, which is not supported by the Github Pages build process) will show up below the post author(s).
|
1431
|
+
|
1432
|
+
Clicking around the "Archives", "Categories", and "Tags" pages, not to mention author pages and the home page, will now show more post-related content as well.
|
1433
|
+
|
1265
1434
|
|
1266
1435
|
## Setup Notes
|
1267
1436
|
|
data/_includes/banner.html
CHANGED
@@ -1,10 +1,17 @@
|
|
1
|
-
{%-assign static_file_names = site.static_files
|
2
|
-
|
1
|
+
{%-assign static_file_names = site.static_files | map: 'name'-%}
|
2
|
+
{%-assign banner_image = page.images.banner.file | default: page.images.banner | default: page.images.default.file | default: page.images.default | default: page.image-%}
|
3
|
+
{%-assign banner_alt_text = page.images.banner.alt_text | default: page.images.default.alt_text | default: page.images.alt_text | default: page.alt_text-%}
|
4
|
+
{%-assign banner_title = page.images.banner.title | default: page.images.default.title | default: page.images.title | default: page.image_title-%}
|
5
|
+
{%-assign banner_caption = page.images.banner.caption | default: page.images.default.caption | default: page.images.caption | default: page.caption-%}
|
6
|
+
|
7
|
+
{%-if static_file_names contains banner_image %}
|
3
8
|
<!-- Banner Image -->
|
4
9
|
<figure class="image main">
|
5
|
-
<img src="{{-page.image_path-}}{{-
|
6
|
-
|
7
|
-
<figcaption>{{-
|
8
|
-
|
10
|
+
<img src="{{-page.image_path-}}{{-banner_image-}}" title="{{-banner_title-}}" alt="{{-banner_alt_text-}}"/>
|
11
|
+
{%-if banner_caption %}
|
12
|
+
<figcaption>{{-banner_caption | markdownify-}}</figcaption>
|
13
|
+
{%-endif %}
|
9
14
|
</figure>
|
10
|
-
|
15
|
+
{%-else %}
|
16
|
+
<figure class="box"><h3>Missing image</h3>{{-banner_image-}}<br>{{-banner_title-}}</figure>
|
17
|
+
{%-endif %}
|
@@ -3,18 +3,31 @@ uses parent page settings or a special parent page.banner hash for more flexibil
|
|
3
3
|
(parent) page: [title, subtitle, description, etc.]
|
4
4
|
banner: [header, subheader, content, etc.]
|
5
5
|
{%-endcomment-%}
|
6
|
+
|
7
|
+
{%-assign static_file_names = site.static_files | map: 'name'-%}
|
8
|
+
{%-assign banner_header = page.banner.header | default: page.title | default: site.title-%}
|
9
|
+
{%-assign banner_subheader= page.banner.subheader | default: page.subtitle | default: site.tagline-%}
|
10
|
+
{%-assign banner_content = page.banner.content | default: page.description | default: site.description-%}
|
11
|
+
{%-assign banner_image = page.banner.image | default: page.images.banner.file | default: page.images.banner | default: page.images.default.file | default: page.images.default | default: page.image-%}
|
12
|
+
{%-assign banner_alt_text = page.banner.alt_text | default: page.images.banner.alt_text | default: page.images.default.alt_text | default: page.images.alt_text | default: page.alt_text-%}
|
13
|
+
{%-assign banner_title = page.banner.image_title | default: page.images.banner.title | default: page.images.default.title | default: page.images.title | default: page.image_title-%}
|
14
|
+
|
6
15
|
<section id="banner">
|
7
16
|
<div class="content">
|
8
17
|
<header>
|
9
|
-
<h1>{{-
|
10
|
-
<p>{{-
|
18
|
+
<h1>{{-banner_header-}}</h1>
|
19
|
+
<p>{{-banner_subheader-}}</p>
|
11
20
|
</header>
|
12
|
-
<p>{{-
|
21
|
+
<p>{{-banner_content-}}</p>
|
13
22
|
<ul class="actions">
|
14
23
|
<li><a href="{{-page.banner.url | default: site.url-}}" title="{{-page.banner.link_title-}}" class="button big">{{-page.banner.button_text-}}</a></li>
|
15
24
|
</ul>
|
16
25
|
</div>
|
26
|
+
{%-if static_file_names contains banner_image %}
|
17
27
|
<figure class="image object">
|
18
|
-
<img src="{{-site.image_path-}}{{-
|
28
|
+
<img src="{{-site.image_path-}}{{-banner_image-}}" alt="{{-banner_alt_text-}}" title="{{-banner_title-}}"/>
|
19
29
|
</figure>
|
20
|
-
|
30
|
+
{%-else %}
|
31
|
+
<figure class="box"><h3>Missing image</h3>{{-banner_image-}}<br>{{-banner_title-}}</figure>
|
32
|
+
{%-endif %}
|
33
|
+
</section>
|
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.10
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|