19 |
20 |
21 |
--------------------------------------------------------------------------------
/_includes/i18n.html:
--------------------------------------------------------------------------------
1 | {%- capture text -%}
2 | {%- if include.lang and include.lang != empty -%}
3 | {%- assign plang = include.lang -%}
4 | {%- else -%}
5 | {%- assign plang = page.lang | default: site.lang | default: "en" -%}
6 | {%- endif -%}
7 | {%- assign i18n-tag = include.value -%}
8 | {%- assign splang = plang | truncate: 2, "" -%}
9 | {%- if site.data.i18n.[plang].[i18n-tag] -%}
10 | {{ site.data.i18n.[plang].[i18n-tag] }}
11 | {%- elsif site.data.i18n.[splang].[i18n-tag] -%}
12 | {{ site.data.i18n.[splang].[i18n-tag] }}
13 | {%- else -%}
14 | {{ include.default }}
15 | {%- endif -%}
16 | {%- endcapture -%}
17 | {{ text | strip_newlines }}
--------------------------------------------------------------------------------
/_posts/2017-01-01-my-example-post.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | ---
4 |
5 | Eos eu docendi tractatos sapientem, brute option menandri in vix, quando vivendo accommodare te ius. Nec melius fastidii constituam id, viderer theophrastus ad sit, hinc semper periculis cum id. Noluisse postulant assentior est in, no choro sadipscing repudiandae vix. Vis in euismod delenit dignissim. Ex quod nostrum sit, suas decore animal id ius, nobis solet detracto quo te.
6 |
7 | {% comment %}
8 | Might you have an include in your theme? Why not try it here!
9 | {% include my-themes-great-include.html %}
10 | {% endcomment %}
11 |
12 | No laudem altera adolescens has, volumus lucilius eum no. Eam ei nulla audiam efficiantur. Suas affert per no, ei tale nibh sea. Sea ne magna harum, in denique scriptorem sea, cetero alienum tibique ei eos. Labores persequeris referrentur eos ei.
13 |
--------------------------------------------------------------------------------
/_includes/category_links.html:
--------------------------------------------------------------------------------
1 | {% if include.categories != empty %} •
2 | {% for category in include.categories %}
3 | {% assign no_comma = forloop.last %}
4 | {% for archive in site.archives %}
5 | {% if archive.type == "category" and archive.title == category %}
6 | {{ archive.title | escape }}{% unless no_comma %},{% endunless %}
7 | {% endif %}
8 | {% endfor %}
9 | {% endfor %}
10 | {% endif %}
11 |
12 | {% if include.tags != empty %} •
13 | {% for tag in include.tags %}
14 | {% assign no_comma = forloop.last %}
15 | {% for archive in site.archives %}
16 | {% if archive.type == "tag" and archive.title == tag %}
17 | {{ archive.title | escape }}{% unless no_comma %},{% endunless %}
18 | {% endif %}
19 | {% endfor %}
20 | {% endfor %}
21 | {% endif %}
22 |
--------------------------------------------------------------------------------
/_includes/google_analytics.html:
--------------------------------------------------------------------------------
1 | {% if site.google_analytics %}
2 | {% assign prefix = site.google_analytics | slice: 0, 2 %}
3 | {% if prefix == "G-" %}
4 |
5 |
6 |
13 | {% else %}
14 |
15 |
24 | {% endif %}
25 | {% endif %}
26 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017-2019 Chayoung You
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/_posts/2017-01-05-welcome-to-jekyll.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | ---
4 | You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
5 |
6 | To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
7 |
8 | Jekyll also offers powerful support for code snippets:
9 |
10 | {% highlight ruby %}
11 | def print_hi(name)
12 | puts "Hi, #{name}"
13 | end
14 | print_hi('Tom')
15 | #=> prints 'Hi, Tom' to STDOUT.
16 | {% endhighlight %}
17 |
18 | Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
19 |
20 | [jekyll-docs]: http://jekyllrb.com/docs/home
21 | [jekyll-gh]: https://github.com/jekyll/jekyll
22 | [jekyll-talk]: https://talk.jekyllrb.com/
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | cache: bundler
3 | rvm:
4 | - 3.0.2
5 | addons:
6 | apt:
7 | packages:
8 | - openjdk-8-jre
9 | before_install:
10 | - gem update --system
11 | - gem install bundler
12 | - nvm install node
13 | install:
14 | - bundle install --jobs=3 --retry=3
15 | - pip install --user html5validator
16 | - npm install -g pa11y-ci
17 | script:
18 | - bundle exec jekyll clean && bundle exec jekyll build
19 | - html5validator --Werror --also-check-css --also-check-svg --root _site/
20 | - |
21 | (bundle exec jekyll server -d _tmp_site & echo $! >&3) 3>jekyll.pid | grep -q 'Server running' && \
22 | pa11y-ci --sitemap 'http://localhost:4000/whiteglass/sitemap.xml' \
23 | --sitemap-find 'https://yous.github.io/whiteglass' --sitemap-replace 'http://localhost:4000/whiteglass' && \
24 | kill -9 "$(cat jekyll.pid)" && \
25 | rm -f jekyll.pid && \
26 | rm -rf _tmp_site
27 | branches:
28 | only:
29 | - master
30 | deploy:
31 | provider: pages
32 | skip_cleanup: true
33 | github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
34 | keep_history: true
35 | local_dir: _site
36 | target_branch: gh-pages
37 | on:
38 | branch: master
39 |
--------------------------------------------------------------------------------
/_layouts/post.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 |
6 |
7 | {% if page.external-url %}
8 |
45 |
46 |
47 | ```
48 |
49 |
50 | In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
51 |
52 | #### You might want a sub-subheading (h4)
53 |
54 | In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
55 |
56 | In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
57 |
58 | #### But it's probably overkill (h4)
59 |
60 | In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
61 |
62 | ### Oh hai, an unordered list!!
63 |
64 | In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
65 |
66 | - First item, yo
67 | - Second item, dawg
68 | - Third item, what what?!
69 | - Fourth item, fo sheezy my neezy
70 |
71 | ### Oh hai, an ordered list!!
72 |
73 | In arcu magna, aliquet vel pretium et, molestie et arcu. Mauris lobortis nulla et felis ullamcorper bibendum. Phasellus et hendrerit mauris.
74 |
75 | 1. First item, yo
76 | 2. Second item, dawg
77 | 3. Third item, what what?!
78 | 4. Fourth item, fo sheezy my neezy
79 |
80 |
81 |
82 | ## Headings are cool! (h2)
83 |
84 | Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc. Praesent varius interdum vehicula. Aenean risus libero, placerat at vestibulum eget, ultricies eu enim. Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
85 |
86 | Praesent nulla tortor, malesuada adipiscing adipiscing sollicitudin, adipiscing eget est.
87 |
88 | Proin eget nibh a massa vestibulum pretium. Suspendisse eu nisl a ante aliquet bibendum quis a nunc.
89 |
--------------------------------------------------------------------------------
/_layouts/feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | layout: null
3 | ---
4 |
5 |
6 | Jekyll
7 | {% assign feed_path = "/feed.xml" %}
8 | {% if site.feed and site.feed.path %}
9 | {% assign feed_path = site.feed.path %}
10 | {% endif %}
11 |
12 |
13 | {{ site.time | date_to_xmlschema }}
14 | {{ '/' | absolute_url | xml_escape }}
15 |
16 | {% if site.title %}
17 | {{ site.title | smartify | xml_escape }}
18 | {% elsif site.name %}
19 | {{ site.name | smartify | xml_escape }}
20 | {% endif %}
21 |
22 | {% if site.description %}
23 | {{ site.description | xml_escape }}
24 | {% endif %}
25 |
26 | {% if site.author %}
27 |
28 | {{ site.author.name | default: site.author | xml_escape }}
29 | {% if site.author.email %}
30 | {{ site.author.email | xml_escape }}
31 | {% endif %}
32 | {% if site.author.uri %}
33 | {{ site.author.uri | xml_escape }}
34 | {% endif %}
35 |
36 | {% endif %}
37 |
38 | {% for post in site.posts limit: 20 %}
39 | {% unless post.draft %}
40 |
41 | {% if post.external-url %}
42 | {{ post.title | append: " →" | smartify | strip_html | normalize_whitespace | xml_escape }}
43 | {% else %}
44 | {{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }}
45 | {% endif %}
46 | {% if post.external-url %}
47 |
48 |
49 | {% else %}
50 |
51 | {% endif %}
52 | {{ post.date | date_to_xmlschema }}
53 | {{ post.last_modified_at | default: post.date | date_to_xmlschema }}
54 | {{ post.id | absolute_url | xml_escape }}
55 | {{ post.content | strip | xml_escape }}
56 |
57 | {% assign post_author = post.author | default: post.authors[0] | default: site.author %}
58 | {% assign post_author = site.data.authors[post_author] | default: post_author %}
59 | {% assign post_author_email = post_author.email | default: nil %}
60 | {% assign post_author_uri = post_author.uri | default: nil %}
61 | {% assign post_author_name = post_author.name | default: post_author %}
62 |
63 | {% if post_author %}
64 |
65 | {{ post_author_name | xml_escape }}
66 | {% if post_author_email %}
67 | {{ post_author_email | xml_escape }}
68 | {% endif %}
69 | {% if post_author_uri %}
70 | {{ post_author_uri | xml_escape }}
71 | {% endif %}
72 |
73 | {% endif %}
74 |
75 | {% for category in post.categories %}
76 |
77 | {% endfor %}
78 |
79 | {% for tag in post.tags %}
80 |
81 | {% endfor %}
82 |
83 | {% if post.excerpt and post.excerpt != empty %}
84 | {{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}
85 | {% endif %}
86 |
87 | {% assign post_image = post.twitter_card.image | default: post.facebook.image %}
88 | {% if post_image %}
89 | {% unless post_image contains "://" %}
90 | {% assign post_image = post_image | absolute_url | xml_escape %}
91 | {% endunless %}
92 |
93 | {% endif %}
94 |
95 | {% endunless %}
96 | {% endfor %}
97 |
98 |
--------------------------------------------------------------------------------
/about.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: "About"
4 | permalink: /about/
5 | ---
6 |
7 | whiteglass is a minimal, responsive Jekyll theme for hackers.
8 |
9 | ## Installation
10 |
11 | Add this line to your Jekyll site's Gemfile:
12 |
13 | ``` ruby
14 | gem "jekyll-whiteglass"
15 | ```
16 |
17 | And add this line to your Jekyll site's `_config.yml`:
18 |
19 | ``` yaml
20 | theme: jekyll-whiteglass
21 | ```
22 |
23 | And then execute:
24 |
25 | ``` sh
26 | bundle
27 | ```
28 |
29 | Or install it yourself as:
30 |
31 | ``` sh
32 | gem install jekyll-whiteglass
33 | ```
34 |
35 | ## Quick Start
36 |
37 | 1. Go to [yous/whiteglass-template](https://github.com/yous/whiteglass-template).
38 | 2. Click "Use this template" button, and then create a repository.
39 | 3. Change the options defined in _config.yml. See [Configuration](https://github.com/yous/whiteglass-template#configuration)
40 | section under whiteglass-template.
41 | 5. Push some content, then GitHub Actions will generate the site.
42 |
43 | ## Manual Setup
44 |
45 | 1. Generate a new Jekyll blog:
46 |
47 | ``` sh
48 | jekyll new blog --skip-bundle
49 | cd blog
50 | ```
51 |
52 | 2. Edit `Gemfile` to use whiteglass theme:
53 |
54 | ``` ruby
55 | gem "jekyll-whiteglass"
56 | ```
57 |
58 | 3. Edit `_config.yml` to use whiteglass theme and its plugins:
59 |
60 | ``` yaml
61 | theme: jekyll-whiteglass
62 | plugins:
63 | - jekyll-archives
64 | - jekyll-paginate
65 | - jekyll-sitemap
66 |
67 | permalink: /:year/:month/:day/:title/
68 | paginate_path: /posts/:num/
69 | paginate: 5
70 |
71 | jekyll-archives:
72 | enabled:
73 | - categories
74 | - tags
75 | layout: category_archives
76 | permalinks:
77 | category: /categories/:name/
78 | tag: /tags/:name/
79 | ```
80 |
81 | 4. Copy
82 | [`index.html`](https://github.com/yous/whiteglass/blob/master/index.html),
83 | [`about.md`](https://github.com/yous/whiteglass/blob/master/about.md),
84 | [`archives.md`](https://github.com/yous/whiteglass/blob/master/archives.md),
85 | [`feed.xml`](https://github.com/yous/whiteglass/blob/master/feed.xml),
86 | [`robots.txt`](https://github.com/yous/whiteglass/blob/master/robots.txt),
87 | [`_data/i18n.yml`](https://github.com/yous/whiteglass/blob/master/_data/i18n.yml),
88 | and [`_data/navigation.yml`](https://github.com/yous/whiteglass/blob/master/_data/navigation.yml)
89 | from the theme:
90 |
91 | ``` sh
92 | rm index.md
93 | curl -L -O "https://github.com/yous/whiteglass/raw/master/{index.html,about.md,archives.md,feed.xml,robots.txt}"
94 | curl -L --create-dirs -o _data/#1 "https://github.com/yous/whiteglass/raw/master/_data/{navigation.yml,i18n.yml}"
95 | ```
96 |
97 | 5. Install gems and you're good to go! The blog will be available on
98 | `http://127.0.0.1:4000`.
99 |
100 | ``` sh
101 | bundle install
102 | bundle exec jekyll serve
103 | ```
104 |
105 | ## Upgrading
106 |
107 | ### From Version < 1.9.1
108 |
109 | Copy
110 | [`_data/i18n.yml`](https://github.com/yous/whiteglass/blob/master/_data/i18n.yml)
111 | from the theme.
112 |
113 | ## Deployment to GitHub Pages using Travis CI
114 |
115 | This theme uses [jekyll-archives](https://github.com/jekyll/jekyll-archives) gem
116 | which is [not supported by GitHub Pages](https://help.github.com/articles/configuring-jekyll-plugins/).
117 | If you want to use full features like categories and tags, I recommend you to
118 | use Travis CI or other CI services.
119 |
120 | To deploy using Travis CI, first copy the [`.travis.yml`](https://github.com/yous/whiteglass/blob/master/.travis.yml)
121 | of this repository. You can change `target-branch` (`gh-pages` by default) and
122 | `on.branch` (`master` by default) as you want. If you want further
123 | customization, see [Travis CI's documentation page](https://docs.travis-ci.com/user/deployment/pages/).
124 |
125 | You'll see there's `github-token: $GITHUB_TOKEN`, and this is what you should
126 | configure. Go to your [personal access tokens](https://github.com/settings/tokens)
127 | page, and generate new token with `public_repo` or `repo` permission as you
128 | need. Then go to Travis CI's settings page of your repository, and add a new
129 | environment variable `GITHUB_TOKEN` with the value of the token you generated.
130 |
131 | ## Usage
132 |
133 | ### Customization
134 |
135 | To override the default structure and style of whiteglass, simply create the
136 | concerned directory at the root of your site, copy the file you wish to
137 | customize to that directory, and then edit the file. e.g., to override the
138 | [`_includes/footer_content.html`](_includes/footer_content.html) file to add
139 | contents to footer, create an `_includes` directory, copy
140 | `_includes/footer_content.html` from jekyll-whiteglass gem folder to
141 | `/_includes` and start editing that file.
142 |
143 | For example, you can add favicons to `_includes/head_custom.html`:
144 |
145 | ``` html
146 |
147 |
148 |
149 |
150 |
151 |
152 | ```
153 |
154 | The site's default CSS is in the gem itself,
155 | [`assets/main.scss`](assets/main.scss). To override the default CSS, the file
156 | has to exist at your site source. Do either of the following:
157 |
158 | - Create a new instance of `main.scss` at site source
159 | - Create a new file `main.scss` at `/assets/`
160 | - Add the frontmatter dashes, and
161 | - Add `@import "whiteglass";`, to `/assets/main.scss`
162 | - Add your custom CSS
163 | - Download the file from this repo
164 | - Create a new file `main.scss` at `/assets/`
165 | - Copy the contents at [`assets/main.scss`](assets/main.scss) onto the `main.scss` you just created, and edit away
166 | - Copy directly from jekyll-whiteglass gem
167 | - Go to your local jekyll-whiteglass gem installation directory (run `bundle show jekyll-whiteglass` to get the path to it)
168 | - Copy the `assets/` folder from there into the root of ``
169 | - Change whatever values you want, inside `/assets/main.scss`
170 |
171 | ### Locale
172 |
173 | `site.lang` is used to declare the primary language for each web page within the
174 | site.
175 |
176 | `lang: en-US` sets the `lang` attribute for the site to the United States flavor
177 | of English, while `en-GB` would be for the United Kingdom style of English.
178 | Country codes are optional and the shorter variation `lang: en` is also
179 | acceptable. You may want to write a post in different language, then add `lang`
180 | attribute to the frontmatter of that post:
181 |
182 | ``` yaml
183 | layout: post
184 | title: "안녕하세요"
185 | lang: ko
186 | ```
187 |
188 | The date format and other fixed strings are translated using the `_data/i18n.yml` file. If your language is not yet included, feel free to open a [pull request](https://github.com/yous/whiteglass/pulls).
189 |
190 | ### Description
191 |
192 | `site.description` describes the site. This is mainly used in meta descriptions
193 | for improving SEO. Also, you can set `description` attribute for each post:
194 |
195 | ``` yaml
196 | layout: post
197 | title: Awesome Post
198 | description: This is an awesome post.
199 | ```
200 |
201 | If you don't specify `post.description`, then `post.excerpt` will be used if it
202 | exist.
203 |
204 | ### External URL
205 |
206 | `external-url` turns the title of your post to a link. Specify a URL which you
207 | want to link to.
208 |
209 | ``` yaml
210 | layout: post
211 | title: Jekyll whiteglass theme
212 | external-url: https://github.com/yous/whiteglass
213 | ```
214 |
215 | Then the title of your post would look like a link with text
216 | `Jekyll whiteglass theme →`. This also applies to your blog feed.
217 |
218 | ### Category
219 |
220 | Each post can have `categories` attribute. It can be a string or an array. This
221 | will be displayed on index, archive and each post, and provide a link to the
222 | archive of category.
223 |
224 | ``` yaml
225 | layout: post
226 | title: Awesome Post
227 | categories: Misc
228 | ```
229 |
230 | ``` yaml
231 | layout: post
232 | title: Another Awesome Post
233 | categories:
234 | - Misc
235 | - Idea
236 | ```
237 |
238 | ### Tag
239 |
240 | Each post can have `tags` attribute. It can be a string or an array. This will
241 | be displayed on index, archive and each post, and provide a link to the archive
242 | of tag.
243 |
244 | ``` yaml
245 | layout: post
246 | title: Awesome Post
247 | tags: food
248 | ```
249 |
250 | ``` yaml
251 | layout: post
252 | title: Another Awesome Post
253 | tags:
254 | - food
255 | - trip
256 | ```
257 |
258 | ### Feed
259 |
260 | Create `/feed.xml` with:
261 |
262 | ``` yaml
263 | ---
264 | layout: feed
265 | ---
266 | ```
267 |
268 | If you want to use another path for feed, you can specify a non-default path via
269 | your site's config.
270 |
271 | ``` yaml
272 | feed:
273 | path: atom.xml
274 | ```
275 |
276 | Then create `/atom.xml` with the same content of `feed.xml` above.
277 |
278 | ### Comments
279 |
280 | whiteglass provides the ability to include your favourite commenting service, like [Disqus](https://disqus.com) or [Isso](https://isso-comments.de/).
281 |
282 | To enable comments on pages and posts:
283 | 1. Overwrite the `_includes/custom_comments_provider.html` with your custom provider of comments.
284 | 2. Add `comments: true` to your `_config.yml`.
285 |
286 | To disable comments on certain pages or posts specify `comments: false` in the front matter of the page or post.
287 |
288 | ### Metadata for SEO
289 |
290 | #### Keywords
291 |
292 | Each post can have `keywords` attribute. This is a comma-separated list which is
293 | used in meta descriptions for improving SEO.
294 |
295 | ``` yaml
296 | layout: post
297 | title: How to configure jekyll-whiteglass
298 | keywords: jekyll, whiteglass, github pages
299 | ```
300 |
301 | YAML list is also available:
302 |
303 | ``` yaml
304 | keywords:
305 | - jekyll
306 | - whiteglass
307 | - github pages
308 | ```
309 |
310 | #### Twitter
311 |
312 | - `site.twitter_username` sets `twitter:site` and `twitter:creator` meta tag
313 | - `site.twitter_image` sets `twitter:image:src` meta tag
314 | - `page.twitter_card.type` sets `twitter:card` meta tag (default: `summary`)
315 | - If `page.twitter_card.type` is `gallery`, it sets `twitter:image0`, `twitter:image1`, `twitter:image2` and `twitter:image3` meta tags with `page.twitter_card.image`, `page.twitter_card.image1`, `page.twitter_card.image2` and `page.twitter_card.image3`, respectively
316 | - If `page.twitter_card.type` is `photo`, `page.twitter_card.width` sets `twitter:image:width` meta tag and `page.twitter_card.height` sets `twitter:image:height` meta tag
317 | - `page.twitter_card.creator` sets `twitter:creator` meta tag. It overrides `site.twitter_username`
318 | - `page.twitter_card.image` sets `twitter:image:src` meta tag if `page.twitter_card.type` is not `gallery`. It overrides `site.twitter_image`
319 |
320 | #### Facebook
321 |
322 | - `site.facebook_app_id` sets `fb:admins` meta tag
323 | - `site.facebook_page` sets `article:author` meta tag
324 | - `site.facebook_image` sets `og:image` meta tag
325 | - `page.facebook.image` sets `og:image` meta tag. It overrides `site.facebook_image`
326 |
327 | ### Navigation
328 |
329 | To define header links, add titles and URLs under the `main` key in
330 | `_data/navigation.yml`:
331 |
332 | ``` yaml
333 | main:
334 | - title: "About"
335 | url: /about/
336 | - title: "Archives"
337 | url: /archives/
338 | - title: "GitHub"
339 | url: https://github.com/yous/whiteglass
340 | ```
341 |
342 | ### Enabling Google Analytics
343 |
344 | To enable Google Analytics, add the following lines to your Jekyll site:
345 |
346 | ``` yaml
347 | google_analytics: UA-NNNNNNNN-N
348 | ```
349 |
350 | For Google Analytics 4, add the following lines:
351 |
352 | ``` yaml
353 | google_analytics: G-NNNNNNNNNN
354 | ```
355 |
356 | Replace `N`s with your specific ID.
357 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # whiteglass
2 |
3 | [](https://badge.fury.io/rb/jekyll-whiteglass)
4 | [](https://github.com/yous/whiteglass/actions/workflows/main.yml)
5 |
6 | Minimal, responsive Jekyll theme for hackers.
7 |
8 | 
9 |
10 | ## Installation
11 |
12 | Add this line to your Jekyll site's Gemfile:
13 |
14 | ``` ruby
15 | gem "jekyll-whiteglass"
16 | ```
17 |
18 | And add this line to your Jekyll site's `_config.yml`:
19 |
20 | ``` yaml
21 | theme: jekyll-whiteglass
22 | ```
23 |
24 | And then execute:
25 |
26 | ``` sh
27 | bundle
28 | ```
29 |
30 | Or install it yourself as:
31 |
32 | ``` sh
33 | gem install jekyll-whiteglass
34 | ```
35 |
36 | ## Quick Start
37 |
38 | 1. Go to [yous/whiteglass-template](https://github.com/yous/whiteglass-template).
39 | 2. Click "Use this template" button, and then create a repository.
40 | 3. Change the options defined in _config.yml. See [Configuration](https://github.com/yous/whiteglass-template#configuration)
41 | section under whiteglass-template.
42 | 4. Push some content, then GitHub Actions will generate the site.
43 |
44 | ## Manual Setup
45 |
46 | 1. Generate a new Jekyll blog:
47 |
48 | ``` sh
49 | jekyll new blog --skip-bundle
50 | cd blog
51 | ```
52 |
53 | 2. Edit `Gemfile` to use whiteglass theme:
54 |
55 | ``` ruby
56 | gem "jekyll-whiteglass"
57 | ```
58 |
59 | 3. Edit `_config.yml` to use whiteglass theme and its plugins:
60 |
61 | ``` yaml
62 | theme: jekyll-whiteglass
63 | plugins:
64 | - jekyll-archives
65 | - jekyll-paginate
66 | - jekyll-sitemap
67 |
68 | permalink: /:year/:month/:day/:title/
69 | paginate_path: /posts/:num/
70 | paginate: 5
71 |
72 | jekyll-archives:
73 | enabled:
74 | - categories
75 | - tags
76 | layout: category_archives
77 | permalinks:
78 | category: /categories/:name/
79 | tag: /tags/:name/
80 | ```
81 |
82 | 4. Copy
83 | [`index.html`](https://github.com/yous/whiteglass/blob/master/index.html),
84 | [`about.md`](https://github.com/yous/whiteglass/blob/master/about.md),
85 | [`archives.md`](https://github.com/yous/whiteglass/blob/master/archives.md),
86 | [`feed.xml`](https://github.com/yous/whiteglass/blob/master/feed.xml),
87 | [`robots.txt`](https://github.com/yous/whiteglass/blob/master/robots.txt),
88 | [`_data/i18n.yml`](https://github.com/yous/whiteglass/blob/master/_data/i18n.yml),
89 | and [`_data/navigation.yml`](https://github.com/yous/whiteglass/blob/master/_data/navigation.yml)
90 | from the theme:
91 |
92 | ``` sh
93 | rm index.md
94 | curl -L -O "https://github.com/yous/whiteglass/raw/master/{index.html,about.md,archives.md,feed.xml,robots.txt}"
95 | curl -L --create-dirs -o _data/#1 "https://github.com/yous/whiteglass/raw/master/_data/{navigation.yml,i18n.yml}"
96 | ```
97 |
98 | 5. Install gems and you're good to go! The blog will be available on
99 | `http://127.0.0.1:4000`.
100 |
101 | ``` sh
102 | bundle install
103 | bundle exec jekyll serve
104 | ```
105 |
106 | ## Upgrading
107 |
108 | ### From Versions < 1.9.1
109 |
110 | Copy
111 | [`_data/i18n.yml`](https://github.com/yous/whiteglass/blob/master/_data/i18n.yml)
112 | from the theme.
113 |
114 | ## Deployment to GitHub Pages using Travis CI
115 |
116 | This theme uses [jekyll-archives](https://github.com/jekyll/jekyll-archives) gem
117 | which is [not supported by GitHub Pages](https://help.github.com/articles/configuring-jekyll-plugins/).
118 | If you want to use full features like categories and tags, I recommend you to
119 | use Travis CI or other CI services.
120 |
121 | To deploy using Travis CI, first copy the [`.travis.yml`](https://github.com/yous/whiteglass/blob/master/.travis.yml)
122 | of this repository. You can change `target-branch` (`gh-pages` by default) and
123 | `on.branch` (`master` by default) as you want. If you want further
124 | customization, see [Travis CI's documentation page](https://docs.travis-ci.com/user/deployment/pages/).
125 |
126 | You'll see there's `github-token: $GITHUB_TOKEN`, and this is what you should
127 | configure. Go to your [personal access tokens](https://github.com/settings/tokens)
128 | page, and generate new token with `public_repo` or `repo` permission as you
129 | need. Then go to Travis CI's settings page of your repository, and add a new
130 | environment variable `GITHUB_TOKEN` with the value of the token you generated.
131 |
132 | ## Usage
133 |
134 | ### Customization
135 |
136 | To override the default structure and style of whiteglass, simply create the
137 | concerned directory at the root of your site, copy the file you wish to
138 | customize to that directory, and then edit the file. e.g., to override the
139 | [`_includes/footer_content.html`](_includes/footer_content.html) file to add
140 | contents to footer, create an `_includes` directory, copy
141 | `_includes/footer_content.html` from jekyll-whiteglass gem folder to
142 | `/_includes` and start editing that file.
143 |
144 | For example, you can add favicons to `_includes/head_custom.html`:
145 |
146 | ``` html
147 |
148 |
149 |
150 |
151 |
152 |
153 | ```
154 |
155 | The site's default CSS is in the gem itself,
156 | [`assets/main.scss`](assets/main.scss). To override the default CSS, the file
157 | has to exist at your site source. Do either of the following:
158 |
159 | - Create a new instance of `main.scss` at site source
160 | - Create a new file `main.scss` at `/assets/`
161 | - Add the frontmatter dashes, and
162 | - Add `@import "whiteglass";`, to `/assets/main.scss`
163 | - Add your custom CSS
164 | - Download the file from this repo
165 | - Create a new file `main.scss` at `/assets/`
166 | - Copy the contents at [`assets/main.scss`](assets/main.scss) onto the `main.scss` you just created, and edit away
167 | - Copy directly from jekyll-whiteglass gem
168 | - Go to your local jekyll-whiteglass gem installation directory (run `bundle show jekyll-whiteglass` to get the path to it)
169 | - Copy the `assets/` folder from there into the root of ``
170 | - Change whatever values you want, inside `/assets/main.scss`
171 |
172 | ### Locale
173 |
174 | `site.lang` is used to declare the primary language for each web page within the
175 | site.
176 |
177 | `lang: en-US` sets the `lang` attribute for the site to the United States flavor
178 | of English, while `en-GB` would be for the United Kingdom style of English.
179 | Country codes are optional and the shorter variation `lang: en` is also
180 | acceptable. You may want to write a post in different language, then add `lang`
181 | attribute to the frontmatter of that post:
182 |
183 | ``` yaml
184 | layout: post
185 | title: "안녕하세요"
186 | lang: ko
187 | ```
188 |
189 | The date format and other fixed strings are translated using the `_data/i18n.yml` file. If your language is not yet included, feel free to open a [pull request](https://github.com/yous/whiteglass/pulls).
190 |
191 | ### Description
192 |
193 | `site.description` describes the site. This is mainly used in meta descriptions
194 | for improving SEO. Also, you can set `description` attribute for each post:
195 |
196 | ``` yaml
197 | layout: post
198 | title: Awesome Post
199 | description: This is an awesome post.
200 | ```
201 |
202 | If you don't specify `post.description`, then `post.excerpt` will be used if it
203 | exist.
204 |
205 | ### External URL
206 |
207 | `external-url` turns the title of your post to a link. Specify a URL which you
208 | want to link to.
209 |
210 | ``` yaml
211 | layout: post
212 | title: Jekyll whiteglass theme
213 | external-url: https://github.com/yous/whiteglass
214 | ```
215 |
216 | Then the title of your post would look like a link with text
217 | `Jekyll whiteglass theme →`. This also applies to your blog feed.
218 |
219 | ### Category
220 |
221 | Each post can have `categories` attribute. It can be a string or an array. This
222 | will be displayed on index, archive and each post, and provide a link to the
223 | archive of category.
224 |
225 | ``` yaml
226 | layout: post
227 | title: Awesome Post
228 | categories: Misc
229 | ```
230 |
231 | ``` yaml
232 | layout: post
233 | title: Another Awesome Post
234 | categories:
235 | - Misc
236 | - Idea
237 | ```
238 |
239 | ### Tag
240 |
241 | Each post can have `tags` attribute. It can be a string or an array. This will
242 | be displayed on index, archive and each post, and provide a link to the archive
243 | of tag.
244 |
245 | ``` yaml
246 | layout: post
247 | title: Awesome Post
248 | tags: food
249 | ```
250 |
251 | ``` yaml
252 | layout: post
253 | title: Another Awesome Post
254 | tags:
255 | - food
256 | - trip
257 | ```
258 |
259 | ### Feed
260 |
261 | Create `/feed.xml` with:
262 |
263 | ``` yaml
264 | ---
265 | layout: feed
266 | ---
267 | ```
268 |
269 | If you want to use another path for feed, you can specify a non-default path via
270 | your site's config.
271 |
272 | ``` yaml
273 | feed:
274 | path: atom.xml
275 | ```
276 |
277 | Then create `/atom.xml` with the same content of `feed.xml` above.
278 |
279 | ### Comments
280 |
281 | whiteglass provides the ability to include your favourite commenting service, like [Disqus](https://disqus.com) or [Isso](https://isso-comments.de/).
282 |
283 | To enable comments on pages and posts:
284 | 1. Overwrite the `_includes/custom_comments_provider.html` with your custom provider of comments.
285 | 2. Add `comments: true` to your `_config.yml`.
286 |
287 | To disable comments on certain pages or posts specify `comments: false` in the front matter of the page or post.
288 |
289 | ### Metadata for SEO
290 |
291 | #### Keywords
292 |
293 | Each post can have `keywords` attribute. This is a comma-separated list which is
294 | used in meta descriptions for improving SEO.
295 |
296 | ``` yaml
297 | layout: post
298 | title: How to configure jekyll-whiteglass
299 | keywords: jekyll, whiteglass, github pages
300 | ```
301 |
302 | YAML list is also available:
303 |
304 | ``` yaml
305 | keywords:
306 | - jekyll
307 | - whiteglass
308 | - github pages
309 | ```
310 |
311 | #### Twitter
312 |
313 | - `site.twitter_username` sets `twitter:site` and `twitter:creator` meta tag
314 | - `site.twitter_image` sets `twitter:image:src` meta tag
315 | - `page.twitter_card.type` sets `twitter:card` meta tag (default: `summary`)
316 | - If `page.twitter_card.type` is `gallery`, it sets `twitter:image0`, `twitter:image1`, `twitter:image2` and `twitter:image3` meta tags with `page.twitter_card.image`, `page.twitter_card.image1`, `page.twitter_card.image2` and `page.twitter_card.image3`, respectively
317 | - If `page.twitter_card.type` is `photo`, `page.twitter_card.width` sets `twitter:image:width` meta tag and `page.twitter_card.height` sets `twitter:image:height` meta tag
318 | - `page.twitter_card.creator` sets `twitter:creator` meta tag. It overrides `site.twitter_username`
319 | - `page.twitter_card.image` sets `twitter:image:src` meta tag if `page.twitter_card.type` is not `gallery`. It overrides `site.twitter_image`
320 |
321 | #### Facebook
322 |
323 | - `site.facebook_app_id` sets `fb:admins` meta tag
324 | - `site.facebook_page` sets `article:author` meta tag
325 | - `site.facebook_image` sets `og:image` meta tag
326 | - `page.facebook.image` sets `og:image` meta tag. It overrides `site.facebook_image`
327 |
328 | ### Navigation
329 |
330 | To define header links, add titles and URLs under the `main` key in
331 | `_data/navigation.yml`:
332 |
333 | ``` yaml
334 | main:
335 | - title: "About"
336 | url: /about/
337 | - title: "Archives"
338 | url: /archives/
339 | - title: "GitHub"
340 | url: https://github.com/yous/whiteglass
341 | ```
342 |
343 | ### Enabling Google Analytics
344 |
345 | To enable Google Analytics, add the following lines to your Jekyll site:
346 |
347 | ``` yaml
348 | google_analytics: UA-NNNNNNNN-N
349 | ```
350 |
351 | For Google Analytics 4, add the following lines:
352 |
353 | ``` yaml
354 | google_analytics: G-NNNNNNNNNN
355 | ```
356 |
357 | Replace `N`s with your specific ID.
358 |
359 | ## Contributing
360 |
361 | Bug reports and pull requests are welcome on GitHub at
362 | . This project is intended to be a safe,
363 | welcoming space for collaboration, and contributors are expected to adhere to
364 | the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
365 |
366 | ## Development
367 |
368 | To set up your environment to develop this theme, run `bundle install`.
369 |
370 | Your theme is setup just like a normal Jekyll site! To test your theme, run
371 | `bundle exec jekyll serve` and open your browser at
372 | `http://localhost:4000/whiteglass/`. This starts a Jekyll server using your
373 | theme. Add pages, documents, data, etc. like normal to test your theme's
374 | contents. As you make modifications to your theme and to your content, your site
375 | will regenerate and you should see the changes in the browser after a refresh,
376 | just like normal.
377 |
378 | ## License
379 |
380 | The theme is available as open source under the terms of the
381 | [MIT License](http://opensource.org/licenses/MIT).
382 |
--------------------------------------------------------------------------------