Permalink
Browse files

Merge remote-tracking branch 'mojombo/master'

Conflicts:
	lib/jekyll/post.rb
  • Loading branch information...
2 parents edb51ce + 4499df8 commit 3cebd952482d705e88f42e0540cb03649a927748 @wez committed Feb 12, 2012
Showing with 1,899 additions and 512 deletions.
  1. +4 −0 .gitignore
  2. +2 −0 Gemfile
  3. +42 −1 History.txt
  4. +1 −1 README.textile
  5. +9 −2 Rakefile
  6. +100 −3 bin/jekyll
  7. +18 −0 features/create_sites.feature
  8. +2 −2 features/post_data.feature
  9. +19 −0 features/site_configuration.feature
  10. +3 −0 features/support/env.rb
  11. +27 −16 jekyll.gemspec
  12. +15 −4 lib/jekyll.rb
  13. +0 −120 lib/jekyll/albino.rb
  14. +14 −2 lib/jekyll/converters/markdown.rb
  15. +19 −2 lib/jekyll/converters/textile.rb
  16. +38 −23 lib/jekyll/convertible.rb
  17. +66 −1 lib/jekyll/filters.rb
  18. +33 −7 lib/jekyll/generators/pagination.rb
  19. +18 −10 lib/jekyll/layout.rb
  20. +3 −3 lib/jekyll/migrators/csv.rb
  21. +30 −13 lib/jekyll/migrators/drupal.rb
  22. +49 −0 lib/jekyll/migrators/enki.rb
  23. +53 −0 lib/jekyll/migrators/joomla.rb
  24. +0 −1 lib/jekyll/migrators/marley.rb
  25. +17 −12 lib/jekyll/migrators/mephisto.rb
  26. +26 −17 lib/jekyll/migrators/mt.rb
  27. +67 −0 lib/jekyll/migrators/posterous.rb
  28. +47 −0 lib/jekyll/migrators/rss.rb
  29. +16 −8 lib/jekyll/migrators/textpattern.rb
  30. +195 −0 lib/jekyll/migrators/tumblr.rb
  31. +8 −6 lib/jekyll/migrators/typo.rb
  32. +0 −38 lib/jekyll/migrators/wordpress.com.rb
  33. +274 −36 lib/jekyll/migrators/wordpress.rb
  34. +70 −0 lib/jekyll/migrators/wordpressdotcom.rb
  35. +56 −35 lib/jekyll/page.rb
  36. +1 −0 lib/jekyll/plugin.rb
  37. +28 −15 lib/jekyll/post.rb
  38. +150 −86 lib/jekyll/site.rb
  39. +12 −15 lib/jekyll/static_file.rb
  40. +17 −14 lib/jekyll/tags/highlight.rb
  41. +38 −0 lib/jekyll/tags/post_url.rb
  42. +3 −3 test/helper.rb
  43. +7 −0 test/source/_posts/2011-04-12-md-extension.md
  44. 0 test/source/_posts/2011-04-12-text-extension.text
  45. +3 −1 test/suite.rb
  46. +1 −1 test/test_configuration.rb
  47. +1 −1 test/test_core_ext.rb
  48. +10 −1 test/test_filters.rb
  49. +2 −2 test/test_generated_site.rb
  50. +1 −1 test/test_kramdown.rb
  51. +1 −1 test/test_page.rb
  52. +1 −1 test/test_pager.rb
  53. +62 −2 test/test_post.rb
  54. +1 −1 test/test_rdiscount.rb
  55. +21 −0 test/test_redcarpet.rb
  56. +86 −0 test/test_redcloth.rb
  57. +37 −3 test/test_site.rb
  58. +75 −1 test/test_tags.rb
View
@@ -1,6 +1,10 @@
+Gemfile.lock
test/dest
*.gem
pkg/
*.swp
*~
_site/
+.bundle/
+.DS_Store
+bbin/
View
@@ -0,0 +1,2 @@
+source :rubygems
+gemspec
View
@@ -1,3 +1,44 @@
+== HEAD
+ * Minor Enhancements
+ * Add ability to explicitly specify included files (#261)
+ * Add --default-mimetype option (#279)
+ * Allow setting of RedCloth options (#284)
+ * Add post_url Liquid tag for internal post linking (#369)
+ * Allow multiple plugin dirs to be specified (#438)
+ * 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)
+
+== 0.11.2 / 2011-12-27
+ * Bug Fixes
+ * Fix gemspec
+
+== 0.11.1 / 2011-12-27
+ * Bug Fixes
+ * Fix extra blank line in highlight blocks (#409)
+ * Update dependencies
+
+== 0.11.0 / 2011-07-10
+ * Major Enhancements
+ * Add command line importer functionality (#253)
+ * Add Redcarpet Markdown support (#318)
+ * Make markdown/textile extensions configurable (#312)
+ * Add `markdownify` filter
+ * Minor Enhancements
+ * Switch to Albino gem
+ * Bundler support
+ * Use English library to avoid hoops (#292)
+ * Add Posterous importer (#254)
+ * Fixes for Wordpress importer (#274, #252, #271)
+ * Better error message for invalid post date (#291)
+ * Print formatted fatal exceptions to stdout on build failure
+ * Add Tumblr importer (#323)
+ * Add Enki importer (#320)
+ * Bug Fixes
+ * Secure additional path exploits
+
== 0.10.0 / 2010-12-16
* Bug Fixes
* Add --no-server option.
@@ -75,7 +116,7 @@
* Empty tags causes error in read_posts (#84)
* Fix pagination to adhere to read/render/write paradigm
* Test Enhancement
- * cucumber features no longer use site.ports.first where a better
+ * cucumber features no longer use site.posts.first where a better
alternative is available
== 0.5.6 / 2010-01-08
View
@@ -27,14 +27,14 @@ h2. Runtime Dependencies
* Classifier: Generating related posts (Ruby)
* Maruku: Default markdown engine (Ruby)
* Directory Watcher: Auto-regeneration of sites (Ruby)
-* Open4: Talking to pygments for syntax highlighting (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)
h2. License
View
@@ -1,7 +1,10 @@
require 'rubygems'
require 'rake'
+require 'rdoc'
require 'date'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
+
#############################################################################
#
# Helper functions
@@ -47,6 +50,10 @@ task :default => [:test, :features]
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
+ if `which pygmentize` == ''
+ puts "You must have Pygments installed to run the tests."
+ exit 1
+ end
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
@@ -60,7 +67,7 @@ task :coverage do
sh "open coverage/index.html"
end
-require 'rake/rdoctask'
+require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
@@ -117,7 +124,7 @@ task :release => :build do
puts "You must be on the master branch to release!"
exit!
end
- sh "git commit --allow-empty -a -m 'Release #{version}'"
+ sh "git commit --allow-empty -m 'Release #{version}'"
sh "git tag v#{version}"
sh "git push origin master"
sh "git push origin v#{version}"
View
@@ -9,7 +9,8 @@ Basic Command Line Usage:
jekyll # . -> ./_site
jekyll <path to write generated site> # . -> <path>
jekyll <path to source> <path to write generated site> # <path> -> <path>
-
+ jekyll import <importer name> <options> # imports posts using named import script
+
Configuration is read from '<source>/_config.yml' but can be overriden
using the following options:
@@ -18,11 +19,37 @@ HELP
require 'optparse'
require 'jekyll'
+
exec = {}
options = {}
opts = OptionParser.new do |opts|
opts.banner = help
+ opts.on("--file [PATH]", "File to import from") do |import_file|
+ options['file'] = import_file
+ end
+
+ opts.on("--dbname [TEXT]", "DB to import from") do |import_dbname|
+ options['dbname'] = import_dbname
+ end
+
+ opts.on("--user [TEXT]", "Username to use when importing") do |import_user|
+ options['user'] = import_user
+ end
+
+ opts.on("--pass [TEXT]", "Password to use when importing") do |import_pass|
+ options['pass'] = import_pass
+ end
+
+ opts.on("--host [HOST ADDRESS]", "Host to import from") do |import_host|
+ options['host'] = import_host
+ end
+
+ opts.on("--site [SITE NAME]", "Site to import from") do |import_site|
+ options['site'] = import_site
+ end
+
+
opts.on("--[no-]safe", "Safe mode (default unsafe)") do |safe|
options['safe'] = safe
end
@@ -44,6 +71,10 @@ opts = OptionParser.new do |opts|
options['baseurl'] = baseurl
end
+ opts.on("--default-mimetype [MT]", "Mimetype to use when no file extension (if --server)") do |mt|
+ options['default-mimetype'] = mt
+ end
+
opts.on("--[no-]lsi", "Use LSI for better related posts") do |lsi|
options['lsi'] = lsi
end
@@ -55,6 +86,10 @@ opts = OptionParser.new do |opts|
opts.on("--rdiscount", "Use rdiscount gem for Markdown") do
options['markdown'] = 'rdiscount'
end
+
+ opts.on("--redcarpet", "Use redcarpet gem for Markdown") do
+ options['markdown'] = 'redcarpet'
+ end
opts.on("--kramdown", "Use kramdown gem for Markdown") do
options['markdown'] = 'kramdown'
@@ -105,7 +140,62 @@ end
# Read command line options into `options` hash
opts.parse!
-# Get source and destintation from command line
+
+# Check for import stuff
+if ARGV.size > 0
+ if ARGV[0] == 'import'
+ migrator = ARGV[1]
+
+ if migrator.nil?
+ puts "Invalid options. Run `jekyll --help` for assistance."
+ exit(1)
+ else
+ migrator = migrator.downcase
+ end
+
+ cmd_options = []
+ ['file', 'dbname', 'user', 'pass', 'host', 'site'].each do |p|
+ cmd_options << "\"#{options[p]}\"" unless options[p].nil?
+ end
+
+ # It's import time
+ puts "Importing..."
+
+ # Ideally, this shouldn't be necessary. Maybe parse the actual
+ # src files for the migrator name?
+ migrators = {
+ :posterous => 'Posterous',
+ :wordpressdotcom => 'WordpressDotCom',
+ :wordpress => 'WordPress',
+ :csv => 'CSV',
+ :drupal => 'Drupal',
+ :enki => 'Enki',
+ :mephisto => 'Mephisto',
+ :mt => 'MT',
+ :textpattern => 'TextPattern',
+ :tumblr => 'Tumblr',
+ :typo => 'Typo'
+ }
+
+ app_root = File.join(File.dirname(__FILE__), '..')
+
+ require "#{app_root}/lib/jekyll/migrators/#{migrator}"
+
+ if Jekyll.const_defined?(migrators[migrator.to_sym])
+ migrator_class = Jekyll.const_get(migrators[migrator.to_sym])
+ migrator_class.process(*cmd_options)
+ else
+ puts "Invalid migrator. Run `jekyll --help` for assistance."
+ exit(1)
+ end
+
+ exit(0)
+ end
+end
+
+
+
+# Get source and destination from command line
case ARGV.size
when 0
when 1
@@ -162,7 +252,11 @@ else
puts "Building site: #{source} -> #{destination}"
begin
site.process
- rescue Jekyll::FatalException
+ rescue Jekyll::FatalException => e
+ puts
+ puts "ERROR: YOUR SITE COULD NOT BE BUILT:"
+ puts "------------------------------------"
+ puts e.message
exit(1)
end
puts "Successfully generated site: #{source} -> #{destination}"
@@ -177,6 +271,9 @@ if options['server']
mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
mime_types.store 'js', 'application/javascript'
+ if options['default-mimetype']
+ mime_types.store(nil, options['default-mimetype'])
+ end
s = HTTPServer.new(
:Port => options['server_port'],
@@ -92,3 +92,21 @@ Feature: Create sites
When I debug jekyll
Then the _site directory should exist
And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
+
+ Scenario: Basic site with internal post linking
+ Given I have an "index.html" page that contains "URL: {% post_url 2020-01-31-entry2 %}"
+ And I have a configuration file with "permalink" set to "pretty"
+ And I have a _posts directory
+ And I have the following posts:
+ | title | date | layout | content |
+ | entry1 | 12/31/2007 | post | content for entry1. |
+ | entry2 | 01/31/2020 | post | content for entry2. |
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "URL: /2020/01/31/entry2/" in "_site/index.html"
+
+ Scenario: Basic site with whitelisted dotfile
+ Given I have an ".htaccess" file that contains "SomeDirective"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "SomeDirective" in "_site/.htaccess"
@@ -31,10 +31,10 @@ Feature: Post data
And I have the following post:
| title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. |
- And I have a simple layout that contains "Post date: {{ page.date }}"
+ And I have a simple layout that contains "Post date: {{ page.date | date_to_string }}"
When I run jekyll
Then the _site directory should exist
- And I should see "Post date: Fri Mar 27" in "_site/2009/03/27/star-wars.html"
+ And I should see "Post date: 27 Mar 2009" in "_site/2009/03/27/star-wars.html"
Scenario: Use post.id variable
Given I have a _posts directory
@@ -55,6 +55,13 @@ Feature: Site configuration
Then the _site directory should exist
And I should see "<a href="http://google.com">Google</a>" in "_site/index.html"
+ Scenario: Use Redcarpet for markup
+ Given I have an "index.markdown" page that contains "[Google](http://google.com)"
+ And I have a configuration file with "markdown" set to "redcarpet"
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "<a href="http://google.com">Google</a>" in "_site/index.html"
+
Scenario: Use Maruku for markup
Given I have an "index.markdown" page that contains "[Google](http://google.com)"
And I have a configuration file with "markdown" set to "maruku"
@@ -124,3 +131,15 @@ Feature: Site configuration
And the "_site/2009/04/05/bananas.html" file should exist
And the "_site/2009/04/01/oranges.html" file should exist
And the "_site/2009/03/27/apples.html" file should not exist
+
+ Scenario: Copy over normally excluded files when they are explicitly included
+ Given I have a ".gitignore" file that contains ".DS_Store"
+ And I have an ".htaccess" file that contains "SomeDirective"
+ And I have a configuration file with "include" set to:
+ | value |
+ | .gitignore |
+ | .foo |
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see ".DS_Store" in "_site/.gitignore"
+ And the "_site/.htaccess" file should not exist
View
@@ -14,3 +14,6 @@ def run_jekyll(opts = {})
command << " >> /dev/null 2>&1" if opts[:debug].nil?
system command
end
+
+# work around "invalid option: --format" cucumber bug (see #296)
+Test::Unit.run = true if RUBY_VERSION < '1.9'
Oops, something went wrong.

0 comments on commit 3cebd95

Please sign in to comment.