Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge lastest from mojombo/jekyll master

  • Loading branch information...
commit 0fa55418e9f5e1982f00cd801d35f7f2177095ef 2 parents 6eed918 + 6253f79
@edeustace authored
Showing with 4,539 additions and 95 deletions.
  1. +2 −0  .gitignore
  2. +1 −0  .ruby-version
  3. +45 −0 CONTRIBUTING.md
  4. +14 −0 History.txt
  5. +7 −6 README.textile
  6. +66 −0 Rakefile
  7. +3 −3 bin/jekyll
  8. +13 −5 jekyll.gemspec
  9. +25 −21 lib/jekyll.rb
  10. +22 −5 lib/jekyll/converters/markdown.rb
  11. +16 −6 lib/jekyll/convertible.rb
  12. +11 −0 lib/jekyll/filters.rb
  13. +27 −7 lib/jekyll/migrators/posterous.rb
  14. +47 −34 lib/jekyll/post.rb
  15. +7 −2 lib/jekyll/site.rb
  16. +4 −0 site/.gitignore
  17. +1 −0  site/CNAME
  18. +1 −0  site/README
  19. +5 −0 site/_config.yml
  20. +32 −0 site/_includes/analytics.html
  21. +79 −0 site/_includes/docs_contents.html
  22. +15 −0 site/_includes/footer.html
  23. +26 −0 site/_includes/header.html
  24. +22 −0 site/_includes/section_nav.html
  25. +14 −0 site/_includes/top.html
  26. +12 −0 site/_layouts/default.html
  27. +21 −0 site/_layouts/docs.html
  28. +250 −0 site/_posts/2012-07-01-configuration.md
  29. +66 −0 site/_posts/2012-07-01-contributing.md
  30. +108 −0 site/_posts/2012-07-01-deployment-methods.md
  31. +103 −0 site/_posts/2012-07-01-extras.md
  32. +120 −0 site/_posts/2012-07-01-frontmatter.md
  33. +34 −0 site/_posts/2012-07-01-github-pages.md
  34. +8 −0 site/_posts/2012-07-01-heroku.md
  35. +47 −0 site/_posts/2012-07-01-home.md
  36. +43 −0 site/_posts/2012-07-01-installation.md
  37. +180 −0 site/_posts/2012-07-01-migrations.md
  38. +62 −0 site/_posts/2012-07-01-pages.md
  39. +116 −0 site/_posts/2012-07-01-pagination.md
  40. +163 −0 site/_posts/2012-07-01-permalinks.md
  41. +384 −0 site/_posts/2012-07-01-plugins.md
  42. +106 −0 site/_posts/2012-07-01-posts.md
  43. +49 −0 site/_posts/2012-07-01-resources.md
  44. +95 −0 site/_posts/2012-07-01-structure.md
  45. +217 −0 site/_posts/2012-07-01-templates.md
  46. +108 −0 site/_posts/2012-07-01-troubleshooting.md
  47. +35 −0 site/_posts/2012-07-01-usage.md
  48. +166 −0 site/_posts/2012-07-01-variables.md
  49. +62 −0 site/css/grid.css
  50. +504 −0 site/css/normalize.css
  51. +70 −0 site/css/pygments.css
  52. +697 −0 site/css/style.css
  53. +11 −0 site/docs/index.html
  54. BIN  site/favicon.png
  55. BIN  site/img/article-footer.png
  56. BIN  site/img/footer-arrow.png
  57. BIN  site/img/footer-logo.png
  58. BIN  site/img/logo-2x.png
  59. BIN  site/img/octojekyll.png
  60. BIN  site/img/tube.png
  61. BIN  site/img/tube1x.png
  62. +77 −0 site/index.html
  63. +4 −0 site/js/modernizr-2.5.3.min.js
  64. +5 −0 test/fixtures/broken_front_matter1.erb
  65. +4 −0 test/fixtures/broken_front_matter2.erb
  66. +7 −0 test/fixtures/broken_front_matter3.erb
  67. +4 −0 test/fixtures/front_matter.erb
  68. +10 −0 test/helper.rb
  69. +44 −0 test/test_convertible.rb
  70. +20 −2 test/test_redcarpet.rb
  71. +22 −4 test/test_site.rb
View
2  .gitignore
@@ -8,3 +8,5 @@ _site/
.bundle/
.DS_Store
bbin/
+gh-pages/
+site/_site/
View
1  .ruby-version
@@ -0,0 +1 @@
+1.9.3-p362
View
45 CONTRIBUTING.md
@@ -0,0 +1,45 @@
+Contribute
+==========
+
+So you've got an awesome idea to throw into Jekyll. Great! Please keep the following in mind:
+
+* **Contributions will not be accepted without tests.**
+* If you're creating a small fix or patch to an existing feature, just a simple test will do. Please stay in the confines of the current test suite and use [Shoulda](http://github.com/thoughtbot/shoulda/tree/master) and [RR](http://github.com/btakita/rr/tree/master).
+* If it's a brand new feature, make sure to create a new [Cucumber](https://github.com/cucumber/cucumber/) feature and reuse steps where appropriate. Also, whipping up some documentation in your fork's wiki would be appreciated, and once merged it will be transferred over to the main wiki.
+
+Test Dependencies
+-----------------
+
+To run the test suite and build the gem you'll need to install Jekyll's dependencies. Jekyll uses Bundler, so a quick run of the bundle command and you're all set!
+
+ $ bundle
+
+Before you start, run the tests and make sure that they pass (to confirm your environment is configured properly):
+
+ $ rake test
+ $ rake features
+
+Workflow
+--------
+
+Here's the most direct way to get your work merged into the project:
+* Fork the project
+* Clone down your fork ( `git clone git://github.com/<username>/jekyll.git` )
+* Create a topic branch to contain your change ( `git checkout -b my_awesome_feature` )
+* Hack away, add tests. Not necessarily in that order.
+* Make sure everything still passes by running `rake`
+* If necessary, rebase your commits into logical chunks, without errors
+* Push the branch up ( `git push origin my_awesome_feature` )
+* Create an issue with a description and link to your branch
+
+Gotchas
+-------
+
+* If you want to bump the gem version, please put that in a separate commit. This way, the maintainers can control when the gem gets released.
+* Try to keep your patch(es) based from the latest commit on mojombo/jekyll. The easier it is to apply your work, the less work the maintainers have to do, which is always a good thing.
+* Please don't tag your GitHub issue with [fix], [feature], etc. The maintainers actively read the issues and will label it once they come across it.
+
+Finally...
+----------
+
+Thanks! Hacking on Jekyll should be fun, and if for some reason it's a pain to do let us know so we can fix it.
View
14 History.txt
@@ -1,5 +1,15 @@
== HEAD
* Minor Enhancements
+ * Add source and destination directory protection (#535)
+ * Better YAML error message (#718)
+ * Bug Fixes
+ * Prevent custom destination from causing continuous regen (#528)
+ * Site Enhancements
+ * Bring site into master branch with better preview/deploy (#709)
+ * Redesigned site (#583)
+
+== 0.12.0 / 2012-12-22
+ * Minor Enhancements
* Add ability to explicitly specify included files (#261)
* Add --default-mimetype option (#279)
* Allow setting of RedCloth options (#284)
@@ -7,12 +17,16 @@
* Allow multiple plugin dirs to be specified (#438)
* Inline TOC token support for RDiscount (#333)
* Add the option to specify the paginated url format (#342)
+ * Swap out albino for pygments.rb (#569)
+ * Support Redcarpet 2 and fenced code blocks (#619)
+ * Better reporting of Liquid errors (#624)
* Bug Fixes
* Allow some special characters in highlight names
* URL escape category names in URL generation (#360)
* Fix error with limit_posts (#442)
* Properly select dotfile during directory scan (#363, #431, #377)
* Allow setting of Kramdown smart_quotes (#482)
+ * Ensure front-matter is at start of file (#562)
== 0.11.2 / 2011-12-27
* Bug Fixes
View
13 README.textile
@@ -22,19 +22,20 @@ h2. Diving In
h2. Runtime Dependencies
-* RedCloth: Textile support (Ruby)
-* Liquid: Templating system (Ruby)
* Classifier: Generating related posts (Ruby)
-* Maruku: Default markdown engine (Ruby)
* Directory Watcher: Auto-regeneration of sites (Ruby)
+* Kramdown: Markdown-superset converter (Ruby)
+* Liquid: Templating system (Ruby)
+* Maruku: Default markdown engine (Ruby)
* Pygments: Syntax highlighting (Python)
h2. Developer Dependencies
-* Shoulda: Test framework (Ruby)
-* RR: Mocking (Ruby)
-* RedGreen: Nicer test output (Ruby)
* RDiscount: Discount Markdown Processor (Ruby)
+* RedCloth: Textile support (Ruby)
+* RedGreen: Nicer test output (Ruby)
+* RR: Mocking (Ruby)
+* Shoulda: Test framework (Ruby)
h2. License
View
66 Rakefile
@@ -111,6 +111,72 @@ end
#############################################################################
#
+# Site tasks - http://jekyllrb.com
+#
+#############################################################################
+
+namespace :site do
+ desc "Generate and view the site locally"
+ task :preview do
+ require "launchy"
+
+ # Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
+ # then open it in a browser. Someday we can do better than this, I hope.
+ Thread.new do
+ sleep 4
+ puts "Opening in browser..."
+ Launchy.open("http://localhost:4000")
+ end
+
+ # Generate the site in server mode.
+ puts "Running Jekyll..."
+ Dir.chdir("site") do
+ sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} --server"
+ end
+ end
+
+ desc "Commit the local site to the gh-pages branch and publish to GitHub Pages"
+ task :publish do
+ # Failsafe. Remove this once it has been done.
+ puts "Make sure to merge #583 into gh-pages before deploying."
+ exit(1)
+
+ # Ensure the gh-pages dir exists so we can generate into it.
+ puts "Checking for gh-pages dir..."
+ unless File.exist?("./gh-pages")
+ puts "No gh-pages directory found. Run the following commands first:"
+ puts " `git clone git@github.com:mojombo/jekyll gh-pages"
+ puts " `cd gh-pages"
+ puts " `git checkout gh-pages`"
+ exit(1)
+ end
+
+ # Ensure gh-pages branch is up to date.
+ Dir.chdir('gh-pages') do
+ sh "git pull origin gh-pages"
+ end
+
+ # Copy to gh-pages dir.
+ puts "Copying site to gh-pages branch..."
+ Dir.glob("site/*") do |path|
+ next if path == "_site"
+ sh "cp -R #{path} gh-pages/"
+ end
+
+ # Commit and push.
+ puts "Committing and pushing to GitHub Pages..."
+ sha = `git log`.match(/[a-z0-9]{40}/)[0]
+ Dir.chdir('gh-pages') do
+ sh "git add ."
+ sh "git commit -m 'Updating to #{sha}.'"
+ sh "git push origin gh-pages"
+ end
+ puts 'Done.'
+ end
+end
+
+#############################################################################
+#
# Packaging tasks
#
#############################################################################
View
6 bin/jekyll
@@ -229,10 +229,10 @@ source = options['source']
destination = options['destination']
# Files to watch
-def globs(source)
+def globs(source, destination)
Dir.chdir(source) do
dirs = Dir['*'].select { |x| File.directory?(x) }
- dirs -= ['_site']
+ dirs -= [destination]
dirs = dirs.map { |x| "#{x}/**/*" }
dirs += ['*']
end
@@ -249,7 +249,7 @@ if options['auto']
dw = DirectoryWatcher.new(source)
dw.interval = 1
- dw.glob = globs(source)
+ dw.glob = globs(source, destination)
dw.add_observer do |*args|
t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
View
18 jekyll.gemspec
@@ -4,8 +4,9 @@ Gem::Specification.new do |s|
s.rubygems_version = '1.3.5'
s.name = 'jekyll'
- s.version = '0.11.2'
- s.date = '2011-12-27'
+ s.version = '0.12.0'
+ s.license = 'MIT'
+ s.date = '2012-12-22'
s.rubyforge_project = 'jekyll'
s.summary = "A simple, blog aware, static site generator."
@@ -27,7 +28,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('directory_watcher', "~> 1.1")
s.add_runtime_dependency('maruku', "~> 0.5")
s.add_runtime_dependency('kramdown', "~> 0.13.4")
- s.add_runtime_dependency('pygments.rb', "~> 0.2.12")
+ s.add_runtime_dependency('pygments.rb', "~> 0.3.2")
s.add_development_dependency('rake', "~> 0.9")
s.add_development_dependency('rdoc', "~> 3.11")
@@ -37,7 +38,8 @@ Gem::Specification.new do |s|
s.add_development_dependency('cucumber', "1.1")
s.add_development_dependency('RedCloth', "~> 4.2")
s.add_development_dependency('rdiscount', "~> 1.6")
- s.add_development_dependency('redcarpet', "~> 1.9")
+ s.add_development_dependency('redcarpet', "~> 2.1.1")
+ s.add_development_dependency('launchy', "~> 2.1.2")
# = MANIFEST =
s.files = %w[
@@ -74,10 +76,12 @@ Gem::Specification.new do |s|
lib/jekyll/migrators/csv.rb
lib/jekyll/migrators/drupal.rb
lib/jekyll/migrators/enki.rb
+ lib/jekyll/migrators/joomla.rb
lib/jekyll/migrators/marley.rb
lib/jekyll/migrators/mephisto.rb
lib/jekyll/migrators/mt.rb
lib/jekyll/migrators/posterous.rb
+ lib/jekyll/migrators/rss.rb
lib/jekyll/migrators/textpattern.rb
lib/jekyll/migrators/tumblr.rb
lib/jekyll/migrators/typo.rb
@@ -90,6 +94,9 @@ Gem::Specification.new do |s|
lib/jekyll/static_file.rb
lib/jekyll/tags/highlight.rb
lib/jekyll/tags/include.rb
+ lib/jekyll/tags/post_url.rb
+ test/fixtures/broken_front_matter1.erb
+ test/fixtures/front_matter.erb
test/helper.rb
test/source/.htaccess
test/source/_includes/sig.markdown
@@ -132,6 +139,7 @@ Gem::Specification.new do |s|
test/source/z_category/_posts/2008-9-23-categories.textile
test/suite.rb
test/test_configuration.rb
+ test/test_convertible.rb
test/test_core_ext.rb
test/test_filters.rb
test/test_generated_site.rb
@@ -141,9 +149,9 @@ Gem::Specification.new do |s|
test/test_post.rb
test/test_rdiscount.rb
test/test_redcarpet.rb
+ test/test_redcloth.rb
test/test_site.rb
test/test_tags.rb
- test/test_redcloth.rb
]
# = MANIFEST =
View
46 lib/jekyll.rb
@@ -46,47 +46,50 @@ def require_all(path)
require_all 'jekyll/tags'
module Jekyll
- VERSION = '0.11.2'
+ VERSION = '0.12.0'
# Default options. Overriden by values in _config.yml or command-line opts.
- # (Strings rather symbols used for compatability with YAML).
+ # Strings rather than symbols are used for compatability with YAML.
DEFAULTS = {
'safe' => false,
'auto' => false,
'server' => false,
'server_port' => 4000,
- 'source' => Dir.pwd,
- 'destination' => File.join(Dir.pwd, '_site'),
- 'plugins' => File.join(Dir.pwd, '_plugins'),
+ 'source' => Dir.pwd,
+ 'destination' => File.join(Dir.pwd, '_site'),
+ 'plugins' => File.join(Dir.pwd, '_plugins'),
+ 'layouts' => '_layouts',
'keep_files' => ['.git','.svn'],
- 'layouts' => '_layouts',
-
- 'future' => true,
- 'lsi' => false,
- 'pygments' => false,
- 'markdown' => 'maruku',
- 'permalink' => 'date',
- 'include' => ['.htaccess'],
+
+ 'future' => true,
+ 'lsi' => false,
+ 'pygments' => false,
+ 'markdown' => 'maruku',
+ 'permalink' => 'date',
+ 'include' => ['.htaccess'],
'paginate_path' => 'page:num',
- 'markdown_ext' => 'markdown,mkd,mkdn,md',
- 'textile_ext' => 'textile',
+ 'markdown_ext' => 'markdown,mkd,mkdn,md',
+ 'textile_ext' => 'textile',
- 'maruku' => {
+ 'maruku' => {
'use_tex' => false,
'use_divs' => false,
'png_engine' => 'blahtex',
'png_dir' => 'images/latex',
'png_url' => '/images/latex'
},
- 'rdiscount' => {
+
+ 'rdiscount' => {
'extensions' => []
},
- 'redcarpet' => {
+
+ 'redcarpet' => {
'extensions' => []
},
- 'kramdown' => {
+
+ 'kramdown' => {
'auto_ids' => true,
'footnote_nr' => 1,
'entity_output' => 'as_char',
@@ -103,8 +106,9 @@ module Jekyll
'coderay_css' => 'style'
}
},
- 'redcloth' => {
- 'hard_breaks' => true
+
+ 'redcloth' => {
+ 'hard_breaks' => true
}
}
View
27 lib/jekyll/converters/markdown.rb
@@ -8,12 +8,28 @@ class MarkdownConverter < Converter
def setup
return if @setup
- # Set the Markdown interpreter (and Maruku self.config, if necessary)
case @config['markdown']
when 'redcarpet'
begin
require 'redcarpet'
- @redcarpet_extensions = @config['redcarpet']['extensions'].map { |e| e.to_sym }
+
+ @renderer ||= Class.new(Redcarpet::Render::HTML) do
+ def block_code(code, lang)
+ lang = lang && lang.split.first || "text"
+ output = add_code_tags(
+ Pygments.highlight(code, :lexer => lang, :options => { :encoding => 'utf-8' }),
+ lang
+ )
+ end
+
+ def add_code_tags(code, lang)
+ code = code.sub(/<pre>/,'<pre><code class="' + lang + '">')
+ code = code.sub(/<\/pre>/,"</code></pre>")
+ end
+ end
+
+ @redcarpet_extensions = {}
+ @config['redcarpet']['extensions'].each { |e| @redcarpet_extensions[e.to_sym] = true }
rescue LoadError
STDERR.puts 'You are missing a library required for Markdown. Please run:'
STDERR.puts ' $ [sudo] gem install redcarpet'
@@ -30,8 +46,6 @@ def setup
when 'rdiscount'
begin
require 'rdiscount'
-
- # Load rdiscount extensions
@rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym }
rescue LoadError
STDERR.puts 'You are missing a library required for Markdown. Please run:'
@@ -88,7 +102,10 @@ def convert(content)
setup
case @config['markdown']
when 'redcarpet'
- Redcarpet.new(content, *@redcarpet_extensions).to_html
+ @redcarpet_extensions[:fenced_code_blocks] = !@redcarpet_extensions[:no_fenced_code_blocks]
+ @renderer.send :include, Redcarpet::Render::SmartyPants if @redcarpet_extensions[:smart]
+ markdown = Redcarpet::Markdown.new(@renderer.new(@redcarpet_extensions), @redcarpet_extensions)
+ markdown.render(content)
when 'kramdown'
# Check for use of coderay
if @config['kramdown']['use_coderay']
View
22 lib/jekyll/convertible.rb
@@ -25,15 +25,17 @@ def to_s
#
# Returns nothing.
def read_yaml(base, name)
- self.content = File.read(File.join(base, name))
-
begin
- if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
+ self.content = File.read(File.join(base, name))
+
+ if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
self.content = $POSTMATCH
self.data = YAML.load($1)
end
rescue => e
- puts "YAML Exception reading #{name}: #{e.message}"
+ puts "Error reading file #{File.join(base, name)}: #{e.message}"
+ rescue SyntaxError => e
+ puts "YAML Exception reading #{File.join(base, name)}: #{e.message}"
end
self.data ||= {}
@@ -76,9 +78,13 @@ def do_layout(payload, layouts)
payload["pygments_suffix"] = converter.pygments_suffix
begin
- self.content = Liquid::Template.parse(self.content).render(payload, info)
+ self.content = Liquid::Template.parse(self.content).render!(payload, info)
rescue => e
puts "Liquid Exception: #{e.message} in #{self.name}"
+ e.backtrace.each do |backtrace|
+ puts backtrace
+ end
+ abort("Build Failed")
end
self.transform
@@ -94,9 +100,13 @@ def do_layout(payload, layouts)
payload = payload.deep_merge({"content" => self.output, "page" => layout.data})
begin
- self.output = Liquid::Template.parse(layout.content).render(payload, info)
+ self.output = Liquid::Template.parse(layout.content).render!(payload, info)
rescue => e
puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
+ e.backtrace.each do |backtrace|
+ puts backtrace
+ end
+ abort("Build Failed")
end
if layout = layouts[layout.data["layout"]]
View
11 lib/jekyll/filters.rb
@@ -57,6 +57,17 @@ def date_to_xmlschema(date)
date.xmlschema
end
+ # XML escape a string for use. Replaces any special characters with
+ # appropriate HTML entity replacements.
+ #
+ # input - The String to escape.
+ #
+ # Examples
+ #
+ # xml_escape('foo "bar" <baz>')
+ # # => "foo &quot;bar&quot; &lt;baz&gt;"
+ #
+ # Returns the escaped String.
def xml_escape(input)
CGI.escapeHTML(input)
end
View
34 lib/jekyll/migrators/posterous.rb
@@ -1,11 +1,14 @@
require 'rubygems'
require 'jekyll'
require 'fileutils'
-require 'net/http'
+require 'net/https'
+require 'open-uri'
require 'uri'
require "json"
-# ruby -r './lib/jekyll/migrators/posterous.rb' -e 'Jekyll::Posterous.process(email, pass, api_key, blog)'
+# ruby -r './lib/jekyll/migrators/posterous.rb' -e 'Jekyll::Posterous.process(email, pass, api_token, blog, tags_key)'
+# You can find your api token in posterous api page - http://posterous.com/api . Click on any of the 'view token' links to see your token.
+# blog is optional, by default it is the primary one
module Jekyll
module Posterous
@@ -14,6 +17,9 @@ def self.fetch(uri_str, limit = 10)
raise ArgumentError, 'Stuck in a redirect loop. Please double check your email and password' if limit == 0
response = nil
+
+ puts uri_str
+ puts '-------'
Net::HTTP.start('posterous.com') do |http|
req = Net::HTTP::Get.new(uri_str)
req.basic_auth @email, @pass
@@ -23,36 +29,50 @@ def self.fetch(uri_str, limit = 10)
case response
when Net::HTTPSuccess then response
when Net::HTTPRedirection then fetch(response['location'], limit - 1)
+ when Net::HTTPForbidden then
+ retry_after = response.to_hash['retry-after'][0]
+ puts "We have been told to try again after #{retry_after} seconds"
+ sleep(retry_after.to_i + 1)
+ fetch(uri_str, limit - 1)
else response.error!
end
end
- def self.process(email, pass, api_token, blog = 'primary')
+ def self.process(email, pass, api_token, blog = 'primary', tags_key = 'categories')
@email, @pass, @api_token = email, pass, api_token
FileUtils.mkdir_p "_posts"
- posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{@api_token}").body)
+ posts = JSON.parse(self.fetch("/api/2/sites/#{blog}/posts?api_token=#{@api_token}").body)
page = 1
while posts.any?
posts.each do |post|
title = post["title"]
- slug = title.gsub(/[^[:alnum:]]+/, '-').downcase
+ slug = title.gsub(/[^[:alnum:]]+/, '-').gsub(/^-+|-+$/, '').downcase
+ posterous_slug = post["slug"]
date = Date.parse(post["display_date"])
content = post["body_html"]
published = !post["is_private"]
name = "%02d-%02d-%02d-%s.html" % [date.year, date.month, date.day, slug]
+ tags = []
+ post["tags"].each do |tag|
+ tags.push(tag["name"])
+ end
# Get the relevant fields as a hash, delete empty fields and convert
# to YAML for the header
data = {
'layout' => 'post',
'title' => title.to_s,
- 'published' => published
+ 'published' => published,
+ tags_key => tags,
+ 'posterous_url' => post["full_url"],
+ 'posterous_slug' => posterous_slug
}.delete_if { |k,v| v.nil? || v == ''}.to_yaml
# Write out the data and content to file
File.open("_posts/#{name}", "w") do |f|
+ puts name
f.puts data
f.puts "---"
f.puts content
@@ -60,7 +80,7 @@ def self.process(email, pass, api_token, blog = 'primary')
end
page += 1
- posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{@api_token}&page=#{page}").body)
+ posts = JSON.parse(self.fetch("/api/2/sites/#{blog}/posts?api_token=#{@api_token}&page=#{page}").body)
end
end
end
View
81 lib/jekyll/post.rb
@@ -8,12 +8,13 @@ class << self
attr_accessor :lsi
end
+ # Valid post name regex.
MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/
# Post name validator. Post filenames must be like:
- # 2008-11-05-my-awesome-post.textile
+ # 2008-11-05-my-awesome-post.textile
#
- # Returns <Bool>
+ # Returns true if valid, false if not.
def self.valid?(name)
name =~ MATCHER
end
@@ -25,12 +26,13 @@ def self.valid?(name)
attr_reader :name
# Initialize this Post instance.
- # +site+ is the Site
- # +base+ is the String path to the dir containing the post file
- # +name+ is the String filename of the post file
- # +categories+ is an Array of Strings for the categories for this post
#
- # Returns <Post>
+ # site - The Site.
+ # base - The String path to the dir containing the post file.
+ # name - The String filename of the post file.
+ # categories - An Array of Strings for the categories for this post.
+ #
+ # Returns the new Post.
def initialize(site, source, dir, name)
@site = site
@base = File.join(source, dir, '_posts')
@@ -38,10 +40,14 @@ def initialize(site, source, dir, name)
self.categories = dir.split('/').reject { |x| x.empty? }
self.process(name)
- self.read_yaml(@base, name)
+ begin
+ self.read_yaml(@base, name)
+ rescue Exception => msg
+ raise FatalException.new("#{msg} in #{@base}/#{name}")
+ end
- #If we've added a date and time to the yaml, use that instead of the filename date
- #Means we'll sort correctly.
+ # If we've added a date and time to the YAML, use that instead of the
+ # filename date. Means we'll sort correctly.
if self.data.has_key?('date')
# ensure Time via to_s and reparse
self.date = Time.parse(self.data["date"].to_s)
@@ -60,7 +66,10 @@ def initialize(site, source, dir, name)
end
end
- # Spaceship is based on Post#date, slug
+ # Compares Post objects. First compares the Post date. If the dates are
+ # equal, it compares the Post slugs.
+ #
+ # other - The other Post we are comparing to.
#
# Returns -1, 0, 1
def <=>(other)
@@ -71,10 +80,11 @@ def <=>(other)
return cmp
end
- # Extract information from the post filename
- # +name+ is the String filename of the post file
+ # Extract information from the post filename.
+ #
+ # name - The String filename of the post file.
#
- # Returns nothing
+ # Returns nothing.
def process(name)
m, cats, date, slug, ext = *name.match(MATCHER)
self.date = Time.parse(date)
@@ -87,18 +97,17 @@ def process(name)
# The generated directory into which the post will be placed
# upon generation. This is derived from the permalink or, if
# permalink is absent, set to the default date
- # e.g. "/2008/11/05/" if the permalink style is :date, otherwise nothing
+ # e.g. "/2008/11/05/" if the permalink style is :date, otherwise nothing.
#
- # Returns <String>
+ # Returns the String directory.
def dir
File.dirname(url)
end
- # The full path and filename of the post.
- # Defined in the YAML of the post body
- # (Optional)
+ # The full path and filename of the post. Defined in the YAML of the post
+ # body (optional).
#
- # Returns <String>
+ # Returns the String permalink.
def permalink
self.data && self.data['permalink']
end
@@ -116,10 +125,10 @@ def template
end
end
- # The generated relative url of this post
+ # The generated relative url of this post.
# e.g. /2008/11/05/my-awesome-post.html
#
- # Returns <String>
+ # Returns the String URL.
def url
return @url if @url
@@ -146,17 +155,17 @@ def url
@url
end
- # The UID for this post (useful in feeds)
+ # The UID for this post (useful in feeds).
# e.g. /2008/11/05/my-awesome-post
#
- # Returns <String>
+ # Returns the String UID.
def id
File.join(self.dir, self.slug)
end
# Calculate related posts.
#
- # Returns [<Post>]
+ # Returns an Array of related Posts.
def related_posts(posts)
return [] unless posts.size > 1
@@ -176,11 +185,12 @@ def related_posts(posts)
end
end
- # Add any necessary layouts to this post
- # +layouts+ is a Hash of {"name" => "layout"}
- # +site_payload+ is the site payload hash
+ # Add any necessary layouts to this post.
#
- # Returns nothing
+ # layouts - A Hash of {"name" => "layout"}.
+ # site_payload - The site payload hash.
+ #
+ # Returns nothing.
def render(layouts, site_payload)
# construct payload
payload = {
@@ -192,9 +202,10 @@ def render(layouts, site_payload)
end
# Obtain destination path.
- # +dest+ is the String path to the destination dir
#
- # Returns destination file path.
+ # dest - The String path to the destination dir.
+ #
+ # Returns destination file path String.
def destination(dest)
# The url needs to be unescaped in order to preserve the correct filename
path = File.join(dest, CGI.unescape(self.url))
@@ -203,9 +214,10 @@ def destination(dest)
end
# Write the generated post file to the destination directory.
- # +dest+ is the String path to the destination dir
#
- # Returns nothing
+ # dest - The String path to the destination dir.
+ #
+ # Returns nothing.
def write(dest)
path = destination(dest)
FileUtils.mkdir_p(File.dirname(path))
@@ -216,7 +228,7 @@ def write(dest)
# Convert this post into a Hash for use in Liquid templates.
#
- # Returns <Hash>
+ # Returns the representative Hash.
def to_liquid
self.data.deep_merge({
"title" => self.data["title"] || self.slug.split('-').select {|w| w.capitalize! || w }.join(' '),
@@ -230,6 +242,7 @@ def to_liquid
"content" => self.content })
end
+ # Returns the shorthand String identifier of this Post.
def inspect
"<Post: #{self.id}>"
end
View
9 lib/jekyll/site.rb
@@ -72,6 +72,12 @@ def reset
def setup
require 'classifier' if self.lsi
+ # Check that the destination dir isn't the source dir or a directory
+ # parent to the source dir.
+ if self.source =~ /^#{self.dest}/
+ raise FatalException.new "Destination directory cannot be or contain the Source directory."
+ end
+
# If safe mode is off, load in any Ruby files under the plugins
# directory.
unless self.safe
@@ -244,7 +250,6 @@ def cleanup
files.merge(dirs)
obsolete_files = dest_files - files
-
FileUtils.rm_rf(obsolete_files.to_a)
end
@@ -329,7 +334,7 @@ def site_payload
#
# Returns the Array of filtered entries.
def filter_entries(entries)
- entries = entries.reject do |e|
+ entries.reject do |e|
unless self.include.include?(e)
['.', '_', '#'].include?(e[0..0]) ||
e[-1..-1] == '~' ||
View
4 site/.gitignore
@@ -0,0 +1,4 @@
+_site/
+*.swp
+pkg/
+test/
View
1  site/CNAME
@@ -0,0 +1 @@
+jekyllrb.com
View
1  site/README
@@ -0,0 +1 @@
+Jekyll's awesome website.
View
5 site/_config.yml
@@ -0,0 +1,5 @@
+auto: false
+server: true
+permalink: /docs/:categories/:title
+pygments: true
+gauges_id: 503c5af6613f5d0f19000027
View
32 site/_includes/analytics.html
@@ -0,0 +1,32 @@
+{% if site.gauges_id %}
+ <!-- Gauges (http://gaug.es/) -->
+ <script type="text/javascript">
+ var _gauges = _gauges || [];
+ (function() {
+ var t = document.createElement('script');
+ t.type = 'text/javascript';
+ t.async = true;
+ t.id = 'gauges-tracker';
+ t.setAttribute('data-site-id', '{{ site.gauges_id }}');
+ t.src = '//secure.gaug.es/track.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(t, s);
+ })();
+ </script>
+{% endif %}
+
+{% if site.google_analytics_id %}
+ <!-- Google Analytics (http://google.com/analytics) -->
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', '{{ site.google_analytics_id }}']);
+ _gaq.push(['_setDomainName', '{{ site.url }}']); // Multiple sub-domains
+ _gaq.push(['_setAllowLinker', true]); // Multiple TLDs
+ _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 %}
View
79 site/_includes/docs_contents.html
@@ -0,0 +1,79 @@
+<div class="grid2">
+ <aside>
+ <h4>Getting Started</h4>
+ <ul>
+ <li class="{% if page.title == "Welcome" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/home">Welcome</a>
+ </li>
+ <li class="{% if page.title == "Installation" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/installation">Installation</a>
+ </li>
+ <li class="{% if page.title == "Basic Usage" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/usage">Basic Usage</a>
+ </li>
+ <li class="{% if page.title == "Directory structure" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/structure">Directory structure</a>
+ </li>
+ <li class="{% if page.title == "Configuration" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/configuration">Configuration</a>
+ </li>
+ </ul>
+ <h4>Your Content</h4>
+ <ul>
+ <li class="{% if page.title == "Front-matter" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/frontmatter">Front-matter</a>
+ </li>
+ <li class="{% if page.title == "Writing posts" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/posts">Writing posts</a>
+ </li>
+ <li class="{% if page.title == "Creating pages" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/pages">Creating pages</a>
+ </li>
+ <li class="{% if page.title == "Variables" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/variables">Variables</a>
+ </li>
+ <li class="{% if page.title == "Blog migrations" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/migrations">Blog migrations</a>
+ </li>
+ </ul>
+ <h4>Customization</h4>
+ <ul>
+ <li class="{% if page.title == "Templates" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/templates">Templates</a>
+ </li>
+ <li class="{% if page.title == "Permalinks" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/permalinks">Permalinks</a>
+ </li>
+ <li class="{% if page.title == "Pagination" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/pagination">Pagination</a>
+ </li>
+ <li class="{% if page.title == "Plugins" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/plugins">Plugins</a>
+ </li>
+ <li class="{% if page.title == "Extras" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/extras">Extras</a>
+ </li>
+ </ul>
+ <h4>Deployment</h4>
+ <ul>
+ <li class="{% if page.title == "GitHub Pages" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/github-pages">GitHub Pages</a>
+ </li>
+ <li class="{% if page.title == "Deployment methods" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/deployment-methods">Other methods</a>
+ </li>
+ </ul>
+ <h4>Miscellaneous</h4>
+ <ul>
+ <li class="{% if page.title == "Contributing" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/contributing">Contributing</a>
+ </li>
+ <li class="{% if page.title == "Troubleshooting" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/troubleshooting">Troubleshooting</a>
+ </li>
+ <li class="{% if page.title == "Resources" %}current{% endif %}">
+ <a href="{{ site.url }}/docs/resources">Resources</a>
+ </li>
+ </ul>
+ </aside>
+</div>
View
15 site/_includes/footer.html
@@ -0,0 +1,15 @@
+<footer>
+ <div class="content">
+ <div class="grid4 first">
+ <p>By <a href="http://tom.preston-werner.com">Tom Preston-Werner</a>, <a href="http://quaran.to/">Nick Quaranto</a>, and many more <a href="https://github.com/mojombo/jekyll/graphs/contributors">awesome contributors</a>.</p>
+ </div>
+ <div class="grid8 align-right">
+ <p>Proudly hosted by</p>
+ <a href="https://github.com">
+ <img src="{{ site.url }}/img/footer-logo.png" alt="GitHub • Social coding">
+ </a>
+ </div>
+ <div class="clear"></div>
+ </div>
+</footer>
+<div class="clear"></div>
View
26 site/_includes/header.html
@@ -0,0 +1,26 @@
+<header>
+ <div class="content">
+ <div class="grid3 first">
+ <h1>
+ <a href="{{ site.url }}/">
+ <span>Jekyll</span>
+ <img src="{{ site.url }}/img/logo-2x.png" width="249px" height="115px" alt="">
+ </a>
+ </h1>
+ </div>
+ <nav class="grid6">
+ <ul>
+ <li {% if page.overview %}class="current"{% endif %}>
+ <a href="{{ site.url }}/">Overview</a>
+ </li>
+ <li {% unless page.overview %}class="current"{% endunless %}>
+ <a href="{{ site.url }}/docs">Documentation</a>
+ </li>
+ <li class="">
+ <a href="https://github.com/mojombo/jekyll">View on GitHub</a>
+ </li>
+ </ul>
+ </nav>
+ <div class="clear"></div>
+ </div>
+</header>
View
22 site/_includes/section_nav.html
@@ -0,0 +1,22 @@
+<div class="section-nav">
+ <div class="left align-right">
+ {% if page.prev_section != null %}
+ <a href="{{ site.url }}/docs/{{ page.prev_section }}" class="prev">
+ Back
+ </a>
+ {% else %}
+ <span class="prev disabled">Back</span>
+ {% endif %}
+ </div>
+ <div class="right align-left">
+ {% if page.next_section != null %}
+ <a href="{{ site.url }}/docs/{{ page.next_section }}" class="next">
+ Next
+ </a>
+ {% else %}
+ <span class="next disabled">Next</span>
+ {% endif %}
+ </div>
+ <div class="clear"></div>
+</div>
+
View
14 site/_includes/top.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<html lang="en-US">
+<head>
+ <meta charset="UTF-8">
+ <title>{{ page.title }}</title>
+ <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
+ <link href='http://fonts.googleapis.com/css?family=Arizonia' rel='stylesheet' type='text/css'>
+ <link rel="stylesheet" href="{{ site.url }}/css/normalize.css" />
+ <link rel="stylesheet" href="{{ site.url }}/css/grid.css" />
+ <link rel="stylesheet" href="{{ site.url }}/css/style.css" />
+ <link rel="stylesheet" href="{{ site.url }}/css/pygments.css" />
+ <link rel="icon" type="image/x-icon" href="{{ site.url }}/favicon.png" />
+ <script src="{{ site.url }}/js/modernizr-2.5.3.min.js"></script>
+</head>
View
12 site/_layouts/default.html
@@ -0,0 +1,12 @@
+{% include top.html %}
+
+<body>
+ {% include header.html %}
+
+ {{ content }}
+
+ {% include footer.html %}
+ {% include analytics.html %}
+
+</body>
+</html>
View
21 site/_layouts/docs.html
@@ -0,0 +1,21 @@
+---
+layout: default
+---
+
+ <section class="docs">
+ <div class="content">
+
+ <div class="grid10 first">
+ <article>
+ <h1>{{ page.title }}</h1>
+ {{ content }}
+ {% include section_nav.html %}
+ </article>
+ </div>
+
+ {% include docs_contents.html %}
+
+ <div class="clear"></div>
+
+ </div>
+ </section>
View
250 site/_posts/2012-07-01-configuration.md
@@ -0,0 +1,250 @@
+---
+layout: docs
+title: Configuration
+prev_section: structure
+next_section: frontmatter
+---
+
+Jekyll allows you to concoct your sites in any way you can dream up, and it’s thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a `_config.yml` file placed in your site’s root directory, or can be specified as flags for the `jekyll` executable in the terminal.
+
+## Configuration Settings
+
+The table below lists the available settings for Jekyll, and the various <code class="option">options</code> (specifed in the configuration file) and <code class="flag">flags</code> (specified on the command-line) that control them.
+
+<table>
+ <thead>
+ <tr>
+ <th>Setting</th>
+ <th><span class="option">Options</span> and <span class="flag">Flags</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Safe</strong></p>
+ <p class='description'>Disables <a href="../plugins">custom plugins</a>.</p>
+ </td>
+ <td class="align-center">
+ <p><code class="option">safe: [boolean]</code></p>
+ <p><code class="flag">--safe</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Regeneration</strong></p>
+ <p class='description'>Enables or disables Jekyll from recreating the site when files are modified.</p>
+ </td>
+ <td class="align-center">
+ <p><code class="option">auto: [boolean]</code></p>
+ <p><code class="flag">--auto</code></p>
+ <p><code class="flag">--no-auto</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Local Server</strong></p>
+ <p class='description'>Fires up a server that will host your <code>_site</code> directory</p>
+ </td>
+ <td class="align-center">
+ <p><code class="option">server: [boolean]</code></p>
+ <p><code class="flag">--server</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Local Server Port</strong></p>
+ <p class='description'>Changes the port that the Jekyll server will run on</p>
+ </td>
+ <td class="align-center">
+ <p><code class="option">server_port: [integer]</code></p>
+ <p><code class="flag">--server [port]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Base URL</strong></p>
+ <p class='description'>Serve website from a given base URL</p>
+ </td>
+ <td class="align-center">
+ <p><code class="option">baseurl: [BASE_URL]</code></p>
+ <p><code class="flag">--base-url [url]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>URL</strong></p>
+ <p class='description'>Sets <code>site.url</code>, useful for environment switching</p>
+ </td>
+ <td class="align-center">
+ <p><code class="option">url: [URL]</code></p>
+ <p><code class="flag">--url [URL]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Site Destination</strong></p>
+ <p class="description">Changes the directory where Jekyll will write files to</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">destination: [dir]</code></p>
+ <p><code class="flag">jekyll [dest]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Site Source</strong></p>
+ <p class="description">Changes the directory where Jekyll will look to transform files</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">source: [dir]</code></p>
+ <p><code class="flag">jekyll [source] [dest]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Markdown</strong></p>
+ <p class="description">Uses RDiscount or <code>[engine]</code> instead of Maruku.</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">markdown: [engine]</code></p>
+ <p><code class="flag">--rdiscount</code></p>
+ <p><code class="flag">--kramdown</code></p>
+ <p><code class="flag">--redcarpet</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Pygments</strong></p>
+ <p class="description">Enables highlight tag with Pygments.</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">pygments: [boolean]</code></p>
+ <p><code class="flag">--pygments</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Future</strong></p>
+ <p class="description">Publishes posts with a future date</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">future: [boolean]</code></p>
+ <p><code class="flag">--no-future</code></p>
+ <p><code class="flag">--future</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>LSI</strong></p>
+ <p class="description">Produces an index for related posts.</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">lsi: [boolean]</code></p>
+ <p><code class="flag">--lsi</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Permalink</strong></p>
+ <p class="description">Controls the URLs that posts are generated with. Please refer to the <a href="../permalinks">Permalinks</a> page for more info.</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">permalink: [style]</code></p>
+ <p><code class="flag">--permalink=[style]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Pagination</strong></p>
+ <p class="description">Splits your posts up over multiple subdirectories called "page2", "page3", ... "pageN"</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">paginate: [per_page]</code></p>
+ <p><code class="flag">--paginate [per_page]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Exclude</strong></p>
+ <p class="description">A list of directories and files to exclude from the conversion</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">exclude: [dir1, file1, dir2]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Include</strong></p>
+ <p class="description">A list of directories and files to specifically include in the conversion. <code>.htaccess</code> is a good example since dotfiles are excluded by default.</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">include: [dir1, file1, dir2]</code></p>
+ </td>
+ </tr>
+ <tr class='setting'>
+ <td>
+ <p class='name'><strong>Limit Posts</strong></p>
+ <p class="description">Limits the number of posts to parse and publish</p>
+ </td>
+ <td class='align-center'>
+ <p><code class="option">limit_posts: [max_posts]</code></p>
+ <p><code class="flag">--limit_posts=[max_posts]</code></p>
+ </td>
+ </tr>
+
+ </tbody>
+</table>
+
+<div class="note warning">
+ <h5>Do not use tabs in configuration files</h5>
+ <p>This will either lead to parsing errors, or Jekyll will revert to the default settings. Use spaces instead.</p>
+</div>
+
+## Default Configuration
+
+Jekyll runs with the following configuration options by default. Unless alternative settings for these options are explicitly specified in the configuration file or on the command-line, Jekyll will run using these options.
+
+{% highlight yaml %}
+safe: false
+auto: false
+server: false
+server_port: 4000
+baseurl: /
+url: http://localhost:4000
+
+source: .
+destination: ./_site
+plugins: ./_plugins
+
+future: true
+lsi: false
+pygments: false
+markdown: maruku
+permalink: date
+
+maruku:
+ use_tex: false
+ use_divs: false
+ png_engine: blahtex
+ png_dir: images/latex
+ png_url: /images/latex
+
+rdiscount:
+ extensions: []
+
+kramdown:
+ auto_ids: true,
+ footnote_nr: 1
+ entity_output: as_char
+ toc_levels: 1..6
+ use_coderay: false
+
+ coderay:
+ coderay_wrap: div
+ coderay_line_numbers: inline
+ coderay_line_numbers_start: 1
+ coderay_tab_width: 4
+ coderay_bold_every: 10
+ coderay_css: style
+
+{% endhighlight %}
View
66 site/_posts/2012-07-01-contributing.md
@@ -0,0 +1,66 @@
+---
+layout: docs
+title: Contributing
+prev_section: deployment-methods
+next_section: troubleshooting
+---
+
+Contributions to Jekyll are always welcome, however there’s a few things that you should keep in mind to improve your chances of having your changes merged in.
+
+## Workflow
+
+Here’s the most typical way to get your change merged into the project:
+
+1. Fork the project [on GitHub](https://github.com/mojombo/jekyll) and clone it down to your local machine.
+2. Create a topic branch to contain your change.
+3. Hack away, add tests. Not necessarily in that order.
+4. Make sure all the existing tests still pass.
+5. If necessary, rebase your commits into logical chunks, without errors.
+6. Push the branch up to your fork on GitHub.
+7. Create an issue on GitHub with a link to your branch.
+
+<div class="note warning">
+ <h5>Contributions will not be accepted without tests</h5>
+ <p>If you’re creating a small fix or patch to an existing feature, just
+ a simple test will do.</p>
+</div>
+
+## Tests
+
+We’re big on tests, so please be sure to include them. Please stay in the confines of the current test suite and use [Shoulda](https://github.com/thoughtbot/shoulda) and [RR](https://github.com/btakita/rr).
+
+### Tests for brand-new features
+
+If it’s a brand new feature, make sure to create a new [Cucumber](https://github.com/cucumber/cucumber/) feature and reuse steps where appropriate. Also, whipping up some documentation in your fork’s `gh-pages` branch would be appreciated, so the main website can be updated as soon as your new feature is merged.
+
+### Test dependencies
+
+To run the test suite and build the gem you’ll need to install Jekyll’s dependencies. Jekyll uses Bundler, so a quick run of the bundle command and you’re all set!
+
+{% highlight bash %}
+$ bundle
+{% endhighlight %}
+
+Before you start, run the tests and make sure that they pass (to confirm
+your environment is configured properly):
+
+{% highlight bash %}
+$ rake test
+$ rake features
+{% endhighlight %}
+
+## Common Gotchas
+
+- If you want to bump the gem version, please put that in a separate
+ commit. This way, the maintainers can control when the gem gets released.
+- Try to keep your patch(es) based from [the latest commit on
+ mojombo/jekyll](https://github.com/mojombo/jekyll/commits/master). The easier it is to apply your work, the less work
+ the maintainers have to do, which is always a good thing.
+- Please don’t tag your GitHub issue with labels like “fix” or “feature”.
+ The maintainers actively read the issues and will label it once they come
+ across it.
+
+<div class="note">
+ <h5>Let us know what could be better!</h5>
+ <p>Both using and hacking on Jekyll should be fun, simple, and easy, so if for some reason you find it’s a pain, please <a href="https://github.com/mojombo/jekyll/issues/new">create an issue</a> on GitHub describing your experience so we can make it better.</p>
+</div>
View
108 site/_posts/2012-07-01-deployment-methods.md
@@ -0,0 +1,108 @@
+---
+layout: docs
+title: Deployment methods
+prev_section: github-pages
+next_section: contributing
+---
+
+Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below.
+
+## Web hosting providers (FTP)
+
+Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll` command and copy the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
+
+### FTP using Glynn
+
+There is a project called [Glynn](https://github.com/dmathieu/glynn), which lets you easily generate your Jekyll powered website’s static files and
+send them to your host through FTP.
+
+## Self-managed web server
+
+If you have direct access yourself to the deployment web server yourself, the process is essentially the same, except you might have other methods available to you (such as `scp`, or even direct filesystem access) for transferring the files. Just remember to make sure the contents of the generated `_site` folder get placed in the appropriate web root directory for your web server.
+
+## Automated methods
+
+There are also a number of ways to easily automate the deployment of a Jekyll site. If you’ve got another method that isn’t listed below, we’d love it if you [contributed](../contributing) so that everyone else can benefit too.
+
+### Git post-update hook
+
+If you store your jekyll site in [Git](http://git-scm.com/) (you are using version control, right?), it’s pretty easy to automate the
+deployment process by setting up a post-update hook in your Git
+repository, [like
+this](http://web.archive.org/web/20091223025644/http://www.taknado.com/en/2009/03/26/deploying-a-jekyll-generated-site/).
+
+### Git post-receive hook
+
+To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
+
+{% highlight bash %}
+laptop$ ssh deployer@myserver.com
+server$ mkdir myrepo.git
+server$ cd myrepo.git
+server$ git --bare init
+server$ cp hooks/post-receive.sample hooks/post-receive
+server$ mkdir /var/www/myrepo
+{% endhighlight %}
+
+Next, add the following lines to hooks/post-receive and be sure Jekyll is
+installed on the server:
+
+{% highlight bash %}
+GIT_REPO=$HOME/myrepo.git
+TMP_GIT_CLONE=$HOME/tmp/myrepo
+PUBLIC_WWW=/var/www/myrepo
+
+git clone $GIT_REPO $TMP_GIT_CLONE
+jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
+rm -Rf $TMP_GIT_CLONE
+exit
+{% endhighlight %}
+
+Finally, run the following command on any users laptop that needs to be able to
+deploy using this hook:
+
+{% highlight bash %}
+laptops$ git remote add deploy deployer@myserver.com:~/myrepo.git
+{% endhighlight %}
+
+Deploying is now as easy as telling nginx or Apache to look at
+`/var/www/myrepo` and running the following:
+
+{% highlight bash %}
+laptops$ git push deploy master
+{% endhighlight %}
+
+### Rake
+
+Another way to deploy your Jekyll site is to use [Rake](https://github.com/jimweirich/rake), [HighLine](https://github.com/JEG2/highline), and
+[Net::SSH](http://net-ssh.rubyforge.org/). A more complex example of deploying Jekyll with Rake that deals with multiple branches can be found in [Git Ready](https://github.com/gitready/gitready/blob/en/Rakefile).
+
+### rsync
+
+Once you’ve generated the `_site` directory, you can easily rsync it using a `tasks/deploy` shell script similar to [this deploy script here](http://github.com/henrik/henrik.nyh.se/blob/master/tasks/deploy). You’d obviously need to change the values to reflect your site’s details. There is even [a matching TextMate command](http://gist.github.com/214959) that will help you run
+this script from within Textmate.
+
+
+## Rack-Jekyll
+
+[Rack-Jekyll](http://github.com/bry4n/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](http://github.com/rtomakyo/shotgun/), [rackup](http://github.com/rack/rack), [mongrel](http://github.com/mongrel/mongrel), [unicorn](http://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
+
+Read [this post](http://blog.crowdint.com/2010/08/02/instant-blog-using-jekyll-and-heroku.html) on how to deploy to Heroku using Rack-Jekyll.
+
+## Jekyll-Admin for Rails
+
+If you want to maintain Jekyll inside your existing Rails app, [Jekyll-Admin](http://github.com/zkarpinski/Jekyll-Admin) contains drop in code to make this possible. See Jekyll-Admin’s [README](http://github.com/zkarpinski/Jekyll-Admin/blob/master/README) for more details.
+
+## Amazon S3
+
+If you want to host your site in Amazon S3, you can do so with
+[jekyll-s3](https://github.com/laurilehmijoki/jekyll-s3) application. It will
+push your site to Amazon S3 where it can be served like any web server,
+dynamically scaling to almost unlimited traffic. This approach has the
+benefit of being about the cheapest hosting option available for
+low-volume blogs as you only pay for what you use.
+
+<div class="note">
+ <h5>ProTip™: Use GitHub Pages for zero-hassle Jekyll hosting</h5>
+ <p>GitHub Pages are powered by Jekyll behind the scenes, so if you’re looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to <a href="../github-pages">host your Jekyll-powered website for free</a>.</p>
+</div>
View
103 site/_posts/2012-07-01-extras.md
@@ -0,0 +1,103 @@
+---
+layout: docs
+title: Extras
+prev_section: plugins
+next_section: github-pages
+---
+
+There are a number of (optional) extra features that Jekyll supports that you may want to install, depending on how you plan to use Jekyll.
+
+## Pygments
+
+If you want syntax highlighting via the `{{ "{% highlight " }}%}` tag in your
+posts, you’ll need to install [Pygments](http://pygments.org/).
+
+### Installing Pygments on OSX
+
+Mac OS X (Leopard onwards) come preinstalled with Python, so on just about any OS X machine you can install Pygments simply by running:
+
+{% highlight bash %}
+sudo easy_install Pygments
+{% endhighlight %}
+
+#### Installing Pygments using Homebrew
+
+Alternatively, you can install Pygments with [Homebrew](http://mxcl.github.com/homebrew/), an excellent package manager for OS X:
+{% highlight bash %}
+brew install python
+# export PATH="/usr/local/share/python:${PATH}"
+easy_install pip
+pip install --upgrade distribute
+pip install pygments
+{% endhighlight %}
+
+**ProTip™**: Homebrew doesn’t symlink the executables for you. For the Homebrew default Cellar location and Python 2.7, be sure to add `/usr/local/share/python` to your `PATH`. For more information, check out [the Homebrew wiki](https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python).
+
+#### Installing Pygments using MacPorts
+
+If you use MacPorts, you can install Pygments by running:
+
+{% highlight bash %}
+sudo port install python25 py25-pygments
+{% endhighlight %}
+
+Seriously though, you should check out [Homebrew](http://mxcl.github.com/homebrew/)—it’s awesome.
+
+
+### Installing Pygments on Arch Linux
+
+You can install Pygments using the pacman package manager as follows:
+
+{% highlight bash %}
+sudo pacman -S python-pygments
+{% endhighlight %}
+
+Or to use python2 for Pygments:
+{% highlight bash %}
+sudo pacman -S python2-pygments
+{% endhighlight %}
+
+### Installing Pygments on Ubuntu and Debian
+
+{% highlight bash %}
+sudo apt-get install python-pygments
+{% endhighlight %}
+
+### Installing Pygments on RedHat, Fedora, and CentOS
+
+{% highlight bash %}
+sudo yum install python-pygments
+{% endhighlight %}
+
+### Installing Pygments on Gentoo
+
+{% highlight bash %}
+sudo emerge -av dev-python/pygments
+{% endhighlight %}
+
+## LaTeX Support
+
+Maruku comes with optional support for LaTeX to PNG rendering via
+blahtex (Version 0.6) which must be in your `$PATH` along with `dvips`. If you need Maruku to not assume a fixed location for `dvips`, check out [Remi’s Maruku fork](http://github.com/remi/maruku).
+
+## RDiscount
+
+If you prefer to use [RDiscount](http://github.com/rtomayko/rdiscount) instead of [Maruku](http://maruku.rubyforge.org/) for markdown, just make sure you have it installed:
+
+{% highlight bash %}
+sudo gem install rdiscount
+{% endhighlight %}
+
+And then run Jekyll with the following option:
+
+{% highlight bash %}
+jekyll --rdiscount
+{% endhighlight %}
+
+Or, specify RDiscount as the markdown engine in your `_config.yml` file to have Jekyll run with that option by default (so you don’t have to specify the flag every time).
+
+{% highlight bash %}
+# In _config.yml
+markdown: rdiscount
+{% endhighlight %}
+
View
120 site/_posts/2012-07-01-frontmatter.md
@@ -0,0 +1,120 @@
+---
+layout: docs
+title: Front-matter
+prev_section: configuration
+next_section: posts
+---
+
+The front-matter is where Jekyll starts to get really cool. Any files that contain a [YAML](http://yaml.org/) front matter block will be processed by Jekyll as special files. The front matter must be the first thing in the file and must take the form of sets of variables and values set between triple-dashed lines. Here is a basic example:
+
+{% highlight yaml %}
+---
+layout: post
+title: Blogging Like a Hacker
+---
+{% endhighlight %}
+
+Between these triple-dashed lines, you can set predefined variables (see below for a reference) or even create custom ones of your own. These variables will then be available to you to access using Liquid tags both further down in the file and also in any layouts or includes that the page or post in question relies on.
+
+<div class="note warning">
+ <h5>UTF-8 Character Encoding Warning</h5>
+ <p>If you use UTF-8 encoding, make sure that no <code>BOM</code> header characters exist in your files or very, very bad things will happen to Jekyll. This is especially relevant if you’re running Jekyll on Windows.</p>
+</div>
+
+## Predefined Global Variables
+
+There are a number of predefined global variables that you can set in the front-matter of a page or post.
+
+<table>
+ <thead>
+ <tr>
+ <th>Variable</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p><code>layout</code></p>
+ </td>
+ <td>
+ <p>If set, this specifies the layout file to use. Use the layout file name without file extension. Layout files must be placed in the <code>_layouts</code> directory.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p><code>permalink</code></p>
+ </td>
+ <td>
+ <p>If you need your processed URLs to be something other than the default <code>/year/month/day/title.html</code> then you can set this variable and it will be used as the final URL.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p><code>published</code></p>
+ </td>
+ <td>
+ <p>Set to false if you don’t want a post to show up when the site is generated.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p style="margin-bottom: 5px;"><code>category</code></p>
+ <p><code>categories</code></p>
+ </td>
+ <td>
+ <p>Instead of placing posts inside of folders, you can specify one or more categories that the post belongs to. When the site is generated the post will act as though it had been set with these categories normally. Categories (plural key) can be specified as a <a href="http://en.wikipedia.org/wiki/YAML#Lists">YAML list</a> or a space-separated string.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p><code>tags</code></p>
+ </td>
+ <td>
+ <p>Similar to categories, one or multiple tags can be added to a post. Also like categories, tags can be specified as a YAML list or a space-separated string.</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+
+## Custom Variables
+
+Any variables in the front matter that are not predefined are mixed into
+the data that is sent to the Liquid templating engine during the
+conversion. For instance, if you set a title, you can use that in your
+layout to set the page title:
+
+{% highlight html %}
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>{{ "{{ page.title " }}}}</title>
+ </head>
+ <body>
+ ...
+{% endhighlight %}
+
+## Predefined Variables for Posts
+
+These are available out-of-the-box to be used in the front-matter for a
+post.
+
+<table>
+ <thead>
+ <tr>
+ <th>Variable</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p><code>date</code></p>
+ </td>
+ <td>
+ <p>A date here overrides the date from the name of the post. This can be used to ensure correct sorting of posts.</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
View
34 site/_posts/2012-07-01-github-pages.md
@@ -0,0 +1,34 @@
+---
+layout: docs
+title: GitHub Pages
+prev_section: extras
+next_section: deployment-methods
+---
+
+[GitHub Pages](https://pages.github.com) are public web pages for users, organizations, and repositories, that are freely hosted on [GitHub](https://github.com/). GitHub Pages are powered by Jekyll behind the scenes, so in addition to supporting regular HTML content, they’re also a great way to host your Jekyll-powered website for free.
+
+## Deploying Jekyll to GitHub Pages
+
+GitHub Pages work by looking at certain branches of repositories on GitHub. There are two basic types of Pages available, user/organization Pages and project Pages. The way to deploy these two types of pages are nearly identical, except for a few minor details.
+
+### User and Organization Pages
+
+User and organization Pages live in a special GitHub repository dedicated to only the Pages files. This repository must be named after the account name. For example, [@mojombo’s user page repository](https://github.com/mojombo/mojombo.github.com) has the name `mojombo.github.com`.
+
+Content from the `master` branch of your repository will be used to build and publish the GitHub Pages site, so make sure your Jekyll site is stored there.
+
+<div class="note info">
+ <h5>Custom domains do not affect repository names</h5>
+ <p>GitHub Pages are initially configured to live under the `username.github.com` subdomain, which is why repositories must be named this way <strong>even if a custom domain is being used</strong>.</p>
+</div>
+
+### Project Pages
+
+Unlike user and organization Pages, Project Pages are kept in the same repository as the project they are for, except that the website content is stored in a specially named `gh-pages` branch. The content of this branch will be used to rendered using Jekyll, and the output will become available under a subpath of your user pages subdomain, such as `username.github.com/project` (unless a custom domain is specified—see below).
+
+The Jekyll project repository itself is a perfect example of this branch structure—the [master branch](https://github.com/mojombo/jekyll) contains the actual software project for Jekyll, however the Jekyll website (that you’re looking at right now) is contained in the [gh-pages branch](https://github.com/mojombo/jekyll/tree/gh-pages) of the same repository.
+
+<div class="note">
+ <h5>GitHub Pages Documentation, Help, and Support</h5>
+ <p>For more information about what you can do with GitHub Pages, as well as for troubleshooting guides, you should check out <a href="https://help.github.com/categories/20/articles">GitHub’s Pages Help section</a>. If all else fails, you should contact <a href="https://github.com/contact">GitHub Support</a>.</p>
+</div>
View
8 site/_posts/2012-07-01-heroku.md
@@ -0,0 +1,8 @@
+---
+layout: docs
+title: Heroku
+prev_section: github-pages
+next_section: manual-deployment
+---
+
+Move along, people. Nothing to see here.
View
47 site/_posts/2012-07-01-home.md
@@ -0,0 +1,47 @@
+---
+layout: docs
+title: Welcome
+next_section: installation
+---
+
+This site aims to be a comprehensive guide to Jekyll. We’ll cover everything from getting your site up and running, creating and managing your content, customizing the way your site works and looks, deploying to various environments, as well as some advice on participating in the future development of Jekyll itself.
+
+## So what is Jekyll, exactly?
+
+Jekyll is a simple, blog-aware, static site generator. It takes a template directory containing raw text files in various formats, runs it through [Markdown](http://daringfireball.net/projects/markdown/) (or [Textile](http://textile.sitemonks.com/)) and [Liquid](http://liquidmarkup.org/) converters, and spits out a complete, ready-to-publish static website suitable for serving with your favorite web server. Jekyll also happens to be the engine behind [GitHub Pages](http://pages.github.com), which means you can use Jekyll to host your project’s page, blog, or website from GitHub’s servers **for free**.
+
+## Quick-start guide
+
+For the impatient, here's how to get Jekyll up and running.
+
+{% highlight bash %}
+~ $ gem install jekyll
+~ $ mkdir -p my/new/site
+~ $ cd my/new/site
+~ $ vim index.html
+~/my/new/site $ jekyll --server
+# => Now browse to http://localhost:4000
+{% endhighlight %}
+
+That's nothing though. The real magic happens when you start creating posts, using the front-matter to conrol templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available.
+
+## ProTips™, Notes, and Warnings
+
+Throughout this guide there are a number of small-but-handy pieces of information that can make using Jekyll easier, more interesting, and less hazardous. Here’s what to look out for.
+
+<div class="note">
+ <h5>ProTips™ help you get more from Jekyll</h5>
+ <p>These are tips and tricks that will help you be a Jekyll wizard!</p>
+</div>
+
+<div class="note info">
+ <h5>Notes are handy pieces of information</h5>
+ <p>These are for the extra tidbits sometimes necessary to understand Jekyll.</p>
+</div>
+
+<div class="note warning">
+ <h5>Warnings help you not blow things up</h5>
+ <p>Be aware of these messages if you wish to avoid certain death.</p>
+</div>
+
+If you come across anything along the way that we haven’t covered, or if you know of a tip yourself you think others would find handy, please [file an issue](https://github.com/mojombo/jekyll/issues/new) and we’ll see about including it in this guide.
View
43 site/_posts/2012-07-01-installation.md
@@ -0,0 +1,43 @@
+---
+layout: docs
+title: Installation
+prev_section: home
+next_section: usage
+---
+
+Getting Jekyll installed and ready-to-go should only take a few minutes. If it ever becomes a pain in the ass, you should [file an issue](https://github.com/mojombo/jekyll/issues/new) (or submit a pull request) about what might be a better way to do things.
+
+### Requirements
+
+Installing Jekyll is easy and straight-forward, but there’s a few requirements you’ll need to make sure your system has before you start.
+
+- [Ruby](http://www.ruby-lang.org/en/downloads/)
+- [RubyGems](http://rubygems.org/pages/download)
+- Linux, Unix, or Mac OS X
+
+<div class="note info">
+ <h5>Running Jekyll on Windows</h5>
+ <p>It is possible to get <a href="http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html">Jekyll running on Windows</a> however the official documentation does not support installation on Windows platforms.</p>
+</div>
+
+## Install with RubyGems
+
+The best way to install Jekyll is via
+[RubyGems](http://docs.rubygems.org/read/chapter/3). At the terminal prompt, simply run the following command to install Jekyll:
+
+{% highlight bash %}
+gem install jekyll
+{% endhighlight %}
+
+All Jekyll’s gem dependancies are automatically installed by the above command, so you won’t have to worry about them at all. If you have problems installing Jekyll, check out the [troubleshooting](../troubleshooting) page or [report an issue](https://github.com/mojombo/jekyll/issues/new) so the Jekyll community can improve the experience for everyone.
+
+## Optional Extras
+
+There are a number of (optional) extra features that Jekyll supports that you may want to install, depending on how you plan to use Jekyll. These extras include syntax highlighting of code snippets using [Pygments](http://pygments.org/), LaTeX support, and the use of alternative content rendering engines. Check out [the extras page](../extras) for more information.
+
+<div class="note">
+ <h5>ProTip™: Enable Syntax Highlighting</h5>
+ <p>If you’re the kind of person who is using Jekyll, then chances are you’ll definitely want to enable syntax highlighting using Pygments. You should really <a href="../extras">check out how to do that</a> before you go any further.</p>
+</div>
+
+Now that you’ve got everything installed, let’s get to work!
View
180 site/_posts/2012-07-01-migrations.md
@@ -0,0 +1,180 @@
+---
+layout: docs
+title: Blog migrations
+prev_section: variables
+next_section: templates
+---
+
+If you’re switching to Jekyll from another blogging system, Jekyll’s migrators can help you with the move. Most methods listed on this page require read access to the database to generate posts from your old system. Each method generates `.markdown` posts in the `_posts` directory based on the entries in the database.
+
+## Preparing for migrations
+
+The migrators are [built-in to the Jekyll gem](https://github.com/mojombo/jekyll/tree/master/lib/jekyll/migrators), and require a few things to be set up in your project directory before they are run. This should all be done from the root folder of your Jekyll project.
+
+{% highlight bash %}
+$ mkdir _import
+$ gem install sequel mysqlplus
+{% endhighlight %}
+
+You should now be all set to run the migrators below.
+
+<div class="note info">
+ <h5>Note: Always double-check migrated content</h5>
+ <p>Import scripts may not distinguish between published or private posts, so you should always check that the content Jekyll generates for you appears as you intended.</p>
+</div>
+
+## WordPress
+
+### Wordpress export files
+
+If hpricot is not already installed, you will need to run `gem install hpricot`. Next, export your blog using the Wordpress export utility. Assuming that exported file is saved as `wordpress.xml`, here is the command you need to run:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/wordpressdotcom";
+ Jekyll::WordpressDotCom.process("wordpress.xml")'
+{% endhighlight %}
+
+<div class="note">
+ <h5>ProTip™: Wordpress.com Export Tool</h5>
+ <p>If you are migrating from a Wordpress.com account, you can access the export tool at the following URL: `https://YOUR-USER-NAME.wordpress.com/wp-admin/export.php`.</p>
+</div>
+
+### Using Wordpress MySQL server connection
+
+If you want to import using a direct connection to the Wordpress MySQL server, here's how:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/wordpress";
+ Jekyll::WordPress.process("database", "user", "pass")'
+{% endhighlight %}
+
+If you are using Webfaction and have to set an [SSH tunnel](http://docs.webfaction.com/user-guide/databases.html?highlight=mysql#starting-an-ssh-tunnel-with-ssh), make sure to make the hostname (`127.0.0.1`) explicit, otherwise MySQL may block your access based on localhost and `127.0.0.1` not being equivalent in its authentication system:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/wordpress";
+ Jekyll::WordPress.process("database", "user", "pass", "127.0.0.1")'
+{% endhighlight %}
+
+### Further Wordpress migration alternatives
+
+While the above methods work, they do not import much of the metadata that is usually stored in Wordpress posts and pages. If you need to export things like pages, tags, custom fields, image attachments and so on, the following resources might be useful to you:
+
+- [Exitwp](https://github.com/thomasf/exitwp) is a configurable tool written in Python for migrating one or more Wordpress blogs into Jekyll (Markdown) format while keeping as much metadata as possible. Exitwp also downloads attachments and pages.
+- [A great article](http://vitobotta.com/how-to-migrate-from-wordpress-to-jekyll/) with a step-by-step guide for migrating a Wordpress blog to Jekyll while keeping most of the structure and metadata.
+- [wpXml2Jekyll](https://github.com/theaob/wpXml2Jekyll) is an executable windows application for creating Markdown posts from your Wordpress XML file.
+
+## Drupal
+
+If you’re migrating from [Drupal](), there is [a migrator](https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/drupal.rb) for you too:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/drupal";
+ Jekyll::Drupal.process("database", "user", "pass")'
+{% endhighlight %}
+
+<div class="note warning">
+ <h5>Warning: Drupal Version Compatibility</h5>
+ <p>This migrator was written for Drupal 6.1 and may not work as expected on future versions of Drupal. Please update it and send us a pull request if necessary.</p>
+</div>
+
+## Movable Type
+
+To import posts from Movable Type:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/mt";
+ Jekyll::MT.process("database", "user", "pass")'
+{% endhighlight %}
+
+## Typo
+
+To import posts from Typo:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/typo";
+ Jekyll::Typo.process("database", "user", "pass")'
+{% endhighlight %}
+
+This code also has only been tested with Typo version 4+.
+
+## TextPattern
+
+To import posts from TextPattern:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/textpattern";
+ Jekyll::TextPattern.process("database_name", "username", "password", "hostname")'
+{% endhighlight %}
+
+You will need to run the above from the parent directory of your `_import` folder. For example, if `_import` is located in `/path/source/_import`, you will need to run this code from `/path/source`. The hostname defaults to `localhost`, all other variables are required. You may need to adjust the code used to filter entries. Left alone, it will attempt to pull all entries that are live or sticky.
+
+## Mephisto
+
+To import posts from Mephisto:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/mephisto";
+ Jekyll::Mephisto.process("database", "user", "password")'
+{% endhighlight %}
+
+If your data is in Postgres, you should do this instead:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/mephisto";
+ Jekyll::Mephisto.postgres({:database => "database", :username=>"username", :password =>"password"})'
+{% endhighlight %}
+
+## Blogger (Blogspot)
+
+To import posts from Blogger, see [this post about migrating from Blogger to Jekyll](http://coolaj86.info/articles/migrate-from-blogger-to-jekyll.html). If that doesn’t work for you, you might want to try some of the following alternatives:
+
+- [@kennym](https://github.com/kennym) created a [little migration script](https://gist.github.com/1115810), because the solutions in the previous article didn't work out for him.
+- [@ngauthier](https://github.com/ngauthier) created [another importer](https://gist.github.com/1506614) that imports comments, and does so via blogger’s archive instead of the RSS feed.
+- [@juniorz](https://github.com/juniorz) created [yet another importer](https://gist.github.com/1564581) that works for [Octopress](http://octopress.org). It is like [@ngauthier’s version](https://gist.github.com/1506614) but separates drafts from posts, as well as importing tags and permalinks.
+
+## Posterous
+
+To import posts from your primary Posterous blog:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/posterous";
+ Jekyll::Posterous.process("my_email", "my_pass")'
+{% endhighlight %}
+
+For any other Posterous blog on your account, you will need to specify the `blog_id` for the blog:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/posterous";
+ Jekyll::Posterous.process("my_email", "my_pass", "blog_id")'
+{% endhighlight %}
+
+There is also an [alternative Posterous migrator](https://github.com/pepijndevos/jekyll/blob/patch-1/lib/jekyll/migrators/posterous.rb) that maintains permalinks and attempts to import images too.
+
+## Tumblr
+
+To import posts from Tumblr:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/tumblr";
+ Jekyll::Tumblr.process("http://www.your_blog_url.com", true)'
+{% endhighlight %}
+
+There is also [a modified Tumblr migrator](https://github.com/stephenmcd/jekyll/blob/master/lib/jekyll/migrators/tumblr.rb) that exports posts as Markdown and preserves post tags.
+
+The migrator above requires the `json` gem and Python's `html2text` to be installed as follows:
+
+{% highlight bash %}
+$ gem install json
+$ pip install html2text
+{% endhighlight %}
+
+Once installed, simply use the format argument:
+
+{% highlight bash %}
+$ ruby -rubygems -e 'require "jekyll/migrators/tumblr";
+ Jekyll::Tumblr.process("http://www.your_blog_url.com", format="md")'
+{% endhighlight %}
+
+## Other Systems
+
+If you have a system that there isn’t currently a migrator for, you should consider writing one and sending us a pull request.
View
62 site/_posts/2012-07-01-pages.md
@@ -0,0 +1,62 @@
+---
+layout: docs
+title: Creating pages
+prev_section: posts
+next_section: variables
+---
+
+As well as [writing posts](../posts), the other thing you may want to do with your Jekyll site is create static pages. This is pretty simple to do, simply by taking advantage of the way Jekyll copies files and directories.
+
+## Homepage