resetting to upstream

This commit is contained in:
Kris Brown 2010-01-09 18:55:07 +00:00
parent 2a7b1cbd98
commit 6b74454a07
13 changed files with 30 additions and 82 deletions

View File

@ -1,7 +1,3 @@
== Edge
* Enhancements
* added support for extensions [issue #100]
== 0.5.6 / 2010-01-08 == 0.5.6 / 2010-01-08
* Bug Fixes * Bug Fixes
* Require redcloth >= 4.2.1 in tests (#92) * Require redcloth >= 4.2.1 in tests (#92)

View File

@ -6,13 +6,13 @@ begin
gem 'jeweler', '>= 0.11.0' gem 'jeweler', '>= 0.11.0'
require 'jeweler' require 'jeweler'
Jeweler::Tasks.new do |s| Jeweler::Tasks.new do |s|
s.name = "krisb-jekyll" s.name = "jekyll"
s.summary = %Q{Jekyll is a simple, blog aware, static site generator.} s.summary = %Q{Jekyll is a simple, blog aware, static site generator.}
s.email = "kris@kris.me.uk" s.email = "tom@mojombo.com"
s.homepage = "http://github.com/mojombo/jekyll" s.homepage = "http://github.com/mojombo/jekyll"
s.description = "Jekyll is a simple, blog aware, static site generator." s.description = "Jekyll is a simple, blog aware, static site generator."
s.authors = ["Tom Preston-Werner", "Kris Brown"] s.authors = ["Tom Preston-Werner"]
s.rubyforge_project = "krisb-jekyll" s.rubyforge_project = "jekyll"
s.files.exclude 'test/dest' s.files.exclude 'test/dest'
s.test_files.exclude 'test/dest' s.test_files.exclude 'test/dest'
s.add_dependency('RedCloth', '>= 4.2.1') s.add_dependency('RedCloth', '>= 4.2.1')

View File

@ -62,14 +62,6 @@ opts = OptionParser.new do |opts|
end end
end end
opts.on("--extensions", "Load Jekyll extensions from _lib directory") do
options['extensions'] = true
end
opts.on("--no-extensions", "Do not load Jekyll extensions") do
options['extensions'] = false
end
opts.on("--version", "Display current version") do opts.on("--version", "Display current version") do
puts "Jekyll " + Jekyll.version puts "Jekyll " + Jekyll.version
exit 0 exit 0

View File

@ -20,7 +20,7 @@ Feature: Embed filters
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star & Wars | 3/27/2009 | default | These aren't the droids you're looking for. | | Star & Wars | 3/27/2009 | default | These aren't the droids you're looking for. |
And I have a default layout that contains "{{ page.title | xml_escape }}" And I have a default layout that contains "{{ site.posts.first.title | xml_escape }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Star & Wars" in "_site/2009/03/27/star-wars.html" And I should see "Star & Wars" in "_site/2009/03/27/star-wars.html"
@ -31,7 +31,7 @@ Feature: Embed filters
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | default | These aren't the droids you're looking for. | | Star Wars | 3/27/2009 | default | These aren't the droids you're looking for. |
And I have a default layout that contains "{{ content | xml_escape }}" And I have a default layout that contains "{{ site.posts.first.content | xml_escape }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "7" in "_site/2009/03/27/star-wars.html" And I should see "7" in "_site/2009/03/27/star-wars.html"
@ -42,7 +42,7 @@ Feature: Embed filters
And I have the following post: And I have the following post:
| title | date | layout | tags | content | | title | date | layout | tags | content |
| Star Wars | 3/27/2009 | default | [scifi, movies, force] | These aren't the droids you're looking for. | | Star Wars | 3/27/2009 | default | [scifi, movies, force] | These aren't the droids you're looking for. |
And I have a default layout that contains "{{ page.tags | array_to_sentence_string }}" And I have a default layout that contains "{{ site.posts.first.tags | array_to_sentence_string }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "scifi, movies, and force" in "_site/2009/03/27/star-wars.html" And I should see "scifi, movies, and force" in "_site/2009/03/27/star-wars.html"

View File

@ -9,7 +9,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post title: {{ page.title }}" And I have a simple layout that contains "Post title: {{ site.posts.first.title }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post title: Star Wars" in "_site/2009/03/27/star-wars.html" And I should see "Post title: Star Wars" in "_site/2009/03/27/star-wars.html"
@ -20,7 +20,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post url: {{ page.url }}" And I have a simple layout that contains "Post url: {{ site.posts.first.url }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post url: /2009/03/27/star-wars.html" in "_site/2009/03/27/star-wars.html" And I should see "Post url: /2009/03/27/star-wars.html" in "_site/2009/03/27/star-wars.html"
@ -31,7 +31,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | 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: {{ site.posts.first.date }}"
When I run jekyll When I run jekyll
Then the _site directory should exist 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: Fri Mar 27" in "_site/2009/03/27/star-wars.html"
@ -42,7 +42,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post id: {{ page.id }}" And I have a simple layout that contains "Post id: {{ site.posts.first.id }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post id: /2009/03/27/star-wars" in "_site/2009/03/27/star-wars.html" And I should see "Post id: /2009/03/27/star-wars" in "_site/2009/03/27/star-wars.html"
@ -53,7 +53,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post content: {{ content }}" And I have a simple layout that contains "Post content: {{ site.posts.first.content }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post content: <p>Luke, I am your father.</p>" in "_site/2009/03/27/star-wars.html" And I should see "Post content: <p>Luke, I am your father.</p>" in "_site/2009/03/27/star-wars.html"
@ -65,7 +65,7 @@ Feature: Post data
And I have the following post in "movies": And I have the following post in "movies":
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post category: {{ page.categories }}" And I have a simple layout that contains "Post category: {{ site.posts.first.categories }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html" And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
@ -76,7 +76,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | tag | content | | title | date | layout | tag | content |
| Star Wars | 5/18/2009 | simple | twist | Luke, I am your father. | | Star Wars | 5/18/2009 | simple | twist | Luke, I am your father. |
And I have a simple layout that contains "Post tags: {{ page.tags }}" And I have a simple layout that contains "Post tags: {{ site.posts.first.tags }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post tags: twist" in "_site/2009/05/18/star-wars.html" And I should see "Post tags: twist" in "_site/2009/05/18/star-wars.html"
@ -89,7 +89,7 @@ Feature: Post data
And I have the following post in "movies/scifi": And I have the following post in "movies/scifi":
| title | date | layout | content | | title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}" And I have a simple layout that contains "Post categories: {{ site.posts.first.categories | array_to_sentence_string }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html" And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
@ -100,7 +100,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | category | content | | title | date | layout | category | content |
| Star Wars | 3/27/2009 | simple | movies | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | movies | Luke, I am your father. |
And I have a simple layout that contains "Post category: {{ page.categories }}" And I have a simple layout that contains "Post category: {{ site.posts.first.categories }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html" And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
@ -111,7 +111,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | categories | content | | title | date | layout | categories | content |
| Star Wars | 3/27/2009 | simple | ['movies', 'scifi'] | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | ['movies', 'scifi'] | Luke, I am your father. |
And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}" And I have a simple layout that contains "Post categories: {{ site.posts.first.categories | array_to_sentence_string }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html" And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
@ -133,7 +133,7 @@ Feature: Post data
And I have the following post: And I have the following post:
| title | date | layout | author | content | | title | date | layout | author | content |
| Star Wars | 3/27/2009 | simple | Darth Vader | Luke, I am your father. | | Star Wars | 3/27/2009 | simple | Darth Vader | Luke, I am your father. |
And I have a simple layout that contains "Post author: {{ page.author }}" And I have a simple layout that contains "Post author: {{ site.posts.first.author }}"
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html" And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"

View File

@ -61,21 +61,3 @@ Feature: Site configuration
When I run jekyll When I run jekyll
Then the _site directory should exist Then the _site directory should exist
And I should see "puts 'Hello world!'" in "_site/index.html" And I should see "puts 'Hello world!'" in "_site/index.html"
Scenario: Load an extension from _lib
Given I have an "index.html" page that contains "{{ 'extension' | hello }}"
And I have a _lib directory
And I have a "_lib/hello.rb" file that contains "module Jekyll::Filters ; def hello(input) ; "hello #{input}" ; end ; end"
And I have a configuration file with "extensions" set to "true"
When I run jekyll
Then the _site directory should exist
And I should see "hello extension" in "_site/index.html"
Scenario: Skip loading extensions from _lib
Given I have an "index.html" page that contains "{{ 'extension' | hello }}"
And I have a _lib directory
And I have a "_lib/hello.rb" file that contains "module Jekyll::Filters ; def hello(input) ; "hello #{input}" ; end ; end"
And I have a configuration file with "extensions" set to "false"
When I run jekyll
Then the _site directory should exist
And I should not see "hello extension" in "_site/index.html"

View File

@ -119,10 +119,6 @@ Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
assert_match Regexp.new(text), File.open(file).readlines.join assert_match Regexp.new(text), File.open(file).readlines.join
end end
Then /^I should not see "(.*)" in "(.*)"$/ do |text, file|
assert_no_match Regexp.new(text), File.open(file).readlines.join
end
Then /^the "(.*)" file should exist$/ do |file| Then /^the "(.*)" file should exist$/ do |file|
assert File.file?(file) assert File.file?(file)
end end

View File

@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.date = %q{2010-01-08} s.date = %q{2010-01-08}
s.default_executable = %q{jekyll} s.default_executable = %q{jekyll}
s.description = %q{Jekyll is a simple, blog aware, static site generator.} s.description = %q{Jekyll is a simple, blog aware, static site generator.}
s.email = %q{kris@kris.me.uk} s.email = %q{tom@mojombo.com}
s.executables = ["jekyll"] s.executables = ["jekyll"]
s.extra_rdoc_files = [ s.extra_rdoc_files = [
"README.textile" "README.textile"
@ -33,7 +33,7 @@ Gem::Specification.new do |s|
"features/site_data.feature", "features/site_data.feature",
"features/step_definitions/jekyll_steps.rb", "features/step_definitions/jekyll_steps.rb",
"features/support/env.rb", "features/support/env.rb",
"krisb-jekyll.gemspec", "jekyll.gemspec",
"lib/jekyll.rb", "lib/jekyll.rb",
"lib/jekyll/albino.rb", "lib/jekyll/albino.rb",
"lib/jekyll/converters/csv.rb", "lib/jekyll/converters/csv.rb",
@ -94,7 +94,7 @@ Gem::Specification.new do |s|
s.homepage = %q{http://github.com/mojombo/jekyll} s.homepage = %q{http://github.com/mojombo/jekyll}
s.rdoc_options = ["--charset=UTF-8"] s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"] s.require_paths = ["lib"]
s.rubyforge_project = %q{krisb-jekyll} s.rubyforge_project = %q{jekyll}
s.rubygems_version = %q{1.3.5} s.rubygems_version = %q{1.3.5}
s.summary = %q{Jekyll is a simple, blog aware, static site generator.} s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
s.test_files = [ s.test_files = [

View File

@ -43,7 +43,6 @@ module Jekyll
'pygments' => false, 'pygments' => false,
'markdown' => 'maruku', 'markdown' => 'maruku',
'permalink' => 'date', 'permalink' => 'date',
'extensions' => false,
'maruku' => { 'maruku' => {
'use_tex' => false, 'use_tex' => false,

View File

@ -3,10 +3,6 @@
# #
# Requires # Requires
# self.site -> Jekyll::Site # self.site -> Jekyll::Site
# self.content=
# self.data=
# self.ext=
# self.output=
module Jekyll module Jekyll
module Convertible module Convertible
# Return the contents as a string # Return the contents as a string

View File

@ -18,9 +18,12 @@ module Jekyll
name =~ MATCHER name =~ MATCHER
end end
attr_accessor :site attr_accessor :site, :date, :slug, :ext, :published, :data, :content, :output, :tags
attr_accessor :data, :content, :output, :ext attr_writer :categories
attr_accessor :date, :slug, :published, :tags, :categories
def categories
@categories ||= []
end
# Initialize this Post instance. # Initialize this Post instance.
# +site+ is the Site # +site+ is the Site
@ -48,8 +51,9 @@ module Jekyll
self.tags = [self.data["tag"]] self.tags = [self.data["tag"]]
elsif self.data.has_key?("tags") elsif self.data.has_key?("tags")
self.tags = self.data['tags'] self.tags = self.data['tags']
else
self.tags = []
end end
self.tags ||= []
if self.categories.empty? if self.categories.empty?
if self.data.has_key?('category') if self.data.has_key?('category')
@ -64,7 +68,6 @@ module Jekyll
end end
end end
end end
self.categories ||= []
end end
# Spaceship is based on Post#date, slug # Spaceship is based on Post#date, slug

View File

@ -2,8 +2,7 @@ module Jekyll
class Site class Site
attr_accessor :config, :layouts, :posts, :pages, :static_files, :categories, :exclude, attr_accessor :config, :layouts, :posts, :pages, :static_files, :categories, :exclude,
:source, :dest, :lsi, :pygments, :permalink_style, :tags, :source, :dest, :lsi, :pygments, :permalink_style, :tags
:extensions
# Initialize the site # Initialize the site
# +config+ is a Hash containing site configurations details # +config+ is a Hash containing site configurations details
@ -18,7 +17,6 @@ module Jekyll
self.pygments = config['pygments'] self.pygments = config['pygments']
self.permalink_style = config['permalink'].to_sym self.permalink_style = config['permalink'].to_sym
self.exclude = config['exclude'] || [] self.exclude = config['exclude'] || []
self.extensions = config['extensions']
self.reset self.reset
self.setup self.setup
@ -84,12 +82,6 @@ module Jekyll
else else
raise "Invalid Markdown processor: '#{self.config['markdown']}' -- did you mean 'maruku' or 'rdiscount'?" raise "Invalid Markdown processor: '#{self.config['markdown']}' -- did you mean 'maruku' or 'rdiscount'?"
end end
# Load extensions from _lib folder
if self.extensions
# load instead of require so that jekyll --auto reloads changes
Dir["#{source}/_lib/*.rb"].each {|f| load f}
end
end end
def textile(content) def textile(content)

View File

@ -36,7 +36,6 @@ class TestPost < Test::Unit::TestCase
end end
should "keep date, title, and markup type" do should "keep date, title, and markup type" do
@post.categories = []
@post.process(@fake_file) @post.process(@fake_file)
assert_equal Time.parse("2008-10-19"), @post.date assert_equal Time.parse("2008-10-19"), @post.date
@ -215,13 +214,6 @@ class TestPost < Test::Unit::TestCase
end end
context "initializing posts" do context "initializing posts" do
should "ensure suitable defaults for attributes" do
post = setup_post("2009-06-22-no-yaml.textile")
assert_equal [], post.tags
assert_equal [], post.categories
end
should "publish when published yaml is no specified" do should "publish when published yaml is no specified" do
post = setup_post("2008-02-02-published.textile") post = setup_post("2008-02-02-published.textile")
assert_equal true, post.published assert_equal true, post.published