About
whiteglass is a minimal, responsive Jekyll theme for hackers.
Installation
Add this link to your Jekyll site’s Gemfile:
gem "jekyll-whiteglass"
And add this line to your Jekyll site’s _config.yml:
theme: jekyll-whiteglass
And then execute:
bundle
Or install it yourself as:
gem install jekyll-whiteglass
Usage
Customization
To override the default structure and style of whiteglass, simply create the
concerned directory at the root of your site, copy the file you wish to
customize to that directory, and then edit the file. e.g., to override the
_includes/head_custom.html file to specify a
custom style path, create an _includes directory, copy
_includes/head_custom.html from jekyll-whiteglass gem folder to
<your-site>/_includes and start editing that file.
The site’s default CSS is in the gem itself,
assets/main.scss. To override the default CSS, the file
has to exist at your site source. Do either of the following:
- Create a new instance of
main.scssat site source- Create a new file
main.scssat<your-site>/assets/ - Add the frontmatter dashes, and
- Add
@import "whiteglass";, to<your-site>/assets/main.scss - Add your custom CSS
- Create a new file
- Download the file from this repo
- Create a new file
main.scssat<your-site>/assets/ - Copy the contents at
assets/main.scssonto themain.scssyou just created, and edit away
- Create a new file
- Copy directly from jekyll-whiteglass gem
- Go to your local jekyll-whiteglass gem installation directory (run
bundle show jekyll-whiteglassto get the path to it) - Copy the
assets/folder from there into the root of<your-site> - Change whatever values you want, inside
<your-site>/assets/main.scss
- Go to your local jekyll-whiteglass gem installation directory (run
Locale
site.lang is used to declare the primary language for each web page within the
site.
lang: en-US sets the lang attribute for the site to the United States flavor
of English, while en-GB would be for the United Kingdom style of English.
Country codes are optional and the shorter variation lang: en is also
acceptable. You may want to write a post in different language, then add lang
attribute to the frontmatter of that post:
layout: post
title: "안녕하세요"
lang: ko
Description
site.description describes the site. This is mainly used in meta descriptions
for improving SEO. Also, you can set description attribute for each post:
layout: post
title: Awesome Post
description: This is an awesome post.
Category
Each post can have categories attribute. It can be a string or an array. This
will be displayed on index, archive and each post, and provide a link to the
archive of category.
layout: post
title: Awesome Post
categories: Misc
layout: post
title: Another Awesome Post
categories:
- Misc
- Idea
Metadata for SEO
Keywords
Each post can have keywords attribute. This is a comma-separated list which is
used in meta descriptions for improving SEO.
layout: post
title: How to configure jekyll-whiteglass
keywords: jekyll, whiteglass, github pages
site.twitter_usernamesetstwitter:siteandtwitter:creatormeta tagsite.twitter_imagesetstwitter:image:srcmeta tagpage.twitter_card.typesetstwitter:cardmeta tag (default:summary)- If
page.twitter_card.typeisgallery, it setstwitter:image0,twitter:image1,twitter:image2andtwitter:image3meta tags withpage.twitter_card.image,page.twitter_card.image1,page.twitter_card.image2andpage.twitter_card.image3, respectively - If
page.twitter_card.typeisphoto,page.twitter_card.widthsetstwitter:image:widthmeta tag andpage.twitter_card.heightsetstwitter:image:heightmeta tag
- If
page.twitter_card.creatorsetstwitter:creatormeta tag. It overridessite.twitter_usernamepage.twitter_card.imagesetstwitter:image:srcmeta tag ifpage.twitter_card.typeis notgallery. It overridessite.twitter_image
site.facebook_app_idsetsfb:adminsmeta tagsite.facebook_pagesetsarticle:authormeta tagsite.facebook_imagesetsog:imagemeta tagpage.facebook.imagesetsog:imagemeta tag. It overridessite.facebook_image
Navigation
To define header links, add titles and URLs under the main key in
_data/navigation.yml:
main:
- title: "About"
url: /about/
- title: "Archives"
url: /archives/
- title: "GitHub"
url: https://github.com/yous/whiteglass
Enabling Google Analytics
To enable Google Analytics, add the following lines to your Jekyll site:
google_analytics: UA-NNNNNNNN-N