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 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/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..e65de60 100644 --- a/README.md +++ b/README.md @@ -4,34 +4,63 @@ 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 +## Installation +### As a Jekyll theme +1. Add this line to your `Gemfile`: + +```ruby +gem "tale" +``` + +2. In `_config.yml` replace the `minima` theme with `tale`: + +```yaml +theme: tale +``` + +3. Install the theme's gems and dependencies: + +```bash +$ bundle +``` + +4. Rename `index.md` to `index.html`. Without this, the `jekyll-paginate` gem will not work. + +5. Add these 2 lines in to `_config.yml`: + +```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 -### 1. Fork and Clone -Fork this repository then clone it. +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. -### 2. Install dependencies -Tale uses Jekyll's built-SCSS compiler to generate CSS. You'll need to install the Jekyll gem: +To build and serve your site, run: ```bash -$ gem install jekyll +$ bundle exec jekyll serve ``` -### 3. Create your site -Edit the `_config.yml` file to suit your site. Also replace posts and content with your own. - -### 4. Running Locally -To test your site locally, run this in your site's root directory - -```bash -$ jekyll serve --watch -``` - -Head to http://localhost:4000/tale/ to see your site in action. +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! diff --git a/_config.yml b/_config.yml index f8395f6..3a6a8aa 100644 --- a/_config.yml +++ b/_config.yml @@ -1,31 +1,28 @@ -# Permalinks -permalink: /:year-:month-:day/:title - -# Setup +# Site settings title: Tale -paginate: 5 +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 + # Assets sass: sass_dir: _sass - style: :compressed - -# Build settings -markdown: kramdown - -# 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 + style: compressed # Gems plugins: - jekyll-paginate + +# Permalinks +permalink: /:year-:month-:day/:title +paginate: 5 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/_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 +--- + +
+ {% for post in paginator.posts %} + +
+ +

{{ post.title }}

+
+ +

+ {{ post.content | truncatewords: 30 | strip_html }} +

+ +
+
+ {% endfor %} +
+ + 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/index.html b/index.html index f58f82f..32dfdd8 100644 --- a/index.html +++ b/index.html @@ -1,32 +1,4 @@ --- -layout: default +layout: home title: Home --- - -
- {% for post in paginator.posts %} - -
- -

{{ post.title }}

-
- -

- {{ post.content | truncatewords: 30 | strip_html }} -

- -
-
- {% endfor %} -
- - 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..21f97c0 --- /dev/null +++ b/tale.gemspec @@ -0,0 +1,20 @@ +# coding: utf-8 + +Gem::Specification.new do |spec| + spec.name = "tale" + spec.version = "0.1.1" + 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