Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Jul 24, 2017
0 parents commit 7bae29c
Show file tree
Hide file tree
Showing 39 changed files with 1,652 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_site/
.swp
.sass-cache/
.jekyll-metadata
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: ruby
rvm:
- 2.3.3

install:
- bundle install
script:
- bundle exec jekyll build
- rake check

env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer

sudo: false # route your build to the container-based infrastructure for a faster build
7 changes: 7 additions & 0 deletions 404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: content
title: "404: Page not found"
---

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ site.baseurl }}/">Head back home</a> to try finding it again.

9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source "https://rubygems.org"

gem "jekyll", "3.4.3"
gem "html-proofer"
gem "rb-fsevent", "0.9.8"

group :jekyll_plugins do
gem 'jekyll-livereload'
end
88 changes: 88 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
colorator (1.1.0)
colored (1.2)
concurrent-ruby (1.0.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.10.1)
ffi (>= 1.3.0)
eventmachine (1.2.3)
ffi (1.9.18)
forwardable-extended (2.6.0)
html-proofer (3.7.2)
activesupport (>= 4.2, < 6.0)
addressable (~> 2.3)
colored (~> 1.2)
mercenary (~> 0.3.2)
nokogiri (~> 1.7)
parallel (~> 1.3)
typhoeus (~> 0.7)
yell (~> 2.0)
http_parser.rb (0.6.0)
i18n (0.8.4)
jekyll (3.4.3)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-livereload (0.2.2)
em-websocket (~> 0.5)
jekyll (~> 3.0)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.14.0)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.2.0)
minitest (5.10.2)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
parallel (1.11.2)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rb-fsevent (0.9.8)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.24)
thread_safe (0.3.6)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.3)
thread_safe (~> 0.1)
yell (2.0.7)

PLATFORMS
ruby

DEPENDENCIES
html-proofer
jekyll (= 3.4.3)
jekyll-livereload
rb-fsevent (= 0.9.8)

BUNDLED WITH
1.15.1
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2017 Mike JS. Choi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<p align="center">
<img src="./assets/paper-cover-photo.png">
<p align="center">
A minimalistic Jekyll Theme
<br>
<br>
<a href="https://travis-ci.org/mkchoi212/paper-jekyll-theme"><img src="https://travis-ci.org/mkchoi212/paper-jekyll-theme.svg?branch=master"></a>
<a href="https://raw.githubusercontent.com/mkchoi212/paper-jekyll-theme/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
</p>
</p>
<br>

Paper is a minimal Jekyll theme. Perfect for hosting your personal site, blog, or portfolio on GitHub or self-hosting on your own server. The styling is purposely minimalistic so that you can add your own flare to the website.

Live demo of the theme can be seen [here](https://deadbeef.me/paper-jekyll-theme/). I'm also currently using this theme on my [personal blog](https://www.deadbeef.me).

## Features
- Compatible with Jekyll 3.x and Github Pages
- Live local reloading for faster development
- Responsive layout built-in
- Supports Jekyll's built-in Sass/SCSS preprocessor
- Supports Google Analytics
- Minimum Dependencies
- Rakefile for automation
- `rake check` - Check links/html files of the generated site
- `rake clean` - Clean up generated site
- `rake post` - Begin a new post in `./_posts`
- `rake preview` - Preview with livereload on local machine

## Usage
```
git clone https://github.com/mkchoi212/paper-jekyll-theme.git
bundle install
rake preview
```

Then, go to your favorite brower and type in the address `http://127.0.0.1:YOUR_PORT_NUM_HERE` to preview your website.

### Customization
To customize various details - title/description of the website, your SNS accout names, etc - edit the `_config.yml` file.

### Adding posts
```
rake post title="A Title" [date="2012-02-09"] [tags=[tag1,tag2]] [category="category"]
```
This will create a markdown file in the default folder where all posts are stored in Jekyll; `_post`.

If you wish to **change the directory where posts are saved**, go to the `Rakefile` and edit the `CONFIG = { 'posts': CUSTOM_PATH_HERE }`. This will allow `rake post` to know where to save the new posts to.

The **drafts** you are working on can be saved in the `_drafts` directory. When you push your code to the server, files in this directory will NOT be included to the list o posts.

# Licnese
The MIT License (MIT)

Copyright (c) 2017 Mike JS. Choi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

113 changes: 113 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@

#
## Customize post location and post extensions
#

baseurl = `cat ./_config.yml | awk '/baseurl/ { print $2 }' | sed 's/\"//g'`

SOURCE = "."
CONFIG = {
'posts' => File.join(SOURCE, "_posts"),
'post_ext' => "md",
'theme_package_version' => "0.1.0"
}

#
## Color console outout support just because :D
#
module Colors
def colorize(text, color_code)
"\033[#{color_code}m#{text}\033[0m"
end

{
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,
:blue => 34,
:cyan => 36,
}.each do |key, color_code|
define_method key do |text|
colorize(text, color_code)
end
end
end
include Colors

#
## Just typing `rake` will invoke `rake preview`
#
task :default => :preview
load '_rake-configuration.rb' if File.exist?('_rake-configuration.rb')

desc 'Preview with livereload on local machine'
task :preview => :clean do
puts green "Starting livereload server"
jekyll('serve -L')
end
task :serve => :preview

desc 'Clean up generated site'
task :clean do
cleanup
end

desc 'Check links for generated site'
task :check do
STDOUT.sync = true
cleanup
jekyll("build -d _site#{baseurl}")
puts cyan "Running html proofer..."
puts `htmlproofer --assume-extension --alt-ignore '/.*/' ./_site`
end

# Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1,tag2]] [category="category"]
desc "Begin a new post in #{CONFIG['posts']}"
task :post do
abort("rake aborted: '#{CONFIG['posts']}' directory not found.") unless FileTest.directory?(CONFIG['posts'])
title = ENV["title"] || "new-post"
tags = ENV["tags"] || "[]"
category = ENV["category"] || ""
category = "\"#{category.gsub(/-/,' ')}\"" if !category.empty?
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
begin
date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')
rescue => e
puts red "Error - date format must be YYYY-MM-DD, please check you typed it correctly!"
exit -1
end
filename = File.join(CONFIG['posts'], "#{date}-#{slug}.#{CONFIG['post_ext']}")
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end

puts cyan "Creating new post: #{filename}"
open(filename, 'w') do |post|
post.puts "---"
post.puts "layout: post"
post.puts "title: \"#{title.gsub(/-/,' ')}\""
post.puts 'description: ""'
post.puts "category: #{category}"
post.puts "tags: #{tags}"
post.puts "---"
post.puts "{% include JB/setup %}"
end
end # task :post

#
## General support functions
#

def cleanup
sh 'rm -rf _site'
end

def jekyll(directives = '')
sh 'jekyll ' + directives
end

def rake_running
`ps | grep 'rake' | grep -v 'grep' | wc -l`.to_i > 1
end

26 changes: 26 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Site settings
title: "Paper Jekyll Theme"
description: >
Write a description of your website here.
author: Johnny Appleseed
email: [email protected]
twitter_username:
github_username:

baseurl: "/paper-jekyll-theme" # the subpath of your site, e.g. /blog
url: "https://deadbeef.me" # the base hostname & protocol for your site

google_analytics_id: UA-1111111111-1
disqus_id:

# Build settings
include: [_pages]
markdown: kramdown
permalink: /:year/:month/:title

sass:
style: compressed

exclude: [vendor]

13 changes: 13 additions & 0 deletions _includes/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% if site.google_analytics_id %}

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics_id }}', 'auto');
ga('send', 'pageview');
</script>

{% endif %}
18 changes: 18 additions & 0 deletions _includes/disqus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>

/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */

var disqus_config = function () {
this.page.url = {{ page.url }}; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = {{ page.id }}; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://{{ site.disqus_id }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
4 changes: 4 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<footer class="c-page__footer">
<p>&copy; {{ site.author }} {{ 'now' | date: '%Y' }}</p>
<p>{% if site.twitter_username %}<a href="https://twitter.com/{{ site.twitter_username }}">Twitter</a><span class="u-separate"></span>{% endif %}{% if site.github_username %}<a href="https://github.com/{{ site.github_username }}">Github</a>{% endif %}</p>
</footer>
Loading

0 comments on commit 7bae29c

Please sign in to comment.