resetting to upstream
This commit is contained in:
parent
2a7b1cbd98
commit
6b74454a07
|
@ -1,7 +1,3 @@
|
|||
== Edge
|
||||
* Enhancements
|
||||
* added support for extensions [issue #100]
|
||||
|
||||
== 0.5.6 / 2010-01-08
|
||||
* Bug Fixes
|
||||
* Require redcloth >= 4.2.1 in tests (#92)
|
||||
|
|
8
Rakefile
8
Rakefile
|
@ -6,13 +6,13 @@ begin
|
|||
gem 'jeweler', '>= 0.11.0'
|
||||
require 'jeweler'
|
||||
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.email = "kris@kris.me.uk"
|
||||
s.email = "tom@mojombo.com"
|
||||
s.homepage = "http://github.com/mojombo/jekyll"
|
||||
s.description = "Jekyll is a simple, blog aware, static site generator."
|
||||
s.authors = ["Tom Preston-Werner", "Kris Brown"]
|
||||
s.rubyforge_project = "krisb-jekyll"
|
||||
s.authors = ["Tom Preston-Werner"]
|
||||
s.rubyforge_project = "jekyll"
|
||||
s.files.exclude 'test/dest'
|
||||
s.test_files.exclude 'test/dest'
|
||||
s.add_dependency('RedCloth', '>= 4.2.1')
|
||||
|
|
|
@ -62,14 +62,6 @@ opts = OptionParser.new do |opts|
|
|||
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
|
||||
puts "Jekyll " + Jekyll.version
|
||||
exit 0
|
||||
|
|
|
@ -20,7 +20,7 @@ Feature: Embed filters
|
|||
And I have the following post:
|
||||
| title | date | layout | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
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:
|
||||
| title | date | layout | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
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:
|
||||
| title | date | layout | tags | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
And I should see "scifi, movies, and force" in "_site/2009/03/27/star-wars.html"
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 title: {{ page.title }}"
|
||||
And I have a simple layout that contains "Post title: {{ site.posts.first.title }}"
|
||||
When I run jekyll
|
||||
Then the _site directory should exist
|
||||
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:
|
||||
| title | date | layout | content |
|
||||
| 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
|
||||
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"
|
||||
|
@ -31,7 +31,7 @@ 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: {{ site.posts.first.date }}"
|
||||
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"
|
||||
|
@ -42,7 +42,7 @@ 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 id: {{ page.id }}"
|
||||
And I have a simple layout that contains "Post id: {{ site.posts.first.id }}"
|
||||
When I run jekyll
|
||||
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"
|
||||
|
@ -53,7 +53,7 @@ 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 content: {{ content }}"
|
||||
And I have a simple layout that contains "Post content: {{ site.posts.first.content }}"
|
||||
When I run jekyll
|
||||
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"
|
||||
|
@ -65,7 +65,7 @@ Feature: Post data
|
|||
And I have the following post in "movies":
|
||||
| title | date | layout | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
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:
|
||||
| title | date | layout | tag | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
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":
|
||||
| title | date | layout | content |
|
||||
| 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
|
||||
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"
|
||||
|
@ -100,7 +100,7 @@ Feature: Post data
|
|||
And I have the following post:
|
||||
| title | date | layout | category | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
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:
|
||||
| title | date | layout | categories | content |
|
||||
| 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
|
||||
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"
|
||||
|
@ -133,7 +133,7 @@ Feature: Post data
|
|||
And I have the following post:
|
||||
| title | date | layout | author | content |
|
||||
| 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
|
||||
Then the _site directory should exist
|
||||
And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"
|
||||
|
|
|
@ -61,21 +61,3 @@ Feature: Site configuration
|
|||
When I run jekyll
|
||||
Then the _site directory should exist
|
||||
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"
|
||||
|
|
|
@ -119,10 +119,6 @@ Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
|
|||
assert_match Regexp.new(text), File.open(file).readlines.join
|
||||
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|
|
||||
assert File.file?(file)
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|||
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}
|
||||
s.email = %q{tom@mojombo.com}
|
||||
s.executables = ["jekyll"]
|
||||
s.extra_rdoc_files = [
|
||||
"README.textile"
|
||||
|
@ -33,7 +33,7 @@ Gem::Specification.new do |s|
|
|||
"features/site_data.feature",
|
||||
"features/step_definitions/jekyll_steps.rb",
|
||||
"features/support/env.rb",
|
||||
"krisb-jekyll.gemspec",
|
||||
"jekyll.gemspec",
|
||||
"lib/jekyll.rb",
|
||||
"lib/jekyll/albino.rb",
|
||||
"lib/jekyll/converters/csv.rb",
|
||||
|
@ -94,7 +94,7 @@ Gem::Specification.new do |s|
|
|||
s.homepage = %q{http://github.com/mojombo/jekyll}
|
||||
s.rdoc_options = ["--charset=UTF-8"]
|
||||
s.require_paths = ["lib"]
|
||||
s.rubyforge_project = %q{krisb-jekyll}
|
||||
s.rubyforge_project = %q{jekyll}
|
||||
s.rubygems_version = %q{1.3.5}
|
||||
s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
|
||||
s.test_files = [
|
||||
|
|
|
@ -43,7 +43,6 @@ module Jekyll
|
|||
'pygments' => false,
|
||||
'markdown' => 'maruku',
|
||||
'permalink' => 'date',
|
||||
'extensions' => false,
|
||||
|
||||
'maruku' => {
|
||||
'use_tex' => false,
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
#
|
||||
# Requires
|
||||
# self.site -> Jekyll::Site
|
||||
# self.content=
|
||||
# self.data=
|
||||
# self.ext=
|
||||
# self.output=
|
||||
module Jekyll
|
||||
module Convertible
|
||||
# Return the contents as a string
|
||||
|
|
|
@ -18,9 +18,12 @@ module Jekyll
|
|||
name =~ MATCHER
|
||||
end
|
||||
|
||||
attr_accessor :site
|
||||
attr_accessor :data, :content, :output, :ext
|
||||
attr_accessor :date, :slug, :published, :tags, :categories
|
||||
attr_accessor :site, :date, :slug, :ext, :published, :data, :content, :output, :tags
|
||||
attr_writer :categories
|
||||
|
||||
def categories
|
||||
@categories ||= []
|
||||
end
|
||||
|
||||
# Initialize this Post instance.
|
||||
# +site+ is the Site
|
||||
|
@ -48,8 +51,9 @@ module Jekyll
|
|||
self.tags = [self.data["tag"]]
|
||||
elsif self.data.has_key?("tags")
|
||||
self.tags = self.data['tags']
|
||||
else
|
||||
self.tags = []
|
||||
end
|
||||
self.tags ||= []
|
||||
|
||||
if self.categories.empty?
|
||||
if self.data.has_key?('category')
|
||||
|
@ -64,7 +68,6 @@ module Jekyll
|
|||
end
|
||||
end
|
||||
end
|
||||
self.categories ||= []
|
||||
end
|
||||
|
||||
# Spaceship is based on Post#date, slug
|
||||
|
|
|
@ -2,8 +2,7 @@ module Jekyll
|
|||
|
||||
class Site
|
||||
attr_accessor :config, :layouts, :posts, :pages, :static_files, :categories, :exclude,
|
||||
:source, :dest, :lsi, :pygments, :permalink_style, :tags,
|
||||
:extensions
|
||||
:source, :dest, :lsi, :pygments, :permalink_style, :tags
|
||||
|
||||
# Initialize the site
|
||||
# +config+ is a Hash containing site configurations details
|
||||
|
@ -18,7 +17,6 @@ module Jekyll
|
|||
self.pygments = config['pygments']
|
||||
self.permalink_style = config['permalink'].to_sym
|
||||
self.exclude = config['exclude'] || []
|
||||
self.extensions = config['extensions']
|
||||
|
||||
self.reset
|
||||
self.setup
|
||||
|
@ -84,12 +82,6 @@ module Jekyll
|
|||
else
|
||||
raise "Invalid Markdown processor: '#{self.config['markdown']}' -- did you mean 'maruku' or 'rdiscount'?"
|
||||
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
|
||||
|
||||
def textile(content)
|
||||
|
|
|
@ -36,7 +36,6 @@ class TestPost < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
should "keep date, title, and markup type" do
|
||||
@post.categories = []
|
||||
@post.process(@fake_file)
|
||||
|
||||
assert_equal Time.parse("2008-10-19"), @post.date
|
||||
|
@ -215,13 +214,6 @@ class TestPost < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
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
|
||||
post = setup_post("2008-02-02-published.textile")
|
||||
assert_equal true, post.published
|
||||
|
|
Loading…
Reference in New Issue