Hyde Press

Simple • Static • Blog-aware

Jekyll Themes 'n' Templates (Book Edition)

by Mark Otto, Michael Rose, Tim O'Brien, Elle Kasai, Gerald Bauer, et al

Contents

Preface

Note: The book edition is still an early release and a work-in-progess.

This is the themes documentation (mostly READMEs) for the Jekyll static site builder / generator reformatted in a single-page book edition.

See the source repo for how the book gets auto-built with "plain" Jekyll - of course - and hosted on GitHub Pages.

Onwards.

Acknowledgments

Thanks to all Jekyll theme authors and contributors for making it all possible.

Part 1 - Starter Sites (w/ Pages)

Chapter 1.1 - Henry's Starter Theme

A minimalistic Jekyll starter theme for “classic” web sites (e.g. just some web pages)

├── _config.yml                  # site configuration
├── _layouts
|   └── default.html             # master layout template
├── css
|   └── style.css                # styles
├── three.html                   # another sample page (in hypertext markup e.g. html)
├── two.md                       # another sample page (in markdown e.g. md)
└── index.md                     # index (start) sample page (in markdown e.g. md)

Becomes

└── _site                        # output build folder; site gets generated here
    ├── css
    |   └── style.css            # styles for pages (copied 1:1 as is)
    ├── three.html               # another sample page
    ├── two.html                 # another sample page 
    └── index.html               # index (start) sample page

Live Demo

See a live demo @ henrythemes.github.io/jekyll-starter-theme »

Version 2.0

Note: For a more “advanced” starter theme, see the Jekyll Starter Theme V2. The V2 includes:

Chapter 1.2 - Henry's Starter Theme V2

A more “advanced” starter theme, see the Jekyll Starter Theme V1 for a more “basic” version. The V2 includes:

├── _config.yml                  # site configuration
├── _includes                    # shared (common) building blocks
|   ├── head.html                #   page head e.g. meta, stylesheet, etc.
|   ├── header.html              #   header e.g. title, nav menu, etc.
|   └── footer.html              #   footer
├── _layouts
|   └── default.html             # master layout template
├── css
|   ├── _settings.scss           #   style settings/variables e.g. $link-color, etc.
|   └── style.scss               # styles in sass/scss
├── three.html                   # another sample page (in hypertext markup e.g. html)
├── two.md                       # another sample page (in markdown e.g. md)
└── index.md                     # index (start) sample page (in markdown e.g. md)

Becomes

└── _site                        # output build folder; site gets generated here
    ├── css
    |   └── style.css            # styles for pages (preprocessed with sass/scsss)
    ├── three.html               # another sample page
    ├── two.html                 # another sample page 
    └── index.html               # index (start) sample page

CSS Preprocessing using Sass/SCSS

Step 1: Configure the CSS Preprocessing using Sass/SCSS. Add in _config.yml:

sass:
  sass_dir: css
  style:    expanded

Step 2: Add a new css/_settings.scss partial (where you can add your global style settings) e. g.:


$font-family:  Helvetica,Arial,sans-serif;

$link-color:   navy;

Step 3: Add the required front matter to css/style.scss and include (import) the settings e.g.:

---
###  turn on preprocessing by starting with required front matter block
---

@import 'settings';

body {
  font-family:     $font-family;
}

a, a:visited {
  color:           $link-color;
  text-decoration: none;
}

...

Shared (Common) Page/Template Building Blocks Using _includes

Use shared building blocks to split-up the all-in-one default master layout page e.g.:


<!DOCTYPE html>
<html>

{% include head.html %}

<body>

{% include header.html %}

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

{% include footer.html %}

</body>
</html>

In the new _includes folder, add the new building blocks e.g. head.html, header.html, and footer.html.

Instead of “hard-coding” the navigation menu e.g.:


<div id="nav">
  <a href="{{ site.path }}/index.html">Welcome</a>
  <a href="{{ site.path }}/two.html">Page Two</a>
  <a href="{{ site.path }}/three.html">Page Three</a>
  <a href="http://groups.google.com/group/wwwmake">Questions? Comments?</a>
  <a href="https://github.com/henrythemes/jekyll-starter-theme">About</a>
</div>

Let’s use a configuration / data block e.g.:

nav:
- { title: 'Welcome',              href: '/jekyll-starter-theme-v2/' }
- { title: 'Page Two',             href: '/jekyll-starter-theme-v2/two.html' }
- { title: 'Page Three',           href: '/jekyll-starter-theme-v2/three.html' }
- { title: 'Questions? Comments?', href: 'http://groups.google.com/group/wwwmake' }
- { title: 'About',                href: 'https://github.com/henrythemes/jekyll-starter-theme-v2' }

And (auto-)build the navigation menu using a macro e.g.:


<div id="nav">
{% for item in site.nav %}
  <a href="{{ item.href}}">{{ item.title }}</a>
{% endfor %}
</div>

Live Demo

See a live demo @ henrythemes.github.io/jekyll-starter-theme-v2 »

Chapter 1.3 - Henry's Bootstrap Theme

Jekyll theme w/ Bootstrap; see a live demo @ henrythemes.github.io/jekyll-bootstrap-theme »

Note: The theme uses the bootstrap sass/scss (source) version letting you change (override) all bootstrap css variables.

Example:

to be done

Note: GitHub Pages has built-in support for sass/scss, thus, your static site will result in a single all-in-one-file stylesheet, that is, style.css.

Build & Update Notes

to be continued

Part 2 - Blogs (w/ Posts, Feeds, Archives, etc.)

Chapter 2.1 - Henry's Minimial Theme

What’s jekyll-minimal-theme?

It’s another minimal(istic) Jekyll static site generator theme, that is, a ready-to-fork template pack.

See a live demo @ henrythemes.github.io/jekyll-minimal-theme »

For example:

├── _config.yml                               # site configuration
├── _posts                                    # sample blog posts
|   ├── 2014-05-05-sportdb-update-v192.md     #   filename format:
|   ├── 2014-10-10-new-repo-baviria-bayern.md #    => YEAR-MONTH-DAY-TITLE.MARKUP
|   ├── 2014-10-21-sql-views.md
|   ├── 2014-11-11-new-reop-maps.md
|   └── 2014-12-15-quick-starter-datafiles.md
├── _layouts                           
|   ├── default.html                   # master layout template
|   └── post.html                      # single blog post template
├── css                               
|   ├── _settings.scss                 # style settings (e.g. variables)
|   └── style.scss                     # master style page
├── feed.xml                           # web feed template (e.g. in atom format)
├── archive.html                       # archive template
└── index.html                         # index template

will result in (with permalink: /:title.html):

└── _site                                # output build folder; site gets generated here
    ├── css
    |   └── style.css                    # styles for pages (copied 1:1 as is)
    ├── sportdb-update-v192.html         # blog post page
    ├── new-repo-baviria-bayern.html     # another blog post page
    ├── sql-views.html                   #  ""
    ├── new-repo-maps.html               #  ""
    ├── quick-starter-datafiles.html     #  ""
    ├── feed.xml                         # web feed (e.g. in atom format)
    ├── archive.html                     # archive page
    └── index.html                       # index page

Usage

To use - delete all sample posts in the _posts folder and change the settings in _config.yml to use your own site.title and site.url:

title:   'Jekyll Minimal Theme'
url:     'http://henrythemes.github.io/jekyll-minimal-theme'
author:
  name:  'Jekyll Minimal Theme Team'

Color n Typography Settings (in css/_settings.scss)

Typography (Fonts):

$font-family:       "Helvetica Neue", Helvetica, Arial, sans-serif;

$code-font-family:  Menlo, Monaco, "Courier New", monospace;

Colors:

$masthead-color:         #505050;
$masthead-small-color:   #C0C0C0;

$post-title-color:       #303030;
$post-date-color:        #9a9a9a;


$body-color:            #515151;
$body-background-color: #fff;

$link-color:            #268bd2;

$headings-color:        #313131;    // h1,h2,h3,h4,h5,h6

$strong-color:          #303030;    // strong

$pre-background-color:  #f9f9f9;    // pre

$blockquote-color:        #7a7a7a;  // blockquote
$blockquote-border-color: #e5e5e5;

$table-border-color:         #e5e5e5;
$table-odd-background-color: #f9f9f9;

A big thanks to the Poole theme; the jekyll-minimal-theme started out w/ the typography and color settings from the Poole theme.

Chapter 2.2 - Poole Theme (by Mark Otto)

The Strange Case of Dr. Jekyll and Mr. Hyde tells the story of a lawyer investigating the connection of two persons, Dr. Henry Jekyll and Mr. Edward Hyde. Chief among the novel’s supporting cast is a man by the name of Mr. Poole, Dr. Jekyll’s loyal butler.


Poole is the butler for Jekyll, the static site generator. It’s designed and developed by @mdo to provide a clear and concise foundational setup for any Jekyll site. It does so by furnishing a full vanilla Jekyll install with example templates, pages, posts, and styles.

Poole

See Poole in action with the demo site.

There are currently two official themes built on Poole:

Individual theme feedback and bug reports should be submitted to the theme’s individual repository.

Usage

1. Install dependencies

Poole is built on Jekyll and uses its built-in SCSS compiler to generate our CSS. Before getting started, you’ll need to install the Jekyll gem:

$ gem install jekyll

Windows users: Windows users have a bit more work to do, but luckily @juthilo has your back with his Run Jekyll on Windows guide.

Need syntax highlighting? Poole includes support for Pygments or Rouge, so install your gem of choice to make use of the built-in styling. Read more about this in the Jekyll docs.

2a. Quick start

To help anyone with any level of familiarity with Jekyll quickly get started, Poole includes everything you need for a basic Jekyll site. To that end, just download Poole and start up Jekyll.

2b. Roll your own Jekyll site

Folks wishing to use Jekyll’s templates and styles can do so with a little bit of manual labor. Download Poole and then copy what you need (likely _layouts/, *.html files, atom.xml for RSS, and public/ for CSS, JS, etc.).

3. Running locally

To see your Jekyll site with Poole applied, start a Jekyll server. In Terminal, from /poole (or whatever your Jekyll site’s root directory is named):

$ jekyll serve

Open http://localhost:4000 in your browser, and voilà.

4. Serving it up

If you host your code on GitHub, you can use GitHub Pages to host your project.

  1. Fork this repo and switch to the gh-pages branch.
  2. If you’re using a custom domain name, modify the CNAME file to point to your new domain.
  3. If you’re not using a custom domain name, modify the baseurl in _config.yml to point to your GitHub Pages URL. Example: for a repo at github.com/username/poole, use http://username.github.io/poole/. Be sure to include the trailing slash.
  4. Done! Head to your GitHub Pages URL or custom domain.

No matter your production or hosting setup, be sure to verify the baseurl option file and CNAME settings. Not applying this correctly can mean broken styles on your site.

Options

Poole includes some customizable options, typically applied via classes on the <body> element.

Rems, font-size, and scaling

Poole is built almost entirely with rems (instead of pixels). rems are like ems, but instead of building on the immediate parent’s font-size, they build on the root element, <html>.

By default, we use the following:

html {
  font-size: 16px;
  line-height: 1.5;
}
@media (min-width: 38em) {
  html {
    font-size: 20px;
  }
}

To easily scale your site’s typography and components, simply customize the base font-sizes here.

Author

Mark Otto - https://github.com/mdo - https://twitter.com/mdo

Chapter 2.3 - Poole's Hyde Theme (by Mark Otto)

Hyde is a brazen two-column Jekyll theme that pairs a prominent sidebar with uncomplicated content. It’s based on Poole, the Jekyll butler.

Hyde screenshot

Usage

Hyde is a theme built on top of Poole, which provides a fully furnished Jekyll setup—just download and start the Jekyll server. See the Poole usage guidelines for how to install and use Jekyll.

Options

Hyde includes some customizable options, typically applied via classes on the <body> element.

Create a list of nav links in the sidebar by assigning each Jekyll page the correct layout in the page’s front-matter.

---
layout: page
title: About
---

Why require a specific layout? Jekyll will return all pages, including the atom.xml, and with an alphabetical sort order. To ensure the first link is Home, we exclude the index.html page from this list by specifying the page layout.

By default Hyde ships with a sidebar that affixes it’s content to the bottom of the sidebar. You can optionally disable this by removing the .sidebar-sticky class from the sidebar’s .container. Sidebar content will then normally flow from top to bottom.

<!-- Default sidebar -->
<div class="sidebar">
  <div class="container sidebar-sticky">
    ...
  </div>
</div>

<!-- Modified sidebar -->
<div class="sidebar">
  <div class="container">
    ...
  </div>
</div>

Themes

Hyde ships with eight optional themes based on the base16 color scheme. Apply a theme to change the color scheme (mostly applies to sidebar and links).

Hyde in red

There are eight themes available at this time.

Hyde theme classes

To use a theme, add anyone of the available theme classes to the <body> element in the default.html layout, like so:

<body class="theme-base-08">
  ...
</body>

To create your own theme, look to the Themes section of included CSS file. Copy any existing theme (they’re only a few lines of CSS), rename it, and change the provided colors.

Reverse layout

Hyde with reverse layout

Hyde’s page orientation can be reversed with a single class.

<body class="layout-reverse">
  ...
</body>

Author

Mark Otto - https://github.com/mdo - https://twitter.com/mdo

Chapter 2.4 - Poole's Lanyon Theme (by Mark Otto)

Lanyon is an unassuming Jekyll theme that places content first by tucking away navigation in a hidden drawer. It’s based on Poole, the Jekyll butler.

Lanyon Lanyon with open sidebar

Usage

Lanyon is a theme built on top of Poole, which provides a fully furnished Jekyll setup—just download and start the Jekyll server. See the Poole usage guidelines for how to install and use Jekyll.

Options

Lanyon includes some customizable options, typically applied via classes on the <body> element.

Create a list of nav links in the sidebar by assigning each Jekyll page the correct layout in the page’s front-matter.

---
layout: page
title: About
---

Why require a specific layout? Jekyll will return all pages, including the atom.xml, and with an alphabetical sort order. To ensure the first link is Home, we exclude the index.html page from this list by specifying the page layout.

Themes

Lanyon ships with eight optional themes based on the base16 color scheme. Apply a theme to change the color scheme (mostly applies to sidebar and links).

Lanyon with red theme Lanyon with red theme and open sidebar

There are eight themes available at this time.

Available theme classes

To use a theme, add any one of the available theme classes to the <body> element in the default.html layout, like so:

<body class="theme-base-08">
  ...
</body>

To create your own theme, look to the Themes section of included CSS file. Copy any existing theme (they’re only a few lines of CSS), rename it, and change the provided colors.

Reverse layout

Lanyon with reverse layout Lanyon with reverse layout and open sidebar

Reverse the page orientation with a single class.

<body class="layout-reverse">
  ...
</body>

Make the sidebar overlap the viewport content with a single class:

<body class="sidebar-overlay">
  ...
</body>

This will keep the content stationary and slide in the sidebar over the side content. It also adds a box-shadow based outline to the toggle for contrast against backgrounds, as well as a box-shadow on the sidebar for depth.

It’s also available for a reversed layout when you add both classes:

<body class="layout-reverse sidebar-overlay">
  ...
</body>

Show an open sidebar on page load by modifying the <input> tag within the sidebar.html layout to add the checked boolean attribute:

<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox" checked>

Using Liquid you can also conditionally show the sidebar open on a per-page basis. For example, here’s how you could have it open on the homepage only:

<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox" {% if page.title =="Home" %}checked{% endif %}>

Author

Mark Otto - https://github.com/mdo - https://twitter.com/mdo

Chapter 2.5 - So Simple Theme (by Michael Rose)

Looking for a simple, responsive, theme for your Jekyll powered blog? Well look no further. Here be So Simple Theme, the followup to Minimal Mistakes – by designer slash illustrator Michael Rose.

Notable features:

screenshot of So Simple Theme

See a live version of So Simple hosted on GitHub.


Getting Started

So Simple takes advantage of Sass and data files to make customizing easier. These features require Jekyll 2.x and will not work with older versions of Jekyll.

General notes and suggestions for customizing So Simple Theme.

Installation

So Simple now requires Jekyll 3.0. Make sure to run bundle update if you aren’t on the latest version to update all gem dependencies.

If you are creating a new Jekyll site using So Simple follow these steps:

  1. Fork the So Simple repo.
  2. Clone the repo you just forked and rename it.
  3. Install Bundler gem install bundler and Run bundle install to install all dependencies (Jekyll, Jekyll-Sitemap, Octopress, etc)
  4. Update _config.yml, add navigation, and replace demo posts and pages with your own. Full details below.

If you want to use So Simple with an existing Jekyll site follow these steps:

  1. Download So Simple and unzip.
  2. Rename so-simple-theme-master to something meaningful ie: new-site
  3. Run bundle install to install all dependencies (Jekyll, Jekyll-Sitemap, Octopress, etc)
  4. Remove demo posts/pages and replace with your own posts, pages, and any other content you want to move over.
  5. Update posts’ and pages’ YAML to match variables used by So Simple. Full details below.
  6. Update _config.yml and add navigation links and additional author data if applicable. Full details below.

Pro-tip: Delete the gh-pages branch after cloning and start fresh by branching off master. There is a bunch of garbage in gh-pages used for the theme’s demo site that I’m guessing you won’t want.


Running Jekyll

The preferred method for running Jekyll is with bundle exec, but if you’re willing to deal gem conflicts feel free to go cowboy with a jekyll build or jekyll serve.

In some cases, running executables without bundle exec may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle.

However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine.

bundle exec jekyll build

bundle exec jekyll serve

Scaffolding

How So Simple is organized and what the various files are. All posts, layouts, includes, stylesheets, assets, and whatever else is grouped nicely under the root folder. The compiled Jekyll site outputs to _site/.

so-simple-theme/
├── _includes/
|    ├── browser-upgrade.html   # prompt to install a modern browser for < IE9
|    ├── disqus-comments.html   # Disqus comments script
|    ├── feed-footer.html       # post footers in feed
|    ├── footer.html            # site footer
|    ├── head.html              # site head
|    ├── navigation.html        # site top navigation
|    ├── open-graph.html        # meta data for Open Graph and Twitter cards
|    └── scripts.html           # site scripts
├── _layouts/
|    ├── page.html               # single column page layout
|    └── post.html               # main content with sidebar for author/post details
├── _posts/                      # MarkDown formatted posts
├── _sass/                       # Sass stylesheets
├── _templates/                  # used by Octopress to define YAML variables for new posts/pages
├── about/                       # sample about page
├── articles/                    # sample articles category page
├── assets/
|    ├── css/                    # compiled stylesheets
|    ├── fonts/                  # webfonts
|    └── js/
|        ├── _main.js            # main JavaScript file, plugin settings, etc
|        ├── plugins/            # scripts and jQuery plugins to combine with _main.js
|        ├── scripts.min.js      # concatenated and minified _main.js + plugin scripts
|        └── vendor/             # vendor scripts to leave alone and load as is
├── blog/                        # sample blog category page
├── images/                      # images for posts and pages
├── 404.md                       # 404 page
├── feed.xml                     # Atom feed template
├── index.md                     # sample homepage. lists 5 latest posts 
└── theme-setup/                 # theme setup page. safe to remove

Site Setup

A quick checklist of the files you’ll want to edit to get up and running.

Site Wide Configuration

_config.yml is your friend. Open it up and personalize it. Most variables are self explanatory but here’s an explanation of each if needed:

title

The title of your site… shocker!

Example title: My Awesome Site

Your site’s logo, appears in the header below the navigation bar and is used as a default image for Twitter Cards when a feature is not defined. Place in the images folder.

url

Used to generate absolute URLs for sitemaps, feeds and for generating canonical URLs in a page’s <head>. When developing locally either comment this out or use something like http://localhost:4000 so all assets load properly. Don’t include a trailing /. Protocol-relative URLs are a nice option but there are a few caveats1.

Examples:

url: http://mmistakes.github.io/so-simple-theme
url: http://localhost:4000
url: http://mademistakes.com
url: //mademistakes.com
url: 

Google Analytics and Webmaster Tools

Google Analytics UA and Webmaster Tool verification tags can be entered under owner in _config.yml. For more information on obtaining these meta tags check Google Webmaster Tools and Bing Webmaster Tools support.

To set what links appear in the top navigation edit _data/navigation.yml. Use the following format to set the URL and title for as many links as you’d like. External links will open in a new window.

- title: Portfolio
  url: /portfolio/

- title: Made Mistakes
  url: http://mademistakes.com  

Adding New Content with Octopress

While completely optional, I’ve included Octopress and some starter templates to automate the creation of new posts and pages. To take advantage of it start by installing the Octopress gem if it isn’t already.

$ gem install octopress

New Post

Default command for creating a new post.

$ octopress new post "Post Title"

Default works great if you want all your posts in one directory, but if you’re like me and want to group them into subfolders like /posts, /portfolio, etc. Then this is the command for you. By specifying the DIR it will create a new post in that folder and populate the categories: YAML with the same value.

$ octopress new post "New Article Title" --dir articles

New Page

To create a new page use the following command.

$ octopress new page new-page/

This will create a page at /new-page/index.md


Layouts and Content

Explanations of the various _layouts included with the theme and when to use them.

Post and Page

These two layouts are very similar. Both have an author sidebar, allow for large feature images at the top, and optional Disqus comments. The only real difference is the post layout includes related posts at the end of the page.

Categories

In the sample posts folder you may have noticed categories: articles in the YAML front matter. Categories can be used to group posts into sub-folders. If you decide to rename or add categories you will need to create new category index pages.

For example. Say you want to group all your posts under blog/ instead of articles/. In your post add categories: blog to the YAML front matter, rename or duplicate articles/index.md to blog/index.md and update the for loop to limit posts to just the blog category.

{% for post in site.categories.blog %}

If done correctly /blog/ should be a page index of only posts with a category of blog.

Feature Images

A good rule of thumb is to keep feature images nice and wide so you don’t push the body text too far down. An image cropped around around 1024 x 256 pixels will keep file size down with an acceptable resolution for most devices. If you want to serve these images responsively I’d suggest looking at the Jekyll Picture Tag plugin2.

The post and page layouts make the assumption that the feature images live in the images/ folder. To add a feature image to a post or page just include the filename in the front matter like so.

image:
  feature: feature-image-filename.jpg
  thumb: thumbnail-image.jpg #keep it square 200x200 px is good

To add attribution to a feature image use the following YAML front matter on posts or pages. Image credits appear directly below the feature image with a link back to the original source if supplied.

image:
  feature: feature-image-filename.jpg
  credit: Michael Rose #name of the person or site you want to credit
  creditlink: http://mademistakes.com #url to their site or licensing

Videos

Video embeds are responsive and scale with the width of the main content block with the help of FitVids.

Not sure if this only effects Kramdown or if it’s an issue with Markdown in general. But adding YouTube video embeds causes errors when building your Jekyll site. To fix add a space between the <iframe> tags and remove allowfullscreen. Example below:

<iframe width="560" height="315" src="http://www.youtube.com/embed/PWf4WUoMXwg" frameborder="0"> </iframe>

Link Post Type

So Simple Theme supports link posts, made famous by John Gruber. To activate just add link: http://url-you-want-linked to the post’s YAML front matter and you’re done. Here’s an example of a link post if you need a visual.

Author Override

By making use of data files you can assign different authors for each post.

Start by modifying authors.yml file in the _data folder and add your authors using the following format.

# Authors

billy_rick:
  name: Billy Rick
  web: http://thewhip.com
  email: billy@rick.com
  bio: "What do you want, jewels? I am a very extravagant man."
  avatar: bio-photo-2.jpg
  twitter: extravagantman
  google:
    plus: +BillyRick

cornelius_fiddlebone:
  name: Cornelius Fiddlebone
  email: cornelius@thewhip.com
  bio: "I ordered what?"
  avatar: bio-photo.jpg
  twitter: rhymeswithsackit
  google:
    plus: +CorneliusFiddlebone

To assign Billy Rick as an author for our post. We’d add the following YAML front matter to a post:

author: billy_rick

To add Facebook, Twitter, and Google+ share links to a post add the following YAML front matter.

share: true

Share links appear below author details in the sidebar.


Disqus Comments

To enable comments signup for a Disqus account and create a shortname for your site. Then add it to your _config.yml under the site owner section like so:

site:
  owner:
    disqus-shortname: shortname

If you would like comments to appear on every post or page that uses the post.html layout simply add the following line to your _config.yml and you’re done.

comments: true

To be more selective and granualar with which posts and pages Disqus comments appear on, add comments: true to the YAML Front Matter of each post or page instead.


Twitter Cards

Feature and thumbnail images are used by Open Graph and Twitter Cards as well. If you don’t assign a thumbnail the site logo is used.

Here’s an example of a tweet with Twitter Cards enabled.

Twitter Card summary large image screenshot

Pro-Tip: You need to apply for Twitter Cards before they will begin showing up when links to your site are shared.


This is a very basic attempt at indexing a Jekyll site and returning search results with JSON — Google quality results this is not.

To exclude posts/pages from search results add search_omit: true to their YAML Front Matter.


Further Customization

Jekyll 2.x added support for Sass files making it much easier to modify a theme’s fonts and colors. By editing values found in _sass/_variables.scss you can fine tune the site’s colors and typography.

For example if you wanted a red background instead of white you’d change $body-color: #ebebeb; to $body-color: $cc0033;.

To modify the site’s JavaScript files I setup a Grunt build script to lint/concatenate/minify all scripts into scripts.min.js. Install Node.js, then install Grunt, and then finally install the dependencies for the theme contained in package.json:

npm install

From the theme’s root, run grunt to concatenate JavaScript files, and optimize all .jpg, .png, and .svg files in the images/ folder. You can also use grunt dev in combination with jekyll build --watch to watch for updates JS files that Grunt will then automatically re-build as you write your code which will in turn auto-generate your Jekyll site when developing locally.

  1. If you decide to use a protocol-relative URL know that it will most likely break sitemap.xml that the Jekyll-Sitemap gem creates. If a valid sitemap matters to you I’d suggest creating your own sitemap.xml and apply some Liquid logic to prepend links to posts/pages with https:.

  2. If you’re using GitHub Pages to host your site be aware that plugins are disabled. You’ll need to build your site locally and then manually deploy if you want to use this sweet plugin.

Part 3 - Single-Page Sites

Chapter 3.1 - Single Paged Theme (by Tim O'Brien)

Fancy jekyll powered single page site

Here’re some examples:

Why?

Got some killer app, some neat project, a cool portfolio? Make an easy single-page site to show it all off. SinglePaged uses jekyll niceties to make a polished, modular, and beautiful single page site.

Sound good? Let’s go!

There are three way to get started: (links jump to that section)

  1. Make a user homepage (or organization)
  2. Make a standalone project page
  3. Make a site under an existing project

Setup as user homepage

Now hop over to Usage to get it running with your own stuff!

When you publish changes use git push -u origin master


Setup as standalone project page

Now hop over to Usage to get it running with your own stuff!

When you publish changes use git push -u origin gh-pages


Setup inside existing project

This is the most complicated use-case .. but it’s the coolest. Say you’ve got your kickass project github.com/t413/kicker and want to have some web presence to post about on hacker news. This will create an orphan branch called gh_pages in your repository where you can publish changes, posts, images, and such. It won’t alter your code at all.

Now hop over to Usage to get it running with your own stuff!

When you publish changes use git push -u origin gh-pages

Usage

Alright, you’ve got a clean copy and are ready to push some schmancy pages for the world to ogle at.

  ---
  title: "home"
  bg: white     #defined in _config.yml, can use html color like '#010101'
  color: black  #text color
  style: center
  ---

  # Example headline!
  and so on..
  ---
  title: "Art"
  bg: turquoise  #defined in _config.yml, can use html color like '#0fbfcf'
  color: white   #text color
  fa-icon: paint-brush
  ---

  #### A new section- oh the humanity!

Note: That part fa-icon: paint-brush will use a font-awesome icon of paint-brush. You can use any icon from this font-awesome icon directory.

Changing your colors

Nifty, right!

Part 4 - Books

Chapter 4.1 - Henry's Classics Book Theme

Another Jekyll static site generator theme for classic books (e.g. Strange Case of Dr. Jekyll and Mr Hyde, A Tale of Two Cities, The Trial, etc.) that is, a ready-to-fork template pack.

For example:

├── _config.yml                               # book configuration
├── _chapters                                 # sample chapters
|   ├── 01.md
|   ├── 02.md
|   ├── ...
|   └── 10.md
├── _layouts                           
|   └── default.html                   # master layout template
├── css                               
|   ├── _settings.scss                 # style settings (e.g. variables)
|   └── style.scss                     # master style page
└── index.html                         # all-in-one page book template

will result in an all-in-one book page:

└── _site                                # output build folder; site gets generated here
    ├── css
    |   └── style.css                    # styles for pages (copied 1:1 as is)
    └── index.html                       # all-in-one book page

How-to Build Your Own Book

Step 1: Add your chapters to the _chapters/ folder

Replace all text files in the _chapters folder with your own.

Step 2: Add the book title and author in the _config.yml file

Next change the book title and author in the _config.yml file:

title:  Strange Case of Dr. Jekyll and Mr. Hyde
author:
  name: Robert Louis Stevenson

with your own book title and author name. That’s it. Happy reading.

Live Demo

See a live demo @ henrythemes.github.io/jekyll-book-theme »

Chapter 4.2 - Henry's Gutenberg Book Theme

Another Jekyll static site builder theme using gutenberg - a web typography starter kit - for classic books (e.g. Strange Case of Dr. Jekyll and Mr Hyde, A Tale of Two Cities, The Trial, etc.) that is, a ready-to-fork template pack.

What’s Gutenberg?

Gutenberg is a web typography starter kit by Matej Latin.

Gutenberg is a flexible and simple–to–use web typography starter kit for web designers and developers. It’s a small step towards a better typography on the web. Beautiful typographic styles can be made by setting base type size, line-height (leading) and measure (max-width).

Gutenberg sets the baseline grid to establish a proper vertical rhythm and makes sure all elements fit into it. It sets up the macro typography so you can focus on the micro–typographic details.

Find out more »

Live Demo

See a live demo @ henrythemes.github.io/jekyll-gutenberg-theme »

How-to Build Your Own Book

Step 1: Add your chapters to the _chapters/ folder

Replace all text files in the _chapters folder with your own.

Step 2: Add the book title and author in the _config.yml file

Next change the book title and author in the _config.yml file:

title:  Strange Case of Dr. Jekyll and Mr. Hyde
author:
  name: Robert Louis Stevenson

with your own book title and author name. That’s it. Happy reading.

Part 5 - Miscellaneous

Chapter 5.1 - Resume Cards Theme (by Elle Kasai)

ResumeCards is a Markdown based resume generator. It looks great on mobile/desktop and can be saved as PDF.

Live Demo

View Demo and Documentation

You can save it as PDF too:

Installation

Note: ResumeCards uses Jekyll. Please read Jekyll’s documentation if you get stuck.

Fork this repo, clone it, and then run:

bundle install

…which installs github-pages gem. After that, run the server:

jekyll serve --watch

### Warning

Usage

Editing Your Resume

Edit _posts/card-[1-9].md like this:

---
type: "Work Experience"
heading: "Bizreach"
subheading: "Junior Product Designer"
duration: "October 2013  September 2014 (1 year)"
location: "Tokyo, Japan"
---

Write in markdown here...

If you don’t need some of the metadata, just remove them:

---
type: "Work Experience"
heading: "Bizreach"
---

Other Files to Modify

You should change these files before deploying:

Customize the Theme

To customize the color theme, edit the color section of _data/resume.yml.

Red

Pink

Brown

Blue

Purple

Teal

Green

Author & License

Elle Kasai