Skip to content

Commit 9a0a95f

Browse files
authored
Add layouts (#60)
* Add new layouts * Add sample collection documents and pages * Move `footer` * Style archive related things * Update CHANGELOG * Disable hero image overlay by default * Add support for post thumbnails * Add grid layout * Add suggested image sizes * Add layout for grouping posts by year * Document new layouts * Add issue template * Add sample content to demo new layouts * Add sample archive pages to navigation * Add comma * Release 1.4.0 💎
1 parent 1d2cad2 commit 9a0a95f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+911
-82
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!--
2+
Before opening a new issue please:
3+
4+
- Verify you have the latest versions of Jekyll and Minimal Mistakes
5+
installed by running `bundle update`.
6+
- Thoroughly read the theme's documentation at
7+
https://github.com/mmistakes/jekyll-theme-basically-basic/blob/master/README.md
8+
- Search all issues at https://github.com/mmistakes/jekyll-theme-basically-basic/issues
9+
for solutions and to avoid duplication.
10+
- Ask for help at https://talk.jekyllrb.com/
11+
12+
After exhausting these suggestions use the format below.
13+
-->
14+
15+
## Description
16+
17+
<!--
18+
Describe the issue or proposed feature enhancement.
19+
-->
20+
21+
## Environment
22+
23+
<!--
24+
Please include theme version, Jekyll version, public git repository, whether
25+
you are hosting with GitHub Pages, and the operating system you tested with.
26+
27+
Issues without a link to a public repository or ZIP file will likely go ignored.
28+
Being able to see your actual files is necessary to troubleshoot, as most
29+
issues stem from invalid/missing YAML Front Matter, a mis-configured _config.sys
30+
file, or problematic site content.
31+
-->
32+
33+
- Basically Basic version:
34+
- Ruby gem or remote theme version:
35+
- Jekyll version:
36+
- Git repository URL:
37+
- Operating system:
38+
- GitHub Pages hosted (if yes provide URL to site):
39+
40+
---
41+
42+
## Expected behavior
43+
44+
<!--
45+
Describe the intended output or what you expected to see.
46+
-->
47+
48+
## Steps to reproduce the behavior
49+
50+
<!--
51+
Describe the steps you took for this problem to exist. Such as: you installed
52+
the theme, customized _config.yml, added your own posts, and started up a
53+
Jekyll server locally.
54+
55+
If an error occurred on GitHub Pages when pushing, please test a local version
56+
following these setup instructions:
57+
https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/
58+
59+
Then provide a complete log by running `bundle exec jekyll build --trace --verbose`
60+
and include this output in the filed issue.
61+
62+
Screenshots can also be included if they help illustrate a behavior.
63+
-->

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## Unreleased
8+
## [1.4.0] - 2018-04-02
99

1010
## Changed
1111
- Lint JavaScript.
1212
- Update gemspec to use jekyll-seo-tag version `2.4`. [#47](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/47)
1313

1414
### Added
1515
- Accessibility enhancements for Lunr search form.
16-
- Add SCSS `$intro-image-color-overlay` variable to disable color overlay on hero images. [#55](https://github.com/mmistakes/jekyll-theme-basically-basic/issues/55)
16+
- Add SCSS `$intro-image-color-overlay` variable to enable color overlay on hero images (disabled by default). [#55](https://github.com/mmistakes/jekyll-theme-basically-basic/issues/55)
17+
- Add new archive layouts: `posts`, `categories`, `category`, `collection`, `tag`, and `tags`.
18+
- Add grid layout via `entries_layout: grid` front matter.
19+
- Add support for image thumbnails vial `image.thumbnail` front matter.
1720

1821
### Fixed
1922
- Fix Firefox [flexbox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=939897) when printing pages.
2023
- Fix search excerpts that run together because of implied spaces.
24+
- Moved `<footer>` outside of `<main>` to be semantically correct.
2125

2226
## [1.3.1] - 2018-02-16
2327

README.md

Lines changed: 144 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
[![Tip Me via PayPal](https://img.shields.io/badge/PayPal-tip%20me-green.svg?logo=paypal)](https://www.paypal.me/mmistakes)
77

88
Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as
9-
a substitute for the default --- [Minima](https://github.com/jekyll/minima).
10-
Conventions and features found there are fully supported by **Basically Basic**,
11-
with a few enhancements thrown in for good measure:
9+
a substitute for the default [Minima](https://github.com/jekyll/minima), with a
10+
few enhancements thrown in for good measure:
1211

1312
- Clean responsive design with [six customizable skins](#skin)
1413
- Curriculum Vitæ/Resume layout powered by [JSON data](http://registry.jsonresume.org/)
@@ -25,49 +24,55 @@ with a few enhancements thrown in for good measure:
2524
## Table of Contents
2625

2726
1. [Installation](#installation)
28-
1. [Ruby Gem Method](#ruby-gem-method)
29-
2. [GitHub Pages Method](#github-pages-method)
30-
1. [Remove the Unnecessary](#remove-the-unnecessary)
27+
1. [Ruby Gem Method](#ruby-gem-method)
28+
2. [GitHub Pages Method](#github-pages-method)
29+
1. [Remove the Unnecessary](#remove-the-unnecessary)
3130
2. [Upgrading](#upgrading)
32-
1. [Ruby Gem](#ruby-gem)
33-
2. [Remote Theme](#remote-theme)
34-
3. [Use Git](#use-git)
35-
1. [Pull Down Updates](#pull-down-updates)
36-
4. [Update Files Manually](#update-files-manually)
31+
1. [Ruby Gem](#ruby-gem)
32+
2. [Remote Theme](#remote-theme)
33+
3. [Use Git](#use-git)
34+
1. [Pull Down Updates](#pull-down-updates)
35+
4. [Update Files Manually](#update-files-manually)
3736
3. [Structure](#structure)
38-
1. [Starting Fresh](#starting-fresh)
39-
2. [Starting from `jekyll new`](#starting-from-jekyll-new)
37+
1. [Starting Fresh](#starting-fresh)
38+
2. [Starting from `jekyll new`](#starting-from-jekyll-new)
4039
4. [Configuration](#configuration)
41-
1. [Skin](#skin)
42-
2. [Google Fonts](#google-fonts)
43-
3. [Text](#text)
44-
4. [Navigation](#navigation)
45-
5. [Pagination](#pagination)
46-
6. [Search](#search)
47-
1. [Lunr (default)](#lunr-default)
48-
2. [Algolia](#algolia)
49-
7. [Author](#author)
50-
8. [Reading Time](#reading-time)
51-
9. [Comments (via Disqus)](#comments-via-disqus)
52-
10. [Google Analytics](#google-analytics)
40+
1. [Skin](#skin)
41+
2. [Google Fonts](#google-fonts)
42+
3. [Text](#text)
43+
4. [Navigation](#navigation)
44+
5. [Pagination](#pagination)
45+
6. [Search](#search)
46+
1. [Lunr (default)](#lunr-default)
47+
2. [Algolia](#algolia)
48+
7. [Author](#author)
49+
8. [Reading Time](#reading-time)
50+
9. [Comments (via Disqus)](#comments-via-disqus)
51+
10. [Google Analytics](#google-analytics)
5352
5. [Layouts](#layouts)
54-
1. [`layout: default`](#layout-default)
55-
2. [`layout: post`](#layout-post)
56-
3. [`layout: page`](#layout-page)
57-
4. [`layout: home`](#layout-home)
58-
5. [`layout: about`](#layout-about)
59-
6. [`layout: cv`](#layout-cv)
60-
6. [Customization](#customization)
61-
1. [Overriding Includes and Layouts](#overriding-includes-and-layouts)
62-
2. [Customizing Sass (SCSS)](#customizing-sass-scss)
63-
3. [Customizing JavaScript](#customizing-javascript)
64-
4. [SVG Icons](#svg-icons)
65-
5. [Customizing Sidebar Content](#customizing-sidebar-content)
66-
7. [Development](#development)
67-
8. [Contributing](#contributing)
68-
1. [Pull Requests](#pull-requests)
69-
9. [Credits](#credits)
70-
10. [License](#license)
53+
1. [`layout: default`](#layout-default)
54+
2. [`layout: post`](#layout-post)
55+
3. [`layout: page`](#layout-page)
56+
4. [`layout: home`](#layout-home)
57+
5. [`layout: posts`](#layout-posts)
58+
6. [`layout: categories`](#layout-categories)
59+
7. [`layout: tags`](#layout-tags)
60+
8. [`layout: collection`](#layout-collection)
61+
9. [`layout: category`](#layout-category)
62+
10. [`layout: tag`](#layout-tag)
63+
11. [`layout: about`](#layout-about)
64+
12. [`layout: cv`](#layout-cv)
65+
6. [Images](#images)
66+
7. [Customization](#customization)
67+
1. [Overriding Includes and Layouts](#overriding-includes-and-layouts)
68+
2. [Customizing Sass (SCSS)](#customizing-sass-scss)
69+
3. [Customizing JavaScript](#customizing-javascript)
70+
4. [SVG Icons](#svg-icons)
71+
5. [Customizing Sidebar Content](#customizing-sidebar-content)
72+
8. [Development](#development)
73+
9. [Contributing](#contributing)
74+
10. [Credits](#credits)
75+
11. [License](#license)
7176

7277
## Installation
7378

@@ -603,10 +608,10 @@ author:
603608
comments: false # disable comments on this post
604609
```
605610

606-
**Note:** Hero images are overlaid with a transparent "accent" color to unify them with the theme's palette. To disable [customize the CSS](#customizing-sass-scss) with the following Sass variable override:
611+
**Note:** Hero images can be overlaid with a transparent "accent" color to unify them with the theme's palette. To enable, [customize the CSS](#customizing-sass-scss) with the following Sass variable override:
607612

608613
```scss
609-
$intro-image-color-overlay: false;
614+
$intro-image-color-overlay: true;
610615
```
611616

612617
### `layout: page`
@@ -624,6 +629,90 @@ addition of the following:
624629

625630
```yaml
626631
paginate: true # enables pagination loop, see section above for additional setup
632+
entries_layout: # list (default), grid
633+
```
634+
635+
By default, posts are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter.
636+
637+
### `layout: posts`
638+
639+
This layout displays all posts grouped by the year they were published. It accommodates the same front matter as `layout: page`.
640+
641+
By default, posts are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter.
642+
643+
### `layout: categories`
644+
645+
This layout displays all posts grouped category. It accommodates the same front matter as `layout: page`.
646+
647+
By default, posts are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter.
648+
649+
### `layout: tags`
650+
651+
This layout displays all posts grouped by tag. It accommodates the same front matter as `layout: page`.
652+
653+
By default, posts are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter.
654+
655+
### `layout: collection`
656+
657+
This layout displays all documents grouped by a specific collection. It accommodates the same front matter as `layout: page` with the addition of the following:
658+
659+
```yaml
660+
collection: # collection name
661+
entries_layout: # list (default), grid
662+
show_excerpts: # true (default), false
663+
sort_by: # date (default) title
664+
sort_order: # forward (default), reverse
665+
```
666+
667+
To create a page showing all documents in the `recipes` collection you'd create `recipes.md` in the root of your project and add this front matter:
668+
669+
```yaml
670+
title: Recipes
671+
layout: collection
672+
permalink: /recipes/
673+
collection: recipes
674+
```
675+
676+
By default, documents are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter. If you want to sort the collection by title add `sort_by: title`. If you want reverse sorting, add `sort_order: reverse`.
677+
678+
### `layout: category`
679+
680+
This layout displays all posts grouped by a specific category. It accommodates the same front matter as `layout: page` with the addition of the following:
681+
682+
```yaml
683+
taxonomy: # category name
684+
entries_layout: # list (default), grid
685+
```
686+
687+
By default, posts are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter.
688+
689+
To create a page showing all posts assigned to the category `foo` you'd create `foo.md` in the root of your project and add this front matter:
690+
691+
```yaml
692+
title: Foo
693+
layout: category
694+
permalink: /categories/foo/
695+
taxonomy: foo
696+
```
697+
698+
### `layout: tag`
699+
700+
This layout displays all posts grouped by a specific tag. It accommodates the same front matter as `layout: page` with the addition of the following:
701+
702+
```yaml
703+
taxonomy: # tag name
704+
entries_layout: # list (default), grid
705+
```
706+
707+
By default, posts are shown in a list view. To change to a grid view add `entries_layout: grid` to the page's front matter.
708+
709+
To create a page showing all posts assigned to the tag `foo bar` you'd create `foo-bar.md` in the root of your project and add this front matter:
710+
711+
```yaml
712+
title: Foo Bar
713+
layout: tag
714+
permalink: /tags/foo-bar/
715+
taxonomy: foo bar
627716
```
628717

629718
### `layout: about`
@@ -652,6 +741,17 @@ resume data to conveniently render a curriculum vitæ or resume painlessly.
652741
Simply use JSON Resume's [in-browser resume builder](http://registry.jsonresume.org/)
653742
to export a JSON file and save to your project as `_data/cv.json`.
654743

744+
## Images
745+
746+
Suggested image sizes in pixels are as follows:
747+
748+
| Image | Description | Size |
749+
| ----- | ----------- | ---- |
750+
| `page.image.path` | Large full-width document image. | Tall images will push content down the page. `1600 x 600` is a good middle-ground size to aim for. |
751+
| `page.image` | Short-hand for `page.image.path` when used alone (without `thumbnail`, `caption`, or other variables). | Same as `page.image.path` |
752+
| `page.image.thumbnail` | Small document image used in grid view. | `400 x 200` |
753+
| `author.picture` | Author page image. | `300 x 300` |
754+
655755
## Customization
656756

657757
The default structure, style, and scripts of this theme can be overridden and

_includes/documents-collection.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% assign entries = site[include.collection] %}
2+
3+
{% if include.sort_by == 'title' %}
4+
{% if include.sort_order == 'reverse' %}
5+
{% assign entries = entries | sort: 'title' | reverse %}
6+
{% else %}
7+
{% assign entries = entries | sort: 'title' %}
8+
{% endif %}
9+
{% elsif include.sort_by == 'date' %}
10+
{% if include.sort_order == 'reverse' %}
11+
{% assign entries = entries | sort: 'date' | reverse %}
12+
{% else %}
13+
{% assign entries = entries | sort: 'date' %}
14+
{% endif %}
15+
{% endif %}
16+
17+
{%- for post in entries -%}
18+
{% include entry.html %}
19+
{%- endfor -%}

_includes/entry.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
<h3 class="entry-title">
1010
<a href="{{ post.url | relative_url }}" rel="bookmark">{{ title }}</a>
1111
</h3>
12+
{% if post.image.thumbnail %}
13+
{% assign entry_image = post.image.thumbnail %}
14+
{% unless entry_image contains '://' %}
15+
{% assign entry_image = entry_image | relative_url %}
16+
{% endunless %}
17+
{% assign entry_image = entry_image | escape %}
18+
<img class="entry-image u-photo" src="{{ entry_image }}" alt="">
19+
{% endif %}
1220
</header>
1321
<footer class="entry-meta">
1422
<ul>

_includes/footer.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<footer id="footer" class="site-footer">
2-
<div class="copyright">
3-
{% if site.copyright %}
4-
{{ site.copyright | markdownify }}
5-
{% else %}
6-
<p>&copy; {{ site.time | date: '%Y' }} {{ site.title }}.</p>
7-
{% endif %}
2+
<div class="inner">
3+
<div class="copyright">
4+
{% if site.copyright %}
5+
{{ site.copyright | markdownify }}
6+
{% else %}
7+
<p>&copy; {{ site.time | date: '%Y' }} {{ site.title }}.</p>
8+
{% endif %}
9+
</div>
810
</div>
911
</footer>

_includes/page-intro.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<div class="inner">
1414
<div class="intro-text">
15-
<h1 class="intro-title">{{ page.alt_title | default: page.title | default: site.title | markdownify | strip_html }}</h1>
15+
<h1 id="page-title" class="intro-title">{{ page.alt_title | default: page.title | default: site.title | markdownify | strip_html }}</h1>
1616
{% if page.sub_title %}
1717
<p class="intro-subtitle">{{ page.sub_title | markdownify | strip_html }}</p>
1818
{% endif %}

_includes/page-tags.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% if page.tags.size > 0 %}
2+
<h3 class="page-taxonomies-title">{{ site.data.text[site.locale].tags | default: 'Tags' }}</h3>
3+
<ul class="page-taxonomies">
4+
{%- for tag in page.tags -%}
5+
<li class="page-taxonomy">
6+
{%- if site.tag_archive_path -%}
7+
<a href="{{ tag | slugify | prepend: site.tag_archive_path | relative_url }}" title="{{ site.data.text[site.locale].pages_tagged | default: 'Pages tagged' }} {{ tag }}" rel="tag">{{ tag }}</a>
8+
{%- else -%}
9+
{{ tag }}
10+
{%- endif -%}
11+
</li>
12+
{%- endfor- %}
13+
</ul>
14+
{% endif %}

_includes/posts-category.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- for post in site.categories[include.taxonomy] -%}
2+
{% include entry.html %}
3+
{%- endfor -%}

0 commit comments

Comments
 (0)