diff --git a/History.txt b/History.txt index 5d94fdc1..f71f8582 100644 --- a/History.txt +++ b/History.txt @@ -1,10 +1,25 @@ -== edge +== Edge * Enhancements * added support for extensions [issue #100] + +== 0.5.6 / 2010-01-08 * Bug Fixes - * changed tests to require redcloth >= 4.2.1 [issue #92] - * fixed pagination when number of pages is an exact multiple of max per page [issue #78] - * fixed rendering order of site artifacts [issue #71] + * Require redcloth >= 4.2.1 in tests (#92) + * Don't break on triple dashes in yaml frontmatter (#93) + * Minor Enhancements + * Allow .mkd as markdown extension + * Use $stdout/err instead of constants (#99) + * Properly wrap code blocks (#91) + * Add javascript mime type for webrick (#98) + +== 0.5.5 / 2010-01-08 + * Bug Fixes + * Fix pagination % 0 bug (#78) + * Ensure all posts are processed first (#71) + +== NOTE + * After this point I will no longer be giving credit in the history; + that is what the commit log is for. == 0.5.4 / 2009-08-23 * Bug Fixes diff --git a/README.textile b/README.textile index d5165711..f32432f6 100644 --- a/README.textile +++ b/README.textile @@ -20,14 +20,21 @@ h2. Diving In * Customize the "Permalinks":http://wiki.github.com/mojombo/jekyll/permalinks your posts are generated with * Use the built-in "Liquid Extensions":http://wiki.github.com/mojombo/jekyll/liquid-extensions to make your life easier -h2. Dependencies +h2. Runtime Dependencies -* RedCloth: Textile support -* Liquid: Templating system -* Classifier: Generating related posts -* Maruku: Default markdown engine -* Directory Watcher: Auto-regeneration of sites -* Open4: Talking to pygments for syntax highlighting +* 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) +* 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) h2. License diff --git a/VERSION.yml b/VERSION.yml index 66ebe587..a4ed05e5 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,4 +1,5 @@ --- -:patch: 4 -:major: 0 :minor: 5 +:patch: 6 +:build: +:major: 0 diff --git a/bin/jekyll b/bin/jekyll index 7a31b80a..76a6eb96 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -145,9 +145,13 @@ if options['server'] FileUtils.mkdir_p(destination) + mime_types = WEBrick::HTTPUtils::DefaultMimeTypes + mime_types.store 'js', 'application/javascript' + s = HTTPServer.new( :Port => options['server_port'], - :DocumentRoot => destination + :DocumentRoot => destination, + :MimeTypes => mime_types ) t = Thread.new { s.start diff --git a/krisb-jekyll.gemspec b/jekyll.gemspec similarity index 94% rename from krisb-jekyll.gemspec rename to jekyll.gemspec index a88c14c8..180cbd53 100644 --- a/krisb-jekyll.gemspec +++ b/jekyll.gemspec @@ -1,15 +1,15 @@ # Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command +# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command # -*- encoding: utf-8 -*- Gem::Specification.new do |s| - s.name = %q{krisb-jekyll} - s.version = "0.5.4" + s.name = %q{jekyll} + s.version = "0.5.6" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Tom Preston-Werner", "Kris Brown"] - s.date = %q{2010-01-05} + s.authors = ["Tom Preston-Werner"] + s.date = %q{2010-01-08} s.default_executable = %q{jekyll} s.description = %q{Jekyll is a simple, blog aware, static site generator.} s.email = %q{kris@kris.me.uk} @@ -50,6 +50,7 @@ Gem::Specification.new do |s| "lib/jekyll/pager.rb", "lib/jekyll/post.rb", "lib/jekyll/site.rb", + "lib/jekyll/static_file.rb", "lib/jekyll/tags/highlight.rb", "lib/jekyll/tags/include.rb", "test/helper.rb", @@ -70,6 +71,7 @@ Gem::Specification.new do |s| "test/source/_posts/2009-05-18-tags.textile", "test/source/_posts/2009-06-22-empty-yaml.textile", "test/source/_posts/2009-06-22-no-yaml.textile", + "test/source/_posts/2010-01-08-triple-dash.markdown", "test/source/about.html", "test/source/category/_posts/2008-9-23-categories.textile", "test/source/contacts.html", diff --git a/lib/jekyll.rb b/lib/jekyll.rb index d4a2abd2..8f94ecc8 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -69,10 +69,10 @@ module Jekyll begin config = YAML.load_file(config_file) raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash) - STDOUT.puts "Configuration from #{config_file}" + $stdout.puts "Configuration from #{config_file}" rescue => err - STDERR.puts "WARNING: Could not read configuration. Using defaults (and options)." - STDERR.puts "\t" + err.to_s + $stderr.puts "WARNING: Could not read configuration. Using defaults (and options)." + $stderr.puts "\t" + err.to_s config = {} end diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 23783691..f3da5579 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -22,7 +22,7 @@ module Jekyll def read_yaml(base, name) self.content = File.read(File.join(base, name)) - if self.content =~ /^(---\s*\n.*?\n?)(---.*?\n)/m + if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m self.content = self.content[($1.size + $2.size)..-1] self.data = YAML.load($1) @@ -53,7 +53,7 @@ module Jekyll case self.ext[1..-1] when /textile/i return 'textile' - when /markdown/i, /mkdn/i, /md/i + when /markdown/i, /mkdn/i, /md/i, /mkd/i return 'markdown' end return 'unknown' diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb index eb069c27..93d94868 100644 --- a/lib/jekyll/tags/highlight.rb +++ b/lib/jekyll/tags/highlight.rb @@ -30,12 +30,11 @@ module Jekyll end def render_pygments(context, code) + output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang) if context["content_type"] == "markdown" - return "\n" + Albino.new(code, @lang).to_s(@options) + "\n" + return "\n" + output + "\n" elsif context["content_type"] == "textile" - return "" + Albino.new(code, @lang).to_s(@options) + "" - else - return Albino.new(code, @lang).to_s(@options) + return "" + output + "" end end @@ -49,6 +48,13 @@ module Jekyll HTML end + + def add_code_tags(code, lang) + # Add nested tags to code blocks + code = code.sub(/
/,'
')
+      code = code.sub(/<\/pre>/,"
") + end + end end diff --git a/test/source/_posts/2010-01-08-triple-dash.markdown b/test/source/_posts/2010-01-08-triple-dash.markdown new file mode 100644 index 00000000..cbb79e7a --- /dev/null +++ b/test/source/_posts/2010-01-08-triple-dash.markdown @@ -0,0 +1,5 @@ +--- +title: Foo --- Bar +--- + +Triple the fun! \ No newline at end of file diff --git a/test/test_configuration.rb b/test/test_configuration.rb index 3b05ed51..c6d5ad6c 100644 --- a/test/test_configuration.rb +++ b/test/test_configuration.rb @@ -8,21 +8,21 @@ class TestConfiguration < Test::Unit::TestCase should "fire warning with no _config.yml" do mock(YAML).load_file(@path) { raise "No such file or directory - #{@path}" } - mock(STDERR).puts("WARNING: Could not read configuration. Using defaults (and options).") - mock(STDERR).puts("\tNo such file or directory - #{@path}") + mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).") + mock($stderr).puts("\tNo such file or directory - #{@path}") assert_equal Jekyll::DEFAULTS, Jekyll.configuration({}) end should "load configuration as hash" do mock(YAML).load_file(@path) { Hash.new } - mock(STDOUT).puts("Configuration from #{@path}") + mock($stdout).puts("Configuration from #{@path}") assert_equal Jekyll::DEFAULTS, Jekyll.configuration({}) end should "fire warning with bad config" do mock(YAML).load_file(@path) { Array.new } - mock(STDERR).puts("WARNING: Could not read configuration. Using defaults (and options).") - mock(STDERR).puts("\tInvalid configuration - #{@path}") + mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).") + mock($stderr).puts("\tInvalid configuration - #{@path}") assert_equal Jekyll::DEFAULTS, Jekyll.configuration({}) end end diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index fe9878e9..357dd4db 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase end should "ensure post count is as expected" do - assert_equal 17, @site.posts.size + assert_equal 18, @site.posts.size end should "insert site.posts into the index" do diff --git a/test/test_post.rb b/test/test_post.rb index 78b86730..36a3f287 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -78,7 +78,19 @@ class TestPost < Test::Unit::TestCase @post.read_yaml(@source, @real_file) assert_equal({"title" => "Test title", "layout" => "post", "tag" => "Ruby"}, @post.data) - assert_equal "\r\nThis is the content", @post.content + assert_equal "This is the content", @post.content + end + end + + context "with embedded triple dash" do + setup do + @real_file = "2010-01-08-triple-dash.markdown" + end + should "consume the embedded dashes" do + @post.read_yaml(@source, @real_file) + + assert_equal({"title" => "Foo --- Bar"}, @post.data) + assert_equal "Triple the fun!", @post.content end end @@ -164,7 +176,7 @@ class TestPost < Test::Unit::TestCase @post.read_yaml(@source, @real_file) assert_equal({"title" => "Foo Bar", "layout" => "default"}, @post.data) - assert_equal "\nh1. {{ page.title }}\n\nBest *post* ever", @post.content + assert_equal "h1. {{ page.title }}\n\nBest *post* ever", @post.content end should "transform textile" do diff --git a/test/test_tags.rb b/test/test_tags.rb index 0c3caa6d..64119572 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -49,7 +49,7 @@ CONTENT end should "render markdown with pygments line handling" do - assert_match %{
test\n
}, @result + assert_match %{
test\n
}, @result end end @@ -59,7 +59,7 @@ CONTENT end should "render markdown with pygments line handling" do - assert_match %{
Æ\n
}, @result + assert_match %{
Æ\n
}, @result end end