├── .gitignore ├── README.md ├── Rakefile ├── _config.yml ├── _layouts ├── default.html └── post.html ├── about.md ├── atom.xml ├── index.html ├── robots.txt └── sitemap.xml /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jekyll Template 2 | 3 | This is a minimalist template project for jekyll that you can customise to suit your needs. The idea is to get you up and running with analytics and comments and feedback as quick as possible. 4 | 5 | I suggest you follow the [jekyll quick start instructions](http://jekyllrb.com/) to create your blog and then sync this template over it: 6 | 7 | gem install jekyll 8 | jekyll new my-awesome-site 9 | git clone https://github.com/krisb/jekyll-template.git 10 | rsync -av --progress jekyll-template/ my-awesome-site/ --exclude .git --exclude README.md 11 | cd my-awesome-site 12 | jekyll serve 13 | 14 | ## Markup 15 | 16 | I prefer markdown, but you can use a number of supported markup formats. 17 | 18 | ## Pygments (code highlighting) 19 | 20 | Assuming you have python installed with `easy_install` available: 21 | 22 | sudo easy_install Pygments 23 | 24 | ## Rake tasks 25 | 26 | The following tasks are available (use `rake -T` to list them): 27 | 28 | rake build # Build site with Jekyll 29 | rake check_links # Check links for site already running on localhost:4000 30 | rake clean # Clean up generated site 31 | rake deploy # Build then deploy using rsync 32 | rake server # Start server with --watch 33 | 34 | 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. 35 | 36 | ## Configuration 37 | 38 | There are a number of values in `_config.yml` to customise your site. Change as appropriate. 39 | 40 | Additionally, you can override and add additional values on a per page or post basis by adding variables into the front matter. Support for the following is baked in: 41 | 42 | * last_updated - will render updated date as well as original post date 43 | * superseded - reference to a another post url 44 | 45 | The following enhancements are baked in and enabled if you provide the configuration required. 46 | 47 | * [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 48 | * [Disqus](http://disqus.com/) - comments and feedback 49 | * [Feedburner](http://feedburner.google.com/) - rss feeds 50 | * [Github Ribbon](https://github.com/blog/273-github-ribbons) - fork me on github ribbon 51 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | task :default => :server 2 | 3 | desc 'Clean up generated site' 4 | task :clean do 5 | cleanup 6 | end 7 | 8 | desc 'Build site with Jekyll' 9 | task :build => :clean do 10 | jekyll('build') 11 | end 12 | 13 | desc 'Start server with --watch' 14 | task :server => :clean do 15 | jekyll('serve --watch') 16 | end 17 | 18 | desc 'Build and deploy' 19 | task :deploy => :build do 20 | sh 'rsync -rtzh --progress --delete _site/ username@servername:/var/www/websitename/' 21 | end 22 | 23 | desc 'Check links for site already running on localhost:4000' 24 | task :check_links do 25 | begin 26 | require 'anemone' 27 | root = 'http://localhost:4000/' 28 | Anemone.crawl(root, :discard_page_bodies => true) do |anemone| 29 | anemone.after_crawl do |pagestore| 30 | broken_links = Hash.new { |h, k| h[k] = [] } 31 | pagestore.each_value do |page| 32 | if page.code != 200 33 | referrers = pagestore.pages_linking_to(page.url) 34 | referrers.each do |referrer| 35 | broken_links[referrer] << page 36 | end 37 | end 38 | end 39 | broken_links.each do |referrer, pages| 40 | puts "#{referrer.url} contains the following broken links:" 41 | pages.each do |page| 42 | puts " HTTP #{page.code} #{page.url}" 43 | end 44 | end 45 | end 46 | end 47 | 48 | rescue LoadError 49 | abort 'Install anemone gem: gem install anemone' 50 | end 51 | end 52 | 53 | def cleanup 54 | sh 'rm -rf _site' 55 | end 56 | 57 | def jekyll(opts = '') 58 | sh 'jekyll ' + opts 59 | end 60 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # standard jekyll configuration options 2 | 3 | exclude: ['Rakefile', 'README.md', 'config.rb'] 4 | 5 | # configuration required for some pages 6 | 7 | domain: blog.example.com 8 | title: My Blog Title 9 | author: Me 10 | email: me@example.com 11 | 12 | # configuration for ehancements, uncomment to enable 13 | 14 | # feedburner: 15 | # id: feedburnerid 16 | 17 | # google_analytics: 18 | # account: UA-XXXXX-X 19 | 20 | # github: 21 | # username: ghusername 22 | 23 | # disqus: 24 | # id: disqusid 25 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% if page.title %}{{ page.title }} - {% endif %}{{ site.title }} 5 | {% if page.description %} 6 | 7 | {% endif %} 8 | 9 | 10 | 11 | {% if site.feedburner %} 12 | 13 | {% endif %} 14 | {% if site.google_analytics %} 15 | 16 | 26 | {% endif %} 27 | 28 | 29 |
30 | 33 |
34 | {% if page.title %}

{{ page.title }}

{% endif %} 35 | {{ content }} 36 |
37 |
38 | 39 | {% if site.github %} 40 | Fork me on GitHub 41 | {% endif %} 42 | 43 | 44 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | {% if page.date %}
Posted on {{ page.date | date_to_string }}{% if page.last_updated %}, last updated on {{ page.last_updated | date_to_string }}{% endif %}
{% endif %} 5 | 6 | {% if page.superseded %} 7 | {% for post in site.posts %} 8 | {% if page.superseded == post.url %} 9 |
10 | This guide has been superseded by {{ post.title }} 11 |
12 | {% endif %} 13 | {% endfor %} 14 | {% endif %} 15 | 16 |
17 | {{ content }} 18 |
19 | 20 | 28 | 29 | {% if site.disqus %} 30 |
31 |

Comments

32 |
33 | 41 | 42 | blog comments powered by Disqus 43 |
44 | {% endif %} -------------------------------------------------------------------------------- /about.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: About 4 | --- 5 | 6 | All about me and my blog... 7 | -------------------------------------------------------------------------------- /atom.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: nil 3 | --- 4 | 5 | 6 | 7 | {{ site.title }} 8 | 9 | 10 | {{ site.time | date_to_xmlschema }} 11 | http://{{ site.domain }}/ 12 | 13 | {{ site.author }} 14 | {{ site.email }} 15 | 16 | 17 | {% for post in site.posts %} 18 | 19 | {{ post.title }} 20 | 21 | {{ post.date | date_to_xmlschema }} 22 | http://{{ site.domain }}{{ post.id }} 23 | {{ post.content | xml_escape }} 24 | 25 | {% endfor %} 26 | 27 | 28 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | description: A description about my blog homepage 4 | --- 5 | 6 |
7 |

Blog Posts

8 | 13 |
14 | 15 |
16 |

Pages

17 | 24 |
25 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /sitemap.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: nil 3 | --- 4 | 5 | 6 | 7 | 8 | 9 | http://{{ site.domain }}/ 10 | {{ site.time | date: "%Y-%m-%d" }} 11 | daily 12 | 1.0 13 | 14 | 15 | {% for page in site.posts %} 16 | 17 | http://{{ site.domain }}{{ page.url }} 18 | {% if page.last_updated %} 19 | {{ page.last_updated | date: "%Y-%m-%d" }} 20 | {% elsif page.date %} 21 | {{ page.date | date: "%Y-%m-%d" }} 22 | {% else %} 23 | {{ site.time | date: "%Y-%m-%d" }} 24 | {% endif %} 25 | 26 | {% endfor %} 27 | 28 | {% for page in site.html_pages %} 29 | 30 | http://{{ site.domain }}{{ page.url }} 31 | {% if page.last_updated %} 32 | {{ page.last_updated | date: "%Y-%m-%d" }} 33 | {% elsif page.date %} 34 | {{ page.date | date: "%Y-%m-%d" }} 35 | {% else %} 36 | {{ site.time | date: "%Y-%m-%d" }} 37 | {% endif %} 38 | {% if page.changefreq %}{{ page.changefreq }}{% endif %} 39 | {% if page.priority %}{{ page.priority }}{% endif %} 40 | 41 | {% endfor %} 42 | 43 | 44 | --------------------------------------------------------------------------------