Skip to content

Commit

Permalink
Merge pull request #109 from chrisrhymes/feature/series
Browse files Browse the repository at this point in the history
Add blog post series
  • Loading branch information
chrisrhymes authored Oct 30, 2021
2 parents 7276498 + 901ea18 commit 72f7a30
Show file tree
Hide file tree
Showing 86 changed files with 2,839 additions and 1,819 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The theme uses [Alpine.js](https://github.com/alpinejs/alpine) for its interacti
* [Page Hero](#page-hero)
* [Table Of Contents](#table-of-contents)
* [Posts](#posts)
* [Post Excerpt and Summary](#post-excerpt-and-summary)
* [Series](#series)
* [Navigation](#navigation)
* [Colours and Styles](#colours-and-styles)
* [Sidebar Visibility](#sidebar-visibility)
Expand Down Expand Up @@ -119,6 +121,55 @@ summary: |-
It can be in **Markdown format** if required.
```

#### Series

From version 0.12, you can now make a post a part of a series of posts, linking to the other posts in the series, by creating a `series` data file and then setting the series in each of the post's front matter.

The current post in the list is highlighted to help give context of where you are in the series.

##### Blog Series Data File

Start by creating a yml file in the _data directory, for example `my_blog_series.yml`. Give the series a title and, optionally, a description.

##### Sections

Next add sections. Each section can have a label (optional) and items. Each item is the title of an existing blog post. If the title is not found then the link will be empty.

If you just want one list without labels, then omit the label and just add the items.

```yaml
title: The series title
sections:
- items:
- title: Why use a static site generator
- title: Getting started with Bulma Clean Theme for Jekyll
```

Here is a full example with multiple sections with labels.

```yaml
title: The series title
description: The series description text
sections:
- label: The first section
items:
- title: Why use a static site generator
- title: Getting started with Bulma Clean Theme for Jekyll
- label: Another section
items:
- title: Introducing some new layouts to Bulma Clean Theme
- title: Creating a docs site with Bulma Clean Theme
- title: Creating a post series
```

##### Update your posts

Finally, add the series setting to your front matter in each post you want the series to show in.

```yaml
series: my_blog_series
```

#### Social Share Buttons

Share buttons will be displayed on your posts unless you hide them by adding `hide_share_buttons: true` to your config file.
Expand Down
12 changes: 12 additions & 0 deletions _data/example_blog_series.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Bulma Clean Theme Series
description: This post is part of a series all about Bulma Clean Theme.
sections:
- label: Getting Started
items:
- title: Why use a static site generator
- title: Getting started with Bulma Clean Theme for Jekyll
- label: Advanced Features
items:
- title: Introducing some new layouts to Bulma Clean Theme
- title: Creating a docs site with Bulma Clean Theme
- title: Creating a post series
32 changes: 32 additions & 0 deletions _includes/series.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% assign series = site.data.[page.series] %}
{% assign posts = site.posts %}

<p class="title is-5 is-spaced">{{ series.title }}</p>

{% if series.description %}
<p>{{ series.description }}</p>
{% endif %}

{% for section in series.sections %}

{% if section.label %}
<p class="title is-6">{{ section.label }}</p>
{% endif %}

<ul class="block-list is-small is-outlined">
{% for item in section.items %}
{% assign post = posts | where: "title", item.title %}

{% if page.url == post[0].url %}
<li class="is-highlighted is-dark">
<p>{{ item.title }}</p>
</li>
{% else %}
<li>
<a href="{{ site.baseurl }}{{ post[0].url }}" class="is-flex" >{{ item.title }}</a>
</li>
{% endif %}

{% endfor %}
</ul>
{% endfor %}
4 changes: 4 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

<p>Published: {{ page.date | date: "%b %-d, %Y" }} by {{ page.author }}</p>

{% if page.series %}
{% include series.html %}
{% endif %}

{{ content }}
</div>

Expand Down
59 changes: 59 additions & 0 deletions _posts/2021-10-30-creating-a-post-series.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
layout: post
title: Creating a post series
description: How to create a post series with Bulma Clean Theme
date: 2021-10-30 09:00:07
hero_image: /bulma-clean-theme/img/blog-post-series.jpg
image: /bulma-clean-theme/img/blog-post-series.jpg
hero_height: is-large
hero_darken: true
tags: bulma-clean-theme jekyll blog
series: example_blog_series
---

From version 0.12, you can now make a post a part of a series of posts, linking to the other posts in the series, by creating a `series` data file and then setting the series in each of the post's front matter.

The current post in the list is highlighted to help give context of where you are in the series.

## Blog Series Data File

Start by creating a yml file in the _data directory, for example `my_blog_series.yml`. Give the series a title and, optionally, a description.

## Sections

Next add sections. Each section can have a label (optional) and items. Each item is the title of an existing blog post. If the title is not found then the link will be empty.

If you just want one list without labels, then omit the label and just add the items.

```yaml
title: The series title
sections:
- items:
- title: Why use a static site generator
- title: Getting started with Bulma Clean Theme for Jekyll
```
Here is a full example with multiple sections with labels.
```yaml
title: The series title
description: The series description text
sections:
- label: The first section
items:
- title: Why use a static site generator
- title: Getting started with Bulma Clean Theme for Jekyll
- label: Another section
items:
- title: Introducing some new layouts to Bulma Clean Theme
- title: Creating a docs site with Bulma Clean Theme
- title: Creating a post series
```
## Update your posts
Finally, add the series setting to your front matter in each post you want the series to show in.
```yaml
series: my_blog_series
```
4 changes: 2 additions & 2 deletions bulma-clean-theme.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "bulma-clean-theme"
spec.version = "0.11.2"
spec.version = "0.12"
spec.authors = ["chrisrhymes"]
spec.email = ["[email protected]"]

Expand All @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "jekyll-feed", "~> 0.15"
spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4"
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.6"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.7"
spec.add_runtime_dependency "kramdown-parser-gfm", "~> 1.1"

spec.add_development_dependency "bundler", "~> 2.0"
Expand Down
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.12
* Add blog post series
* Update npm dependencies
* Update gems

# 0.11.2
* Fix for sidebar is-tablet layout

Expand Down
Binary file added img/blog-post-series.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/bulma-block-list/.editorconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions node_modules/bulma-block-list/.github/FUNDING.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/bulma-block-list/changelog.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/bulma-block-list/docs/Gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions node_modules/bulma-block-list/docs/_config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion node_modules/bulma-block-list/docs/_data/menu.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 30 additions & 2 deletions node_modules/bulma-block-list/docs/_sass/_block-list.scss

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 72f7a30

Please sign in to comment.