Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrhymes committed Sep 8, 2019
0 parents commit dded982
Show file tree
Hide file tree
Showing 95 changed files with 17,869 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.gem
.bundle
.sass-cache
_site
Gemfile.lock
.DS_Store
.idea
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

source "https://rubygems.org"
gemspec

group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
gem "jekyll-sitemap"
gem "jekyll-paginate"
gem "jekyll-seo-tag"
end
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 chrisrhymes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# mere-blog-theme

Mere is a minimal and simple blog theme, and nothing more, for use with Jekyll and GitHub Pages. It has been built with the Bulma frontend framework.

It has a homepage which displays the latest 6 posts and a paginated blog page used to list out all blog posts.


## Installation

Add this line to your Jekyll site's `Gemfile`:

```ruby
gem "mere-blog-theme"
```

And add this line to your Jekyll site's `_config.yml`:

```yaml
theme: mere-blog-theme
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install mere-blog-theme
## Usage
* [Blog Setup](#blog-setup)
* [Posts](#posts)
* [Homepage](#homepage)
* [Google Analytics](#google-analytics)
### 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
```

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"
```

### 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.

```yaml
layout: post
title: First Post
image: /img/home.jpg
author: C.S. Rhymes
```

Wide images will work best, with a minimum width of 1400px.

### Homepage

Finally, configure the homepage by creating an `index.html` page and configure the frontmatter with the layout of homepage, the title, subtitle (optional) and the image. You can set the hero_height to is-large if you want to make the homepage header a bit larger.

```yaml
layout: homepage
title: Mere Blog Theme
subtitle: This is the demo site for the Mere Blog Theme
image: /img/home.jpg
hero_height: is-large
```

### Google Analytics

To enable Google Analytics add `google_analytics: UA-xxxxxxxx` to your `_config.yml` replacing the UA-xxxxxxxx with your Google Analytics property.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/chrisrhymes/mere-blog-theme. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## Development

To set up your environment to develop this theme, run `bundle install`.

Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.

When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
To add a custom directory to your theme-gem, please edit the regexp in `mere-blog-theme.gemspec` accordingly.

## License

The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

47 changes: 47 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Site Settings
title: Mere Blog Theme
tagline: Mere Blog Theme
email: [email protected]
description: >
The demo site for Mere Blog Theme, made for Jekyll and GitHub pages websites
baseurl: "/mere-blog-theme"
url: "https://www.csrhymes.com"
permalink: pretty

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

plugins:
- jekyll-sitemap
- jekyll-paginate
- jekyll-feed
- jekyll-seo-tag
- kramdown
- rouge

exclude:
- Gemfile
- clean-theme.gemspec
- Gemfile.lock
- node_modules
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/

livereload: true

sass:
style: compressed
source_dir: _sass

defaults:
-
scope:
path: ""
type: "posts"
values:
author: "C.S. Rhymes"
layout: post
image: /img/home.jpg
show_sidebar: true
8 changes: 8 additions & 0 deletions _includes/google-analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window['ga-disable-{{ site.google_analytics }}'] = window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1";
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.google_analytics }}');
</script>
Empty file added _includes/head-scripts.html
Empty file.
13 changes: 13 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ page.title }} - {{ site.title }}</title>
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/app.css">
<link rel="shortcut icon" type="image/png" href="{{ site.baseurl }}/favicon.png" />
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
{% seo %}
{%- if site.google_analytics -%}
{%- include google-analytics.html -%}
{%- endif -%}
{%- include head-scripts.html -%}
</head>
8 changes: 8 additions & 0 deletions _includes/hero.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<section class="hero {% if page.hero_height %} {{ page.hero_height }} {% else %} is-medium {% endif %} is-bold is-dark" {% if page.image %} style="background: url('{{ page.image | prepend: site.baseurl }}') no-repeat center center; background-size: cover;" {% endif %}>
<div class="hero-body">
<div class="container">
<p class="title is-2">{{ page.title }}</p>
<p class="subtitle is-3">{{ page.subtitle }}</p>
</div>
</div>
</section>
19 changes: 19 additions & 0 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="navbar is-white">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="{{ site.baseurl }}/">
{{ site.title }}
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navMenu">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="{{ site.baseurl }}/blog/">Blog</a>
</div>
</div>
</div>
</div>
23 changes: 23 additions & 0 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<nav class="pagination is-centered">
{% if paginator.previous_page %}
<a href="{{ site.baseurl }}{{ paginator.previous_page_path }}" class="pagination-previous is-info"><i class="fas fa-chevron-left"></i></a>
{% else %}
<p class="pagination-previous" disabled><i class="fas fa-chevron-left"></i></p>
{% endif %}
{% if paginator.next_page %}
<a href="{{ site.baseurl }}{{ paginator.next_page_path }}" class="pagination-next is-info"><i class="fas fa-chevron-right"></i></a>
{% else %}
<p class="pagination-next" disabled ><i class="fas fa-chevron-right"></i></p>
{% endif %}
<ul class="pagination-list">
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<li><a class="pagination-link is-current">{{ page }}</a></li>
{% elsif page == 1 %}
<li><a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" class="pagination-link">{{ page }}</a></li>
{% else %}
<li><a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}" class="pagination-link">{{ page }}</a></li>
{% endif %}
{% endfor %}
</ul>
</nav>
17 changes: 17 additions & 0 deletions _includes/post-item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="card">
<div class="card-image">
<img src="{{ post.image | prepend: site.baseurl }}" alt="{{ post.title }}" width="100%">
</div>
<div class="card-content">
<div class="content">
<a href="{{ site.baseurl }}{{ post.url }}">
<p class="title is-4">{{ post.title}}</p>
</a>
<p class="subtitle is-6">Published {{ post.date | date: "%b %-d, %Y" }} by {{ post.author }}</p>
<p>{{ post.excerpt | strip_html | strip_newlines | truncate: 200 }}</p>
</div>
<div class="has-text-centered">
<a href="{{ site.baseurl }}{{ post.url }}" class="button is-dark is-fullwidth">Read more</a>
</div>
</div>
</div>
19 changes: 19 additions & 0 deletions _layouts/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: default
---

{{ content }}

<div class="columns is-multiline">
<div class="column is-12">
{% include pagination.html %}
</div>
{% for post in paginator.posts %}
<div class="column is-12">
{% include post-item.html %}
</div>
{% endfor %}
<div class="column is-12">
{% include pagination.html %}
</div>
</div>
21 changes: 21 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html>
{% include head.html %}
<body>
{% include navbar.html %}
{% include hero.html %}
<section class="section">
<div class="container">
{{ content }}
</div>
</section>
<section class="section">
<div class="container">
<div class="has-text-centered">
<p>Theme built by <a href="https://www.csrhymes.com">C.S. Rhymes</a></p>
</div>
</div>
</section>
</body>
</html>

26 changes: 26 additions & 0 deletions _layouts/homepage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: default
---

<div class="content">
{{ content }}
</div>

<div class="columns is-multiline">
{% assign post_width = "6|6|12|4|4|4" | split: "|" %}
{% for post in site.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>
</div>
</div>


5 changes: 5 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: default
---

{{ content }}
14 changes: 14 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---

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

<div class="tags">
{% for tag in page.tags %}
<span class="tag is-primary">{{ tag }}</span>
{% endfor %}
</div>
13 changes: 13 additions & 0 deletions _posts/2019-08-31-first-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: post
title: First Post
image: /img/home.jpg
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec elit eros, porta eget dapibus vitae, tempus et mi. Maecenas sollicitudin ligula vel metus condimentum, ac commodo sem vestibulum. Morbi tempus dui sapien, vel mattis orci faucibus id. Nulla congue elit vel accumsan mattis. Ut vel dolor porttitor, laoreet risus in, tempus velit. Praesent eu nisi enim. Integer sed venenatis risus, eget semper sapien. Nulla at lacinia lectus. Sed rutrum lectus at vestibulum tristique. Cras ex sem, consequat at dapibus scelerisque, iaculis sit amet tellus. Fusce eu orci ut ex consequat semper. Mauris pharetra dictum dui, vestibulum egestas erat.

Aliquam diam eros, maximus non consectetur sed, faucibus et risus. Morbi quis velit ultrices, ultrices magna ut, pretium mauris. Sed interdum dolor augue, in ultrices tellus rutrum eu. Donec a tellus gravida, imperdiet sapien et, mollis nibh. Aenean at diam eu diam gravida malesuada. In egestas est arcu, porttitor luctus orci dapibus eu. Maecenas ac justo quam. Sed blandit hendrerit massa, vel semper augue sagittis consequat. Aliquam non finibus massa, a semper est. Etiam ornare elit sed vestibulum semper. Nunc nec blandit augue. Etiam molestie massa et justo luctus sagittis. Suspendisse tincidunt maximus tellus non iaculis. Proin ut sodales magna. Integer cursus orci sit amet diam vehicula molestie. Nam luctus arcu a consequat blandit.

Nunc accumsan, leo eget porta auctor, odio augue consectetur lectus, sit amet laoreet nibh ex vitae orci. Aliquam erat volutpat. Nunc ultricies magna sem, vitae rhoncus augue commodo vitae. Suspendisse commodo nisl dui, eu maximus tortor rhoncus sit amet. Nulla facilisi. Mauris condimentum massa rhoncus, tempus risus sit amet, elementum turpis. Etiam quis urna tempus, tempus ipsum in, egestas arcu. Duis nibh nibh, vulputate sed fringilla pellentesque, hendrerit at lorem. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus elementum ultrices ultrices. Quisque ac erat pharetra ipsum imperdiet rhoncus. Donec fermentum ante nec scelerisque tempus. Proin at aliquam orci. Quisque interdum nibh eu justo cursus egestas. Integer sed est turpis.

Aenean nec erat a sapien ornare tincidunt. Nam at lorem nunc. Praesent euismod hendrerit diam in pulvinar. Integer vulputate ligula ut commodo vehicula. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed ut turpis in lacus vestibulum rhoncus sed eget arcu. Donec sit amet venenatis est, vitae varius diam. Etiam at dictum ligula. Nullam id turpis sem. Phasellus ut pellentesque risus. Maecenas ultricies dolor a nisi pretium, quis tempor sem pharetra.
Loading

0 comments on commit dded982

Please sign in to comment.