Skip to content

Commit

Permalink
Merge pull request #4 from chrisrhymes/feature/homepage-blog
Browse files Browse the repository at this point in the history
Move blog pagination to homepage and removed blog page
  • Loading branch information
chrisrhymes committed Aug 22, 2020
2 parents 189694c + 5a7df0c commit 62902aa
Show file tree
Hide file tree
Showing 74 changed files with 19,500 additions and 6,996 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ _site
Gemfile.lock
.DS_Store
.idea
.jekyll-cache
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
source "https://rubygems.org"
gemspec

gem "jekyll", "~> 3.8"

group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
gem "jekyll-sitemap"
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,18 @@ Or install it yourself as:
### Blog Setup
Create a `blog` directory with an `index.html` file inside it. Set the front matter of the `blog/index.html` page with the layout of blog.

```yaml
layout: blog
title: Blog
```
As of 0.4, the blog posts will be displayed on the homepage including pagination, instead of in a separate blog page.
Set the paginator up in the `_config.yml` file with the posts per page and the path to the blog.

```yaml
paginate: 5
paginate_path: "/blog/page:num"
paginate: 6
paginate_path: "/page:num"
```

### Posts

Posts should be created in the _posts directory as per standard Jekyll usage. The frontmatter should contain the layout of post, the image to use in the header and the homepage / blog page, the title of the post and the author of the post. You can also set a subtitle for the post if you want to.
Posts should be created in the _posts directory as per standard Jekyll usage. The front matter should contain the layout of post, the image to use in the header and the homepage / blog page, the title of the post and the author of the post. You can also set a subtitle for the post if you want to.

```yaml
layout: post
Expand Down
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ baseurl: "/mere-blog-theme"
url: "https://www.csrhymes.com"
permalink: pretty

paginate: 5
paginate_path: "/blog/page:num"
paginate: 6
paginate_path: "/page:num"

plugins:
- jekyll-sitemap
Expand Down
1 change: 0 additions & 1 deletion _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
<a class="navbar-item" href="{{ site.baseurl }}/blog/">Blog</a>
{% if site.authors %}
<a class="navbar-item" href="{{ site.baseurl }}/authors/">Authors</a>
{% endif %}
Expand Down
8 changes: 2 additions & 6 deletions _layouts/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@

<div class="columns is-multiline">
{% assign post_width = "6|6|12|4|4|4" | split: "|" %}
{% for post in site.posts limit:6 %}
{% for post in paginator.posts limit:6 %}
<div class="column is-{{ post_width[forloop.index0] }}">
{% include post-item.html %}
</div>
{% endfor %}

<div class="column is-12">
<div class="columns is-centered">
<div class="column is-3">
<a class="button is-dark is-fullwidth" href="{{ site.baseurl }}/blog/">More</a>
</div>
</div>
{% include pagination.html %}
</div>
</div>

Expand Down
6 changes: 0 additions & 6 deletions blog/index.html

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion mere-blog-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 = "mere-blog-theme"
spec.version = "0.3"
spec.version = "0.4"
spec.authors = ["chrisrhymes"]
spec.email = ["[email protected]"]

Expand Down
209 changes: 207 additions & 2 deletions node_modules/bulma/CHANGELOG.md

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

2 changes: 1 addition & 1 deletion node_modules/bulma/LICENSE

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

Loading

0 comments on commit 62902aa

Please sign in to comment.