Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
100 changed files
with
1,145 additions
and
1,677 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Jekyll Template | ||
|
||
This is a template project for jekyll that you can clone and customise to suit your needs. Its quite opinionated in what it provides, the idea is to get you up and running with feed support, analytics and comments and feedback. This is meant for a standalone blog, not for [github pages](http://pages.github.com/) | ||
|
||
Please don't fork otherwise I'll see lots of noise on the fork queue that are your customisation for your blog. I suggest you create a repo on github (public or private, its up to you) and do the following assuming the new repo is available at `https://github.com/username/reponame`: | ||
|
||
git clone https://github.com/krisb/jekyll-template.git mysite | ||
cd mysite | ||
rm -rf .git | ||
git init | ||
git add -A | ||
git commit -m 'initial template based on https://github.com/krisb/jekyll-template' | ||
git remote add origin git@github.com:username/reponame.git | ||
git push -u origin master | ||
|
||
The following sections detail how to set up and use the template. The commands are known to work on my macbook, YRMV. | ||
|
||
## Ruby 1.9.2 via RVM | ||
|
||
I recommend that you install [rvm](http://rvm.beginrescueend.com/) and set everything up using that. For single user install run the following: | ||
|
||
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | ||
|
||
Follow the instructions, adding the necessary lines in `.bashrc`, e.g. | ||
|
||
# RVM | ||
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then | ||
source "$HOME/.rvm/scripts/rvm" | ||
fi | ||
|
||
Now source `.bashrc` (you don't need to do this normally as it runs on login, it is just to update the current term window) | ||
|
||
source ~/.bashrc | ||
|
||
You can then install and use ruby 1.9.2: | ||
|
||
rvm install 1.9.2 | ||
rvm use 1.9.2 | ||
|
||
## Gems | ||
|
||
Run the following to install the necessary gems: | ||
|
||
gem install jekyll rdiscount compass | ||
|
||
## Markup | ||
|
||
I prefer markdown, but you can use a number of supported markup formats. | ||
|
||
## Pygments (code highlighting) | ||
|
||
Assuming you have python installed with `easy_install` available: | ||
|
||
sudo easy_install Pygments | ||
|
||
## Stylesheets | ||
|
||
I recommend that you use [compass](http://compass-style.org/). I've included `_sass/mixins/_syntax.scss` for the pygments syntax highlighting. | ||
|
||
## Rake deploy task | ||
|
||
The following tasks are available (use `rake -T` to list them): | ||
|
||
rake build # Build site with Jekyll | ||
rake check_links # Check links for site already running on localhost:4000 | ||
rake clean # Clean up generated site | ||
rake deploy # Build and deploy | ||
rake server # Start server with --auto | ||
|
||
The deploy task is simplistic and uses rsync to copy the generated site to your server. You will need to replace the username, servername and path as appropriate. | ||
|
||
## Configuration | ||
|
||
There are a number of values in `_config.yml` to customise your site. Change as appropriate. | ||
|
||
The following enhancements are baked in and enabled if you provide the configuration required. | ||
|
||
* [Google Analytics](http://www.google.com/analytics) - web analytics using the [async](http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=174090) script | ||
* [Disqus](http://disqus.com/) - comments and feedback | ||
* [Feedburner](http://feedburner.google.com/) - rss feeds | ||
* [Github Ribbon](https://github.com/blog/273-github-ribbons) - fork me on github ribbon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,65 @@ | ||
# Adopted from Scott Kyle's Rakefile | ||
# http://github.com/appden/appden.github.com/blob/master/Rakefile | ||
|
||
task :default => :server | ||
|
||
|
||
desc 'Clean up generated site' | ||
task :clean do | ||
cleanup | ||
end | ||
|
||
desc 'Build site with Jekyll' | ||
task :build do | ||
task :build => :clean do | ||
compass | ||
jekyll | ||
end | ||
|
||
desc 'Build and start server with --auto' | ||
task :server do | ||
jekyll '--server --auto' | ||
|
||
desc 'Start server with --auto' | ||
task :server => :clean do | ||
compass | ||
jekyll('--server --auto') | ||
end | ||
|
||
desc 'Build and deploy' | ||
task :deploy => :build do | ||
sh 'rsync -rtzh --progress --delete _site/ username@servername:/var/www/websitename/' | ||
end | ||
|
||
#desc 'Build and deploy' | ||
#task :deploy => :build do | ||
#sh 'rsync -rtzh --progress --delete _site/ tatey@tatey.com:~/var/www/tatey.com/' | ||
#end | ||
desc 'Check links for site already running on localhost:4000' | ||
task :check_links do | ||
begin | ||
require 'anemone' | ||
root = 'http://localhost:4000/' | ||
Anemone.crawl(root, :discard_page_bodies => true) do |anemone| | ||
anemone.after_crawl do |pagestore| | ||
broken_links = Hash.new { |h, k| h[k] = [] } | ||
pagestore.each_value do |page| | ||
if page.code != 200 | ||
referrers = pagestore.pages_linking_to(page.url) | ||
referrers.each do |referrer| | ||
broken_links[referrer] << page | ||
end | ||
end | ||
end | ||
broken_links.each do |referrer, pages| | ||
puts "#{referrer.url} contains the following broken links:" | ||
pages.each do |page| | ||
puts " HTTP #{page.code} #{page.url}" | ||
end | ||
end | ||
end | ||
end | ||
|
||
def jekyll(opts = '') | ||
rescue LoadError | ||
abort 'Install anemone gem: gem install anemone' | ||
end | ||
end | ||
|
||
def cleanup | ||
sh 'rm -rf _site' | ||
end | ||
|
||
def jekyll(opts = '') | ||
sh 'jekyll ' + opts | ||
end | ||
|
||
def compass(opts = '') | ||
sh 'compass compile -c config.rb --force ' + opts | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
markdown: maruku | ||
permalink: pretty | ||
# standard jekyll configuration | ||
|
||
permalink: date | ||
pygments: true | ||
safe: false | ||
#paginate: 5 | ||
#limit_posts: 5 | ||
exclude: ['Rakefile', 'README.md', 'config.rb'] | ||
markdown: rdiscount | ||
|
||
# configuration required for some pages | ||
|
||
domain: liuzhe0223.github.com | ||
title: Zhe's blog | ||
author: Liu Zhe | ||
email: liuzhe0223@gmail.com | ||
|
||
# configuration for ehancements, uncomment to enable | ||
|
||
# feedburner: | ||
# id: feedburnerid | ||
|
||
# google_analytics: | ||
# account: UA-XXXXX-X | ||
|
||
github: | ||
username: liuzhe0223 | ||
|
||
disqus: | ||
id: liuzhe0223 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{{ page.title }}</title> | ||
<link href="/stylesheets/default.css" rel="stylesheet" type="text/css"> | ||
<link href="/stylesheets/highlight.css" rel="stylesheet" type="text/css"> | ||
<link href="http://liuzhe0223.github.com" rel="alternate" title="zhe's blog" type="application/atom+xml"> | ||
<link href='/images/favicon.ico' rel='shortcut icon' type='image/ico'> | ||
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title> | ||
{% if page.description %} | ||
<meta name="description" content="{{ page.description }}" /> | ||
{% endif %} | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
<link rel="stylesheet" media="screen" href="/stylesheets/screen.css" type="text/css" /> | ||
{% if site.feedburner %} | ||
<link href="http://feeds.feedburner.com/{{ site.feedburner.id }}" rel="alternate" title="{{ site.title }}" type="application/atom+xml" /> | ||
{% endif %} | ||
{% if site.google_analytics %} | ||
<!-- google analytics async --> | ||
<script type="text/javascript"> | ||
var _gaq = _gaq || []; | ||
_gaq.push(['_setAccount', '{{ site.google_analytics.account }}']); | ||
_gaq.push(['_trackPageview']); | ||
(function() { | ||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | ||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | ||
})(); | ||
</script> | ||
{% endif %} | ||
</head> | ||
<body> | ||
<div id="wrap"> | ||
<div class="glow"></div> | ||
<div id="page"> | ||
<div id="header"> | ||
<div class="top"></div> | ||
<div class="content"> | ||
<h1><a href="{{ base.url }}/">zhe<span>.</span>blog</a></h1> | ||
<ul id="nav"> | ||
<li><a href="{{ base.url }}/">Blog</a></li> | ||
<li><a href="{{ base.url }}/config">Config</a></li> | ||
<li><a href="{{ base.url }}/projects">Projects</a></li> | ||
<li><a href="{{ base.url }}/about/">About</a></li> | ||
</ul> | ||
<a href="/"><h1>{{ site.title }}</h1></a> | ||
</div> | ||
<div class="bottom"></div> | ||
<div id="body"> | ||
{% if page.title %}<h1>{{ page.title }}</h1>{% endif %} | ||
{{ content }} | ||
</div> | ||
{{ content }} | ||
</div> | ||
<!--Add you link here--> | ||
<div id="addon"> | ||
<a href="http://github.com/liuzhe0223" id="github"><img src="/images/parallax_octocat.png" alt="Find me on Github"/></a> | ||
</div> | ||
</div> | ||
|
||
{% if site.github %} | ||
<a href="http://github.com/{{ site.github.username }}"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" /></a> | ||
{% endif %} | ||
</body> | ||
</html> |
Oops, something went wrong.