From f4daf4eccf323dafb0b8da258f6b0c94cbbe71b5 Mon Sep 17 00:00:00 2001 From: Chester How Date: Mon, 8 Jan 2018 20:23:56 +0800 Subject: [PATCH 1/6] Convert theme to gem --- Gemfile | 4 ++ Gemfile.lock | 62 +++++++++++++++++++++++++++++++ LICENSE | 2 +- README.md | 30 ++++++++------- _config.yml | 8 ++-- _includes/head.html | 8 ++-- _sass/tale.scss | 8 ++++ _sass/{ => tale}/_base.scss | 0 _sass/{ => tale}/_catalogue.scss | 0 _sass/{ => tale}/_code.scss | 0 _sass/{ => tale}/_layout.scss | 0 _sass/{ => tale}/_pagination.scss | 0 _sass/{ => tale}/_post.scss | 0 _sass/{ => tale}/_syntax.scss | 0 _sass/{ => tale}/_variables.scss | 0 assets/main.scss | 5 +++ styles.scss | 13 ------- tale.gemspec | 20 ++++++++++ 18 files changed, 125 insertions(+), 35 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 _sass/tale.scss rename _sass/{ => tale}/_base.scss (100%) rename _sass/{ => tale}/_catalogue.scss (100%) rename _sass/{ => tale}/_code.scss (100%) rename _sass/{ => tale}/_layout.scss (100%) rename _sass/{ => tale}/_pagination.scss (100%) rename _sass/{ => tale}/_post.scss (100%) rename _sass/{ => tale}/_syntax.scss (100%) rename _sass/{ => tale}/_variables.scss (100%) create mode 100644 assets/main.scss delete mode 100644 styles.scss create mode 100644 tale.gemspec diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..bb94df8 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +source "https://rubygems.org" +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..41e1c63 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,62 @@ +PATH + remote: . + specs: + tale (0.1.0) + jekyll (~> 3.6) + jekyll-paginate (~> 1.1) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + colorator (1.1.0) + ffi (1.9.18) + forwardable-extended (2.6.0) + jekyll (3.6.0) + addressable (~> 2.4) + colorator (~> 1.0) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 1.1) + kramdown (~> 1.14) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 3) + safe_yaml (~> 1.0) + jekyll-paginate (1.1.0) + jekyll-sass-converter (1.5.0) + sass (~> 3.4) + jekyll-watch (1.5.0) + listen (~> 3.0, < 3.1) + kramdown (1.15.0) + liquid (4.0.0) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + mercenary (0.3.6) + pathutil (0.16.0) + forwardable-extended (~> 2.6) + public_suffix (3.0.0) + rake (10.4.2) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + rouge (2.2.1) + safe_yaml (1.0.4) + sass (3.5.2) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.12) + rake (~> 10.0) + tale! + +BUNDLED WITH + 1.14.6 diff --git a/LICENSE b/LICENSE index ac9e0d8..c7dc8ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016 Chester How +Copyright (c) 2018 Chester How Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 1c87aad..34ed470 100644 --- a/README.md +++ b/README.md @@ -4,33 +4,35 @@ Tale is a minimal Jekyll theme curated for storytellers. Checkout the demo [here ![Tale screenshot](http://i.imgur.com/pXZrtmo.png) ## Features +- Easy installation - Compatible with GitHub Pages - Responsive design (looks just as good on mobile) - Syntax highlighting, with the help of Pygments - Markdown and HTML text formatting - Pagination of posts -## Usage -### 1. Fork and Clone -Fork this repository then clone it. +## Installation -### 2. Install dependencies -Tale uses Jekyll's built-SCSS compiler to generate CSS. You'll need to install the Jekyll gem: +1. Add this line to your `Gemfile`: -```bash -$ gem install jekyll +```ruby +gem "tale" ``` -### 3. Create your site -Edit the `_config.yml` file to suit your site. Also replace posts and content with your own. +2. And add this line to your `_config.yml`: -### 4. Running Locally -To test your site locally, run this in your site's root directory - -```bash -$ jekyll serve --watch +```yaml +theme: tale ``` +3. Install the theme's gems and dependencies: + + $ bundle + +4. Finally, build and serve your site + + $ bundle exec jekyll serve + Head to http://localhost:4000/tale/ to see your site in action. ## Contributing diff --git a/_config.yml b/_config.yml index f8395f6..f18b40c 100644 --- a/_config.yml +++ b/_config.yml @@ -8,9 +8,9 @@ baseurl: "/tale" url: "https://chesterhow.github.io" # Assets -sass: - sass_dir: _sass - style: :compressed +# sass: +# sass_dir: _sass +# style: :compressed # Build settings markdown: kramdown @@ -29,3 +29,5 @@ github: # Gems plugins: - jekyll-paginate + +theme: tale diff --git a/_includes/head.html b/_includes/head.html index bd096e8..33d7680 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -11,11 +11,11 @@ - + - - - + + + diff --git a/_sass/tale.scss b/_sass/tale.scss new file mode 100644 index 0000000..3cdfa99 --- /dev/null +++ b/_sass/tale.scss @@ -0,0 +1,8 @@ +@import 'tale/variables'; +@import 'tale/base'; +@import 'tale/code'; +@import 'tale/post'; +@import 'tale/syntax'; +@import 'tale/layout'; +@import 'tale/pagination'; +@import 'tale/catalogue'; diff --git a/_sass/_base.scss b/_sass/tale/_base.scss similarity index 100% rename from _sass/_base.scss rename to _sass/tale/_base.scss diff --git a/_sass/_catalogue.scss b/_sass/tale/_catalogue.scss similarity index 100% rename from _sass/_catalogue.scss rename to _sass/tale/_catalogue.scss diff --git a/_sass/_code.scss b/_sass/tale/_code.scss similarity index 100% rename from _sass/_code.scss rename to _sass/tale/_code.scss diff --git a/_sass/_layout.scss b/_sass/tale/_layout.scss similarity index 100% rename from _sass/_layout.scss rename to _sass/tale/_layout.scss diff --git a/_sass/_pagination.scss b/_sass/tale/_pagination.scss similarity index 100% rename from _sass/_pagination.scss rename to _sass/tale/_pagination.scss diff --git a/_sass/_post.scss b/_sass/tale/_post.scss similarity index 100% rename from _sass/_post.scss rename to _sass/tale/_post.scss diff --git a/_sass/_syntax.scss b/_sass/tale/_syntax.scss similarity index 100% rename from _sass/_syntax.scss rename to _sass/tale/_syntax.scss diff --git a/_sass/_variables.scss b/_sass/tale/_variables.scss similarity index 100% rename from _sass/_variables.scss rename to _sass/tale/_variables.scss diff --git a/assets/main.scss b/assets/main.scss new file mode 100644 index 0000000..6c114d8 --- /dev/null +++ b/assets/main.scss @@ -0,0 +1,5 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- + +@import 'tale'; diff --git a/styles.scss b/styles.scss deleted file mode 100644 index 776bd2e..0000000 --- a/styles.scss +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Use a comment to ensure Jekyll reads the file to be transformed into CSS later -# only main files contain this front matter, not partials. ---- - -@import 'variables'; -@import 'base'; -@import 'code'; -@import 'post'; -@import 'syntax'; -@import 'layout'; -@import 'pagination'; -@import 'catalogue'; diff --git a/tale.gemspec b/tale.gemspec new file mode 100644 index 0000000..80d3fdf --- /dev/null +++ b/tale.gemspec @@ -0,0 +1,20 @@ +# coding: utf-8 + +Gem::Specification.new do |spec| + spec.name = "tale" + spec.version = "0.1.0" + spec.authors = ["Chester How"] + spec.email = ["chesterhow@gmail.com"] + + spec.summary = %q{Tale is a minimal Jekyll theme curated for storytellers.} + spec.homepage = "https://github.com/chesterhow/tale" + spec.license = "MIT" + + spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) } + + spec.add_runtime_dependency "jekyll", "~> 3.6" + spec.add_runtime_dependency "jekyll-paginate", "~> 1.1" + + spec.add_development_dependency "bundler", "~> 1.12" + spec.add_development_dependency "rake", "~> 10.0" +end From 0a0aabadcee67659111952b7c56fac77b22798d6 Mon Sep 17 00:00:00 2001 From: Chester How Date: Mon, 8 Jan 2018 22:36:00 +0800 Subject: [PATCH 2/6] Add home layout --- .gitignore | 6 ++++-- Gemfile.lock | 22 ++++++++++++---------- _config.yml | 29 +++++++++-------------------- _layouts/home.html | 31 +++++++++++++++++++++++++++++++ index.html | 31 +------------------------------ tale.gemspec | 2 +- 6 files changed, 58 insertions(+), 63 deletions(-) create mode 100644 _layouts/home.html diff --git a/.gitignore b/.gitignore index 45c1505..867d379 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ -_site +*.gem +.bundle .sass-cache -.jekyll-metadata +_site +Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock index 41e1c63..ee14db4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tale (0.1.0) + tale (0.0.4) jekyll (~> 3.6) jekyll-paginate (~> 1.1) @@ -13,7 +13,7 @@ GEM colorator (1.1.0) ffi (1.9.18) forwardable-extended (2.6.0) - jekyll (3.6.0) + jekyll (3.6.2) addressable (~> 2.4) colorator (~> 1.0) jekyll-sass-converter (~> 1.0) @@ -25,26 +25,28 @@ GEM rouge (>= 1.7, < 3) safe_yaml (~> 1.0) jekyll-paginate (1.1.0) - jekyll-sass-converter (1.5.0) + jekyll-sass-converter (1.5.1) sass (~> 3.4) - jekyll-watch (1.5.0) - listen (~> 3.0, < 3.1) - kramdown (1.15.0) + jekyll-watch (1.5.1) + listen (~> 3.0) + kramdown (1.16.2) liquid (4.0.0) - listen (3.0.8) + listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) mercenary (0.3.6) - pathutil (0.16.0) + pathutil (0.16.1) forwardable-extended (~> 2.6) - public_suffix (3.0.0) + public_suffix (3.0.1) rake (10.4.2) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) rouge (2.2.1) + ruby_dep (1.5.0) safe_yaml (1.0.4) - sass (3.5.2) + sass (3.5.5) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) diff --git a/_config.yml b/_config.yml index f18b40c..4dbcb2b 100644 --- a/_config.yml +++ b/_config.yml @@ -1,33 +1,22 @@ -# Permalinks -permalink: /:year-:month-:day/:title - # Setup -title: Tale +title: "Site title" paginate: 5 -baseurl: "/tale" -url: "https://chesterhow.github.io" - -# Assets -# sass: -# sass_dir: _sass -# style: :compressed +baseurl: # the subpath of your site e.g. "/blog" +url: # the base hostname & protocol for your site e.g. "https://chesterhow.github.io" # Build settings markdown: kramdown +theme: tale # About author: - name: Chester How - url: http://chester.how - email: chesterhow@gmail.com - -# Custom vars -version: 3.4.1 -github: - repo: https://github.com/chesterhow/tale + name: "Your name" + url: + email: # Gems plugins: - jekyll-paginate -theme: tale +# Permalinks +permalink: /:year-:month-:day/:title diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000..e7c08d6 --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,31 @@ +--- +layout: default +--- + + + + diff --git a/index.html b/index.html index f58f82f..e4d427d 100644 --- a/index.html +++ b/index.html @@ -1,32 +1,3 @@ --- -layout: default -title: Home +layout: home --- - - - - diff --git a/tale.gemspec b/tale.gemspec index 80d3fdf..3285ddb 100644 --- a/tale.gemspec +++ b/tale.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "tale" - spec.version = "0.1.0" + spec.version = "0.0.5" spec.authors = ["Chester How"] spec.email = ["chesterhow@gmail.com"] From 2d274031764895718083a431b760e936c18d3ad3 Mon Sep 17 00:00:00 2001 From: Chester How Date: Mon, 8 Jan 2018 23:09:20 +0800 Subject: [PATCH 3/6] Minor fixes --- _config.yml | 26 ++++++++++++++++---------- index.html | 1 + tale.gemspec | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/_config.yml b/_config.yml index 4dbcb2b..3a6a8aa 100644 --- a/_config.yml +++ b/_config.yml @@ -1,18 +1,23 @@ -# Setup -title: "Site title" -paginate: 5 -baseurl: # the subpath of your site e.g. "/blog" -url: # the base hostname & protocol for your site e.g. "https://chesterhow.github.io" +# Site settings +title: Tale +description: "Minimal Jekyll theme for storytellers" +baseurl: "/tale" +url: "https://chesterhow.github.io" + +# Author +author: + name: Chester How + url: https://chester.how + email: chesterhow@gmail.com # Build settings markdown: kramdown theme: tale -# About -author: - name: "Your name" - url: - email: +# Assets +sass: + sass_dir: _sass + style: compressed # Gems plugins: @@ -20,3 +25,4 @@ plugins: # Permalinks permalink: /:year-:month-:day/:title +paginate: 5 diff --git a/index.html b/index.html index e4d427d..32dfdd8 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,4 @@ --- layout: home +title: Home --- diff --git a/tale.gemspec b/tale.gemspec index 3285ddb..5495275 100644 --- a/tale.gemspec +++ b/tale.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "tale" - spec.version = "0.0.5" + spec.version = "0.0.7" spec.authors = ["Chester How"] spec.email = ["chesterhow@gmail.com"] From 0b0e2d274f75a6f071dad50776568d1268411e9e Mon Sep 17 00:00:00 2001 From: Chester How Date: Mon, 8 Jan 2018 23:09:40 +0800 Subject: [PATCH 4/6] Delete Gemfile.lock --- Gemfile.lock | 64 ---------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index ee14db4..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,64 +0,0 @@ -PATH - remote: . - specs: - tale (0.0.4) - jekyll (~> 3.6) - jekyll-paginate (~> 1.1) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - colorator (1.1.0) - ffi (1.9.18) - forwardable-extended (2.6.0) - jekyll (3.6.2) - addressable (~> 2.4) - colorator (~> 1.0) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 3) - safe_yaml (~> 1.0) - jekyll-paginate (1.1.0) - jekyll-sass-converter (1.5.1) - sass (~> 3.4) - jekyll-watch (1.5.1) - listen (~> 3.0) - kramdown (1.16.2) - liquid (4.0.0) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - mercenary (0.3.6) - pathutil (0.16.1) - forwardable-extended (~> 2.6) - public_suffix (3.0.1) - rake (10.4.2) - rb-fsevent (0.10.2) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) - rouge (2.2.1) - ruby_dep (1.5.0) - safe_yaml (1.0.4) - sass (3.5.5) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - -PLATFORMS - ruby - -DEPENDENCIES - bundler (~> 1.12) - rake (~> 10.0) - tale! - -BUNDLED WITH - 1.14.6 From 04309a0c99bd82d536ff5d1480970d08f34d7a95 Mon Sep 17 00:00:00 2001 From: Chester How Date: Mon, 8 Jan 2018 23:45:31 +0800 Subject: [PATCH 5/6] Update gem version --- tale.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tale.gemspec b/tale.gemspec index 5495275..21f97c0 100644 --- a/tale.gemspec +++ b/tale.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "tale" - spec.version = "0.0.7" + spec.version = "0.1.1" spec.authors = ["Chester How"] spec.email = ["chesterhow@gmail.com"] From 26fe53fb6b55378c7af5cc39182c9188e57b10f1 Mon Sep 17 00:00:00 2001 From: Chester How Date: Tue, 9 Jan 2018 00:31:18 +0800 Subject: [PATCH 6/6] Update readme --- README.md | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 34ed470..e65de60 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ Tale is a minimal Jekyll theme curated for storytellers. Checkout the demo [here - Pagination of posts ## Installation - +### As a Jekyll theme 1. Add this line to your `Gemfile`: ```ruby gem "tale" ``` -2. And add this line to your `_config.yml`: +2. In `_config.yml` replace the `minima` theme with `tale`: ```yaml theme: tale @@ -27,13 +27,40 @@ theme: tale 3. Install the theme's gems and dependencies: - $ bundle +```bash +$ bundle +``` -4. Finally, build and serve your site +4. Rename `index.md` to `index.html`. Without this, the `jekyll-paginate` gem will not work. - $ bundle exec jekyll serve +5. Add these 2 lines in to `_config.yml`: -Head to http://localhost:4000/tale/ to see your site in action. +```yaml +permalink: /:year-:month-:day/:title +paginate: 5 +``` + +### As a Fork +1. Fork this repository + +2. Delete the unnecessary files/folders: `CODE_OF_CONDUCT.md`, `LICENSE`, `README.md`, `tale.gemspec` + +3. Delete the `baseurl` line in `_config.yml`: + +```yaml +baseurl: "/tale" # delete this line +``` + +## Usage +Once you've installed the theme, you're ready to work on your Jekyll site. To start off, I would recommend updating `_config.yml` with your site's details. + +To build and serve your site, run: + +```bash +$ bundle exec jekyll serve +``` + +And you're all set! Head over to http://127.0.0.1:4000/ to see your site in action. ## Contributing Found a bug or have a suggestion? Feel free to create an issue or make a pull request!