Format text

This commit is contained in:
Michael Rose 2017-03-20 14:33:08 -04:00
parent 93023ed6fc
commit cb7a148925
1 changed files with 142 additions and 60 deletions

202
README.md
View File

@ -3,7 +3,10 @@
[![license](https://img.shields.io/github/license/mmistakes/jekyll-theme-basically-basic.svg?style=flat-square)](LICENSE.md)
[![Code Climate](https://img.shields.io/codeclimate/github/mmistakes/jekyll-theme-basically-basic.svg?style=flat-square)](https://codeclimate.com/github/mmistakes/jekyll-theme-basically-basic)
Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as a substitute for the default --- [Minima](https://github.com/jekyll/minima). Conventions and features found there are fully supported by **Basically Basic**, with a few enhancements thrown in for good measure:
Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as
a substitute for the default --- [Minima](https://github.com/jekyll/minima).
Conventions and features found there are fully supported by **Basically Basic**,
with a few enhancements thrown in for good measure:
- Clean responsive design with [six customizable skins](#skin)
- Curriculum Vitæ/Resume layout powered by [JSON data](http://registry.jsonresume.org/)
@ -50,7 +53,8 @@ Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as
gem "jekyll-theme-basically-basic", :git => "https://github.com/mmistakes/jekyll-theme-basically-basic.git"
```
2. Fetch and update your bundled gems by running the following [Bundler](http://bundler.io/) command:
2. Fetch and update your bundled gems by running the following
[Bundler](http://bundler.io/) command:
```bash
bundle
@ -62,24 +66,41 @@ Basically Basic is a [Jekyll theme](https://jekyllrb.com/docs/themes/) meant as
theme: jekyll-theme-basically-basic
```
**Note:** 3rd-party Ruby gem themes aren't currently supported on sites hosted
with [GitHub Pages](https://pages.github.com/). Basically Basic can still be
used on GH Pages, but you will need to fork the theme instead.
## Configuration
Configuration of site-wide elements (`lang`, `title`, `description`, `logo`, `author`, etc.) happens in your project's `_config.yml`. See the [example configuration](example/_config.yml) in this repo for additional reference.
Configuration of site-wide elements (`lang`, `title`, `description`, `logo`,
`author`, etc.) happens in your project's `_config.yml`. See the
[example configuration](example/_config.yml) in this repo for additional
reference.
| | Description |
| ------------------ | -------------------------------------------------------------------- |
| `lang` | Used to indicate the language of text (e.g., en-US, en-GB, fr) |
| `title` | Your site's title (e.g., Dungan's Awesome Site) |
| `description` | Short site description (e.g., A blog about grasshopper mash) |
| `url` | The full URL to your site (e.g., https://groverloaf.org) |
| `author` | Global author information (see below) |
| `logo` | Path to a site-wide logo (e.g., /assets/your-company-logo.png) |
| `twitter_username` | Site-wide Twitter username, used as a link in sidebar |
| `github_username` | Site-wide GitHub username, used as a link in sidebar |
| | Description |
| ------------------ | ------------------------------------------------------------------------- |
| `lang` | Used to indicate the language of text (e.g., en-US, en-GB, fr) |
| `title` | Your site's title (e.g., Dungan's Awesome Site) |
| `description` | Short site description (e.g., A blog about grasshopper mash) |
| `url` | The full URL to your site (e.g., https://groverloaf.org) |
| `author` | Global author information (see below) |
| `logo` | Path to a site-wide logo ~100x100px (e.g., /assets/your-company-logo.png) |
| `twitter_username` | Site-wide Twitter username, used as a link in sidebar |
| `github_username` | Site-wide GitHub username, used as a link in sidebar |
For more configuration options be sure to consult the documentation for:
[**jekyll-seo-tag**][jekyll-seo-tag], [**jekyll-feed**][jekyll-feed],
[**jekyll-paginate**][jekyll-paginate], and [**jekyll-sitemap**][jekyll-sitemap].
[jekyll-seo-tag]: https://github.com/jekyll/jekyll-seo-tag
[jekyll-feed]: https://github.com/jekyll/jekyll-feed
[jekyll-paginate]: https://github.com/jekyll/jekyll-paginate
[jekyll-sitemap]: https://github.com/jekyll/jekyll-sitemap
### Skin
This theme comes in six different skins (color variations). To change skins add one of the following to your [`/_data/theme.yml`](_data/theme.yml) file:
This theme comes in six different skins (color variations). To change skins add
one of the following to your [`/_data/theme.yml`](_data/theme.yml) file:
| | | |
| --------------- | ------------- | ------------- |
@ -88,7 +109,10 @@ This theme comes in six different skins (color variations). To change skins add
### Google Fonts
This theme allows you to easily use [Google Fonts](https://fonts.google.com/) throughout the theme. Simply add the following to your [`/_data/theme.yml`](_data/theme.yml), replacing the font `name` and `weights` accordingly.
This theme allows you to easily use [Google Fonts](https://fonts.google.com/)
throughout the theme. Simply add the following to your
[`/_data/theme.yml`](_data/theme.yml), replacing the font `name` and `weights`
accordingly.
```yaml
google_fonts:
@ -99,7 +123,8 @@ google_fonts:
### Text
To change text found throughout the theme add the following to your [`/_data/theme.yml`](_data/theme.yml) file and customize as necessary.
To change text found throughout the theme add the following to your
[`/_data/theme.yml`](_data/theme.yml) file and customize as necessary.
```yaml
t:
@ -123,9 +148,11 @@ t:
### Navigation
By default all internal pages with a `title` will be added to the "off-canvas" menu. For more granular control and sorting of these menu links:
By default all internal pages with a `title` will be added to the "off-canvas"
menu. For more granular control and sorting of these menu links:
1. Create a custom list to override the default setting by adding a `navigation_pages` array to your [`/_data/theme.yml`](_data/theme.yml) file.
1. Create a custom list to override the default setting by adding a
`navigation_pages` array to your [`/_data/theme.yml`](_data/theme.yml) file.
2. Add raw page paths in the order you'd like:
@ -135,11 +162,13 @@ By default all internal pages with a `title` will be added to the "off-canvas" m
- cv.md
```
Each menu link's title and URL will be populated based on their `title` and `permalink` respectively.
Each menu link's title and URL will be populated based on their `title` and
`permalink` respectively.
### Pagination
Break up the main listing of posts into smaller lists and display them over multiple pages by [enabling pagination](http://jekyllrb.com/docs/pagination/).
Break up the main listing of posts into smaller lists and display them over
multiple pages by [enabling pagination](http://jekyllrb.com/docs/pagination/).
1. Include the `jekyll-paginate` plugin in your `Gemfile`.
@ -149,18 +178,22 @@ Break up the main listing of posts into smaller lists and display them over mult
end
```
2. Add `jekyll-paginate` to `gems` array in your `_config.yml` file and the following pagination settings:
2. Add `jekyll-paginate` to `gems` array in your `_config.yml` file and the
following pagination settings:
```yaml
paginate: 5 # amount of posts to show per page
paginate_path: /page:num/
```
3. Create `index.html` (or rename `index.md`) in the root of your project and add `layout: home` `paginate: true` to its YAML Front Matter.
3. Create `index.html` (or rename `index.md`) in the root of your project and
add `layout: home` `paginate: true` to its YAML Front Matter.
### Author
Author information is used as meta data for post "by lines" and propagates the `creator` field of Twitter summary cards with the following YAML Front Matter in `_config.yml`:
Author information is used as meta data for post "by lines" and propagates the
`creator` field of Twitter summary cards with the following YAML Front Matter
in `_config.yml`:
```yaml
author:
@ -169,7 +202,8 @@ author:
picture: /assets/images/johndoe.png
```
Site-wide author information can be overridden in a document's YAML Front Matter in the same way:
Site-wide author information can be overridden in a document's YAML Front Matter
in the same way:
```yaml
author:
@ -178,7 +212,9 @@ author:
picture: /assets/images/janedoe.png
```
Or by specifying a corresponding key in the document's YAML Front Matter, that exists in `site.data.authors`. E.g., you have the following in the document's YAML Front Matter:
Or by specifying a corresponding key in the document's YAML Front Matter, that
exists in `site.data.authors`. E.g., you have the following in the document's
YAML Front Matter:
```yaml
author: megaman
@ -198,15 +234,18 @@ drlight:
picture: /assets/images/drlight.png
```
Currently `author.picture` is only used in `layout: about`. Recommended size is `300 x 300` pixels.
Currently `author.picture` is only used in `layout: about`. Recommended size is
`300 x 300` pixels.
### Reading Time
To enable reading time counts add `read_time: true` to a post or page's YAML Front Matter.
To enable reading time counts add `read_time: true` to a post or page's YAML
Front Matter.
### Comments (via Disqus)
Optionally, if you have a [Disqus](https://disqus.com/) account, you can show a comments section below each post.
Optionally, if you have a [Disqus](https://disqus.com/) account, you can show a
comments section below each post.
To enable Disqus comments, add your [Disqus shortname](https://help.disqus.com/customer/portal/articles/466208) to your project's `_config.yml` file:
@ -215,23 +254,30 @@ To enable Disqus comments, add your [Disqus shortname](https://help.disqus.com/c
shortname: my_disqus_shortname
```
Comments are enabled by default and will only appear in production when built with the following [environment value](http://jekyllrb.com/docs/configuration/#specifying-a-jekyll-environment-at-build-time): `JEKYLL_ENV=production`
Comments are enabled by default and will only appear in production when built
with the following [environment value](http://jekyllrb.com/docs/configuration/#specifying-a-jekyll-environment-at-build-time):
`JEKYLL_ENV=production`
If you don't want to display comments for a particular post you can disable them by adding `comments: false` to that post's YAML Front Matter.
If you don't want to display comments for a particular post you can disable
them by adding `comments: false` to that post's YAML Front Matter.
### Google Analytics
To enable Google Analytics, add your [tracking ID](https://support.google.com/analytics/answer/1032385) to `_config.yml` like so:
To enable Google Analytics, add your [tracking ID](https://support.google.com/analytics/answer/1032385)
to `_config.yml` like so:
```yaml
google_analytics: UA-NNNNNNNN-N
```
Similar to comments, the Google Analytics tracking script will only appear in production when using the following environment value: `JEKYLL_ENV=production`.
Similar to comments, the Google Analytics tracking script will only appear in
production when using the following environment value: `JEKYLL_ENV=production`.
## Layouts
This theme provides the following layouts, which you can use by setting the `layout` [Front Matter](https://jekyllrb.com/docs/frontmatter/) on each page, like so:
This theme provides the following layouts, which you can use by setting the
`layout` [Front Matter](https://jekyllrb.com/docs/frontmatter/) on each page,
like so:
```yaml
---
@ -241,7 +287,9 @@ layout: name
### `layout: default`
This layout handles all of the basic page scaffolding placing the page content between the masthead and footer elements. All other layouts inherit this one and provide additional styling and features inside of the `{{ content }}` block.
This layout handles all of the basic page scaffolding placing the page content
between the masthead and footer elements. All other layouts inherit this one
and provide additional styling and features inside of the `{{ content }}` block.
### `layout: post`
@ -279,14 +327,16 @@ comments: false # disable comments on this post
### `layout: page`
Visually this layout looks and acts the same as `layout: post`, with two minor differences.
Visually this layout looks and acts the same as `layout: post`, with two minor
differences.
- Author "by line" and publish date are omitted.
- Disqus comments are omitted.
### `layout: home`
This layout accommodates the same YAML Front Matter as `layout: page`, with the addition of the following:
This layout accommodates the same YAML Front Matter as `layout: page`, with the
addition of the following:
```yaml
paginate: true # enables pagination loop, see section above for additional setup
@ -294,7 +344,8 @@ paginate: true # enables pagination loop, see section above for additional setu
### `layout: about`
This layout accommodates the same YAML Front Matter as `layout: page`, with the addition of the following to display an author picture:
This layout accommodates the same YAML Front Matter as `layout: page`, with the
addition of the following to display an author picture:
```yaml
author:
@ -302,47 +353,67 @@ author:
picture /assets/images/johndoe.png
```
Recommended `picture` size is approximately `300 x 300` pixels. If `author` object is not explicitly set in the about page's YAML Front Matter the theme will default to the value set in `_config.yml`.
Recommended `picture` size is approximately `300 x 300` pixels. If `author`
object is not explicitly set in the about page's YAML Front Matter the theme
will default to the value set in `_config.yml`.
If blank there no image will appear.
### `layout: cv`
This layout accommodates the same YAML Front Matter as `layout: page`. It leverages a [JSON-based file standard](https://jsonresume.org/schema/) for resume data to conveniently render a curriculum vitæ or resume painlessly.
This layout accommodates the same YAML Front Matter as `layout: page`. It
leverages a [JSON-based file standard](https://jsonresume.org/schema/) for
resume data to conveniently render a curriculum vitæ or resume painlessly.
Simply use JSON Resume's [in-browser resume builder](http://registry.jsonresume.org/) to export a JSON file and save to your project as `_data/cv.json`.
Simply use JSON Resume's [in-browser resume builder](http://registry.jsonresume.org/)
to export a JSON file and save to your project as `_data/cv.json`.
## Customization
The default structure, style, and scripts of this theme can be overridden and customized in the following two ways.
The default structure, style, and scripts of this theme can be overridden and
customized in the following two ways.
### Overriding Includes and Layouts
Theme defaults can be [overridden](http://jekyllrb.com/docs/themes/#overriding-theme-defaults) by placing a file with the same name into your project's `_includes` or `_layouts` directory. For instance:
Theme defaults can be [overridden](http://jekyllrb.com/docs/themes/#overriding-theme-defaults)
by placing a file with the same name into your project's `_includes` or
`_layouts` directory. For instance:
- To specify a custom style path or meta data to the [`_includes/head.html `](_includes/head.html) file, create an `_includes` directory in your project, copy `_includes/head.html` from Basically
Basic's gem folder to `<your_project>/_includes` and start editing that file.
- To specify a custom style path or meta data to the [`_includes/head.html `](_includes/head.html)
file, create an `_includes` directory in your project, copy
`_includes/head.html` from Basically Basic's gem folder to
`<your_project>/_includes` and start editing that file.
**ProTip:** to locate the theme's files on your computer run `bundle show jekyll-theme-basically-basic`. This returns the location of the gem-based theme files.
**ProTip:** to locate the theme's files on your computer run
`bundle show jekyll-theme-basically-basic`. This returns the location of the
gem-based theme files.
### Customizing Sass (SCSS)
To override the default [Sass](http://sass-lang.com/guide) (located in theme's `_sass` directory), do one of the following:
To override the default [Sass](http://sass-lang.com/guide) (located in theme's
`_sass` directory), do one of the following:
1. Copy directly from the Basically Basic gem
- Go to your local Basically Basic gem installation directory (run `bundle show jekyll-theme-basically-basic` to get the path to it).
- Copy the contents of `/assets/stylesheets/main.scss` from there to `<your_project>`.
- Go to your local Basically Basic gem installation directory (run
`bundle show jekyll-theme-basically-basic` to get the path to it).
- Copy the contents of `/assets/stylesheets/main.scss` from there to
`<your_project>`.
- Customize want you want inside `<your_project>/assets/stylesheets/main.scss`.
2. Copy from this repo.
- Copy the contents of [assets/stylesheets/main.scss](assets/stylesheets/main.scss) to `<your_project>`.
- Copy the contents of [assets/stylesheets/main.scss](assets/stylesheets/main.scss)
to `<your_project>`.
- Customize want you want inside `<your_project/assets/stylesheets/main.scss`.
**Note:** To make more extensive changes and customize the Sass partials bundled in the gem. You will need to copy the complete contents the `_sass` directory to `<your_project>` due to the way Jekyll currently reads those files.
**Note:** To make more extensive changes and customize the Sass partials bundled
in the gem. You will need to copy the complete contents the `_sass` directory to
`<your_project>` due to the way Jekyll currently reads those files.
To make basic tweaks to theme's style Sass variables can be overridden by adding to `<your_project>/assets/stylesheets/main.scss`. For instance, to change the accent color used throughout the theme add:
To make basic tweaks to theme's style Sass variables can be overridden by adding
to `<your_project>/assets/stylesheets/main.scss`. For instance, to change the
accent color used throughout the theme add:
```scss
$accent-color: red;
@ -356,20 +427,27 @@ To override the default JavaScript bundled in the theme, do one of the following
1. Copy directly from the Basically Basic gem
- Go to your local Basically Basic gem installation directory (run `bundle show jekyll-theme-basically-basic` to get the path to it).
- Copy the contents of `/assets/javascripts/main.js` from there to `<your_project>`.
- Go to your local Basically Basic gem installation directory (run
`bundle show jekyll-theme-basically-basic` to get the path to it).
- Copy the contents of `/assets/javascripts/main.js` from there to
`<your_project>`.
- Customize what you want inside `<your_project>/assets/javascripts/main.js`.
2. Copy from this repo.
- Copy the contents of [assets/javascripts/main.js](assets/javascripts/main.js) to `<your_project>`.
- Copy the contents of [assets/javascripts/main.js](assets/javascripts/main.js)
to `<your_project>`.
- Customize what you want inside `<your_project>/assets/javascripts/main.js`.
### SVG Icons
The theme uses social network logos and other iconography saved as SVGs for performance and flexibility. Said SVGs are located in the `_includes` directory and prefixed with `icon-`. Each icon has been sized and designed to fit a `16 x 16` viewbox and optimized with [SVGO](https://github.com/svg/svgo).
The theme uses social network logos and other iconography saved as SVGs for
performance and flexibility. Said SVGs are located in the `_includes` directory
and prefixed with `icon-`. Each icon has been sized and designed to fit a
`16 x 16` viewbox and optimized with [SVGO](https://github.com/svg/svgo).
Fill colors are defined in the `_sass/basically-basic/_icons.scss` partial and set with `.icon-name` where class name matches the corresponding icon.
Fill colors are defined in the `_sass/basically-basic/_icons.scss` partial and
set with `.icon-name` where class name matches the corresponding icon.
For example the Twitter icon is given a fill color of `#1da1f2` like so:
@ -377,7 +455,8 @@ For example the Twitter icon is given a fill color of `#1da1f2` like so:
<span class="icon icon--twitter">{% include icon-twitter.svg %}</span>
```
Alongside the SVG assets, there are icon helper includes to aid in generating social network links.
Alongside the SVG assets, there are icon helper includes to aid in generating
social network links.
| Include Parameter | Description | Required |
| ----------------- | ---------------------------------| ----------------------- |
@ -413,9 +492,12 @@ To set up your environment to develop this theme:
To test the theme the locally as you make changes to it:
1. `cd` into the root folder of the repo (e.g. `jekyll-theme-basically-basic`).
2. Run `bundle exec rake preview` and open your browser to `http://localhost:4000/example/`.
2. Run `bundle exec rake preview` and open your browser to
`http://localhost:4000/example/`.
This starts a Jekyll server using the theme's files and contents of the `example/` directory. As modifications are made, refresh your browser to see any changes.
This starts a Jekyll server using the theme's files and contents of the
`example/` directory. As modifications are made, refresh your browser to see
any changes.
## Contributing
@ -434,7 +516,7 @@ pull request, it may be helpful to read up on the [GitHub Flow][github-flow].
When submitting a pull request:
1. Clone the repo.
2. Create a branch off of `develop` and give it a meaningful name (e.g.
2. Create a branch off of `master` and give it a meaningful name (e.g.
`my-awesome-new-feature`) and describe the feature or fix.
3. Open a pull request on GitHub.