Permalink
Browse files

initial template based on https://github.com/krisb/jekyll-template

  • Loading branch information...
0 parents commit 70d3b430099bfb56774d7fd62f7222749ffe4221 @jgritman committed Dec 3, 2011
Showing with 630 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +81 −0 README.md
  3. +65 −0 Rakefile
  4. +27 −0 _config.yml
  5. +42 −0 _layouts/default.html
  6. +34 −0 _layouts/post.html
  7. +8 −0 _posts/2010-11-01-first-post.md
  8. +12 −0 _posts/2010-11-10-second-post.md
  9. +100 −0 _sass/mixins/_syntax.scss
  10. +3 −0 _sass/screen.scss
  11. +6 −0 about.md
  12. +27 −0 atom.xml
  13. +7 −0 config.rb
  14. BIN images/grid.png
  15. +24 −0 index.html
  16. +5 −0 robots.txt
  17. +43 −0 sitemap.xml
  18. +143 −0 stylesheets/screen.css
@@ -0,0 +1,3 @@
+_site
+_sass/.sass-cache
+.sass-cache
@@ -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
@@ -0,0 +1,65 @@
+task :default => :server
+
+desc 'Clean up generated site'
+task :clean do
+ cleanup
+end
+
+desc 'Build site with Jekyll'
+task :build => :clean do
+ compass
+ jekyll
+end
+
+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 '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
+
+ 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
@@ -0,0 +1,27 @@
+# standard jekyll configuration
+
+permalink: date
+pygments: true
+exclude: ['Rakefile', 'README.md', 'config.rb']
+markdown: rdiscount
+
+# configuration required for some pages
+
+domain: blog.example.com
+title: My Blog Title
+author: Me
+email: me@example.com
+
+# configuration for ehancements, uncomment to enable
+
+# feedburner:
+# id: feedburnerid
+
+# google_analytics:
+# account: UA-XXXXX-X
+
+# github:
+# username: ghusername
+
+# disqus:
+# id: disqusid
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <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="page">
+ <div id="header">
+ <a href="/"><h1>{{ site.title }}</h1></a>
+ </div>
+ <div id="body">
+ {% if page.title %}<h1>{{ page.title }}</h1>{% endif %}
+ {{ content }}
+ </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>
@@ -0,0 +1,34 @@
+---
+layout: default
+---
+{% if page.date %}<div class="postdate">Posted on {{ page.date | date_to_string }}{% if page.last_updated %}, last updated on {{ page.last_updated | date_to_string }}{% endif %}</div>{% endif %}
+
+<div class="post">
+{{ content }}
+</div>
+
+<div id="related">
+ <h2>Related Posts</h2>
+ <ul class="posts">
+ {% for post in site.related_posts limit:5 %}
+ <li><span>{{ post.date | date_to_string }}</span> - <a href="{{ post.url }}">{{ post.title }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+
+{% if site.disqus %}
+<div id="comments">
+ <h2>Comments</h2>
+ <div id="disqus_thread"></div>
+ <script type="text/javascript">
+ var disqus_identifier = "{{ page.url }}";
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://{{ site.disqus.id }}.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+ </script>
+ <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript={{ site.disqus.id }}">comments powered by Disqus.</a></noscript>
+ <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+</div>
+{% endif %}
@@ -0,0 +1,8 @@
+---
+layout: post
+title: First post
+tags: [first, post, jekyll, rocks]
+last_updated: 2010-10-07
+---
+
+This is the first post. It has been updated since the post so has a last_updated value in the frontmatter.
@@ -0,0 +1,12 @@
+---
+layout: post
+title: Second Post
+tags: [second post]
+---
+
+{% highlight ruby %}
+#!/usr/bin/env ruby
+42.times do
+ puts "Hello World!"
+end
+{% endhighlight %}
@@ -0,0 +1,100 @@
+.highlight {
+ background: #ffffff;
+ .c {
+ color: #999988;
+ font-style: italic; }
+ .err {
+ color: #a61717;
+ background-color: #e3d2d2; }
+ .k, .o {
+ font-weight: bold; }
+ .cm {
+ color: #999988;
+ font-style: italic; }
+ .cp {
+ color: #999999;
+ font-weight: bold; }
+ .c1 {
+ color: #999988;
+ font-style: italic; }
+ .cs {
+ color: #999999;
+ font-weight: bold;
+ font-style: italic; }
+ .gd {
+ color: #000000;
+ background-color: #ffdddd;
+ .x {
+ color: #000000;
+ background-color: #ffaaaa; } }
+ .ge {
+ font-style: italic; }
+ .gr {
+ color: #aa0000; }
+ .gh {
+ color: #999999; }
+ .gi {
+ color: #000000;
+ background-color: #ddffdd;
+ .x {
+ color: #000000;
+ background-color: #aaffaa; } }
+ .go {
+ color: #888888; }
+ .gp {
+ color: #555555; }
+ .gs {
+ font-weight: bold; }
+ .gu {
+ color: #aaaaaa; }
+ .gt {
+ color: #aa0000; }
+ .kc, .kd, .kp, .kr {
+ font-weight: bold; }
+ .kt {
+ color: #445588;
+ font-weight: bold; }
+ .m {
+ color: #009999; }
+ .s {
+ color: #d14; }
+ .na {
+ color: #008080; }
+ .nb {
+ color: #0086B3; }
+ .nc {
+ color: #445588;
+ font-weight: bold; }
+ .no {
+ color: #008080; }
+ .ni {
+ color: #800080; }
+ .ne, .nf {
+ color: #990000;
+ font-weight: bold; }
+ .nn {
+ color: #555555; }
+ .nt {
+ color: #000080; }
+ .nv {
+ color: #008080; }
+ .ow {
+ font-weight: bold; }
+ .w {
+ color: #bbbbbb; }
+ .mf, .mh, .mi, .mo {
+ color: #009999; }
+ .sb, .sc, .sd, .s2, .se, .sh, .si, .sx {
+ color: #d14; }
+ .sr {
+ color: #009926; }
+ .s1 {
+ color: #d14; }
+ .ss {
+ color: #990073; }
+ .bp {
+ color: #999999; }
+ .vc, .vg, .vi {
+ color: #008080; }
+ .il {
+ color: #009999; } }
@@ -0,0 +1,3 @@
+@import "mixins/syntax";
+
+// add your styles, see http://compass-style.org/
@@ -0,0 +1,6 @@
+---
+layout: default
+title: About
+---
+
+All about me and my blog...
Oops, something went wrong.

0 comments on commit 70d3b43

Please sign in to comment.