Merge branch 'master' of https://github.com/mojombo/jekyll into permalink-special-characters

This commit is contained in:
Lucas Jenss 2013-07-25 21:33:55 +02:00
commit 41b2f0824e
33 changed files with 794 additions and 239 deletions

View File

@ -1,8 +1,51 @@
## HEAD ## HEAD
### Major Enhancements ### Major Enhancements
* Add 'docs' subcommand to read Jekyll's docs when offline. (#1046)
* Support passing parameters to templates in 'include' tag (#1204) ### Minor Enhancements
### Bug Fixes
### Development Fixes
### Site Enhancements
* Add info about new releases (#1353)
* Update plugin list with jekyll-rss plugin (#1354)
## v1.1.2 / 2013-07-25
### Bug Fixes
* Require Liquid 2.5.1 (#1349)
## v1.1.1 / 2013-07-24
### Minor Enhancements
* Remove superfluous `table` selector from main.css in `jekyll new` template (#1328)
* Abort with non-zero exit codes (#1338)
### Bug Fixes
* Fix up the rendering of excerpts (#1339)
### Site Enhancements
* Add Jekyll Image Tag to the plugins list (#1306)
* Remove erroneous statement that `site.pages` are sorted alphabetically.
* Add info about the `_drafts` directory to the directory structure
docs (#1320)
* Improve the layout of the plugin listing by organizing it into
categories (#1310)
* Add generator-jekyllrb and grunt-jekyll to plugins page (#1330)
* Mention Kramdown as option for markdown parser on Extras page (#1318)
* Update Quick-Start page to include reminder that all requirements must be installed (#1327)
* Change filename in `include` example to an HTML file so as not to indicate that Jekyll
will automatically convert them. (#1303)
* Add an RSS feed for commits to Jekyll (#1343)
## 1.1.0 / 2013-07-14
### Major Enhancements
* Add `docs` subcommand to read Jekyll's docs when offline. (#1046)
* Support passing parameters to templates in `include` tag (#1204)
* Add support for Liquid tags to post excerpts (#1302)
### Minor Enhancements ### Minor Enhancements
* Search the hierarchy of pagination path up to site root to determine template page for * Search the hierarchy of pagination path up to site root to determine template page for
@ -14,6 +57,8 @@
sites. (#1247) sites. (#1247)
* In the generated site, remove files that will be replaced by a * In the generated site, remove files that will be replaced by a
directory (#1118) directory (#1118)
* Fail loudly if a user-specified configuration file doesn't exist (#1098)
* Allow for all options for Kramdown HTML Converter (#1201)
### Bug Fixes ### Bug Fixes
* Fix pagination in subdirectories. (#1198) * Fix pagination in subdirectories. (#1198)
@ -27,6 +72,7 @@
* Restrict activesupport dependency to pre-4.0.0 to maintain compatibility with `<= 1.9.2` * Restrict activesupport dependency to pre-4.0.0 to maintain compatibility with `<= 1.9.2`
* Include/exclude deprecation handling simplification (#1284) * Include/exclude deprecation handling simplification (#1284)
* Convert README to Markdown. (#1267) * Convert README to Markdown. (#1267)
* Refactor Jekyll::Site (#1144)
### Site Enhancements ### Site Enhancements
* Add "News" section for release notes, along with an RSS feed (#1093, #1285, #1286) * Add "News" section for release notes, along with an RSS feed (#1093, #1285, #1286)
@ -63,8 +109,8 @@
* Update the S3 deployment documentation (#1294) * Update the S3 deployment documentation (#1294)
* Add suggestion for Xcode CLT install to troubleshooting page in docs (#1296) * Add suggestion for Xcode CLT install to troubleshooting page in docs (#1296)
* Add 'Working with drafts' page to docs (#1289) * Add 'Working with drafts' page to docs (#1289)
* Add information about time zones to the documentation for a page's
### Development Fixes date (#1304)
## 1.0.3 / 2013-06-07 ## 1.0.3 / 2013-06-07

View File

@ -12,7 +12,7 @@ program :name, 'jekyll'
program :version, Jekyll::VERSION program :version, Jekyll::VERSION
program :description, 'Jekyll is a blog-aware, static site generator in Ruby' program :description, 'Jekyll is a blog-aware, static site generator in Ruby'
default_command :help default_command :default
global_option '-s', '--source [DIR]', 'Source directory (defaults to ./)' global_option '-s', '--source [DIR]', 'Source directory (defaults to ./)'
global_option '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)' global_option '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
@ -33,6 +33,16 @@ def normalize_options(options)
options options
end end
command :default do |c|
c.action do |args, options|
if args.empty?
command(:help).run
else
Jekyll.logger.abort_with "Invalid command. Use --help for more information"
end
end
end
command :new do |c| command :new do |c|
c.syntax = 'jekyll new PATH' c.syntax = 'jekyll new PATH'
c.description = 'Creates a new Jekyll site scaffold in PATH' c.description = 'Creates a new Jekyll site scaffold in PATH'

View File

@ -0,0 +1,50 @@
Feature: Post excerpts
As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
But some people can only focus for a few moments
So just give them a taste
Scenario: An excerpt without a layout
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | content for entry1. |
When I run jekyll
Then the _site directory should exist
And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
Scenario: An excerpt from a post with a layout
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory
And I have a _layouts directory
And I have a post layout that contains "{{ page.excerpt }}"
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | content for entry1. |
When I run jekyll
Then the _site directory should exist
And the _site/2007 directory should exist
And the _site/2007/12 directory should exist
And the _site/2007/12/31 directory should exist
And the "_site/2007/12/31/entry1.html" file should exist
And I should see exactly "<p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
Scenario: An excerpt from a post with a layout which has context
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory
And I have a _layouts directory
And I have a post layout that contains "<html><head></head><body>{{ page.excerpt }}</body></html>"
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | content for entry1. |
When I run jekyll
Then the _site directory should exist
And the _site/2007 directory should exist
And the _site/2007/12 directory should exist
And the _site/2007/12/31 directory should exist
And the "_site/2007/12/31/entry1.html" file should exist
And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
And I should see exactly "<html><head></head><body><p>content for entry1.</p></body></html>" in "_site/2007/12/31/entry1.html"

View File

@ -4,6 +4,8 @@ Before do
Dir.chdir(TEST_DIR) Dir.chdir(TEST_DIR)
end end
World(Test::Unit::Assertions)
Given /^I have a blank site in "(.*)"$/ do |path| Given /^I have a blank site in "(.*)"$/ do |path|
FileUtils.mkdir(path) FileUtils.mkdir(path)
end end
@ -143,6 +145,10 @@ Then /^I should see "(.*)" in "(.*)"$/ do |text, file|
assert Regexp.new(text).match(File.open(file).readlines.join) assert Regexp.new(text).match(File.open(file).readlines.join)
end end
Then /^I should see exactly "(.*)" in "(.*)"$/ do |text, file|
assert_equal text, File.open(file).readlines.join.strip
end
Then /^I should not see "(.*)" in "(.*)"$/ do |text, file| Then /^I should not see "(.*)" in "(.*)"$/ do |text, file|
assert_no_match Regexp.new(text), File.read(file) assert_no_match Regexp.new(text), File.read(file)
end end

View File

@ -4,9 +4,9 @@ Gem::Specification.new do |s|
s.rubygems_version = '1.3.5' s.rubygems_version = '1.3.5'
s.name = 'jekyll' s.name = 'jekyll'
s.version = '1.0.3' s.version = '1.1.2'
s.license = 'MIT' s.license = 'MIT'
s.date = '2013-06-07' s.date = '2013-07-25'
s.rubyforge_project = 'jekyll' s.rubyforge_project = 'jekyll'
s.summary = "A simple, blog aware, static site generator." s.summary = "A simple, blog aware, static site generator."
@ -23,7 +23,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"] s.rdoc_options = ["--charset=UTF-8"]
s.extra_rdoc_files = %w[README.markdown LICENSE] s.extra_rdoc_files = %w[README.markdown LICENSE]
s.add_runtime_dependency('liquid', "~> 2.3") s.add_runtime_dependency('liquid', "~> 2.5.1")
s.add_runtime_dependency('classifier', "~> 1.3") s.add_runtime_dependency('classifier', "~> 1.3")
s.add_runtime_dependency('directory_watcher', "~> 1.4.1") s.add_runtime_dependency('directory_watcher', "~> 1.4.1")
s.add_runtime_dependency('maruku', "~> 0.5") s.add_runtime_dependency('maruku', "~> 0.5")
@ -60,10 +60,12 @@ Gem::Specification.new do |s|
features/create_sites.feature features/create_sites.feature
features/drafts.feature features/drafts.feature
features/embed_filters.feature features/embed_filters.feature
features/include_tag.feature
features/markdown.feature features/markdown.feature
features/pagination.feature features/pagination.feature
features/permalinks.feature features/permalinks.feature
features/post_data.feature features/post_data.feature
features/post_excerpts.feature
features/site_configuration.feature features/site_configuration.feature
features/site_data.feature features/site_data.feature
features/step_definitions/jekyll_steps.rb features/step_definitions/jekyll_steps.rb
@ -89,6 +91,7 @@ Gem::Specification.new do |s|
lib/jekyll/deprecator.rb lib/jekyll/deprecator.rb
lib/jekyll/draft.rb lib/jekyll/draft.rb
lib/jekyll/errors.rb lib/jekyll/errors.rb
lib/jekyll/excerpt.rb
lib/jekyll/filters.rb lib/jekyll/filters.rb
lib/jekyll/generator.rb lib/jekyll/generator.rb
lib/jekyll/generators/pagination.rb lib/jekyll/generators/pagination.rb
@ -123,11 +126,24 @@ Gem::Specification.new do |s|
site/_includes/docs_contents_mobile.html site/_includes/docs_contents_mobile.html
site/_includes/footer.html site/_includes/footer.html
site/_includes/header.html site/_includes/header.html
site/_includes/news_contents.html
site/_includes/news_contents_mobile.html
site/_includes/news_item.html
site/_includes/primary-nav-items.html site/_includes/primary-nav-items.html
site/_includes/section_nav.html site/_includes/section_nav.html
site/_includes/top.html site/_includes/top.html
site/_layouts/default.html site/_layouts/default.html
site/_layouts/docs.html site/_layouts/docs.html
site/_layouts/news.html
site/_layouts/news_item.html
site/_posts/2013-05-06-jekyll-1-0-0-released.markdown
site/_posts/2013-05-08-jekyll-1-0-1-released.markdown
site/_posts/2013-05-12-jekyll-1-0-2-released.markdown
site/_posts/2013-06-07-jekyll-1-0-3-released.markdown
site/_posts/2013-07-14-jekyll-1-1-0-released.markdown
site/_posts/2013-07-24-jekyll-1-1-1-released.markdown
site/_posts/2013-07-25-jekyll-1-0-4-released.markdown
site/_posts/2013-07-25-jekyll-1-1-2-released.markdown
site/css/gridism.css site/css/gridism.css
site/css/normalize.css site/css/normalize.css
site/css/pygments.css site/css/pygments.css
@ -135,6 +151,7 @@ Gem::Specification.new do |s|
site/docs/configuration.md site/docs/configuration.md
site/docs/contributing.md site/docs/contributing.md
site/docs/deployment-methods.md site/docs/deployment-methods.md
site/docs/drafts.md
site/docs/extras.md site/docs/extras.md
site/docs/frontmatter.md site/docs/frontmatter.md
site/docs/github-pages.md site/docs/github-pages.md
@ -148,6 +165,7 @@ Gem::Specification.new do |s|
site/docs/permalinks.md site/docs/permalinks.md
site/docs/plugins.md site/docs/plugins.md
site/docs/posts.md site/docs/posts.md
site/docs/quickstart.md
site/docs/resources.md site/docs/resources.md
site/docs/sites.md site/docs/sites.md
site/docs/structure.md site/docs/structure.md
@ -157,6 +175,8 @@ Gem::Specification.new do |s|
site/docs/usage.md site/docs/usage.md
site/docs/variables.md site/docs/variables.md
site/favicon.png site/favicon.png
site/feed.xml
site/freenode.txt
site/img/article-footer.png site/img/article-footer.png
site/img/footer-arrow.png site/img/footer-arrow.png
site/img/footer-logo.png site/img/footer-logo.png
@ -166,13 +186,17 @@ Gem::Specification.new do |s|
site/img/tube1x.png site/img/tube1x.png
site/index.html site/index.html
site/js/modernizr-2.5.3.min.js site/js/modernizr-2.5.3.min.js
site/news/index.md
site/news/releases/index.md
test/fixtures/broken_front_matter1.erb test/fixtures/broken_front_matter1.erb
test/fixtures/broken_front_matter2.erb test/fixtures/broken_front_matter2.erb
test/fixtures/broken_front_matter3.erb test/fixtures/broken_front_matter3.erb
test/fixtures/exploit_front_matter.erb test/fixtures/exploit_front_matter.erb
test/fixtures/front_matter.erb test/fixtures/front_matter.erb
test/helper.rb test/helper.rb
test/source/+/foo.md
test/source/.htaccess test/source/.htaccess
test/source/_includes/params.html
test/source/_includes/sig.markdown test/source/_includes/sig.markdown
test/source/_layouts/default.html test/source/_layouts/default.html
test/source/_layouts/simple.html test/source/_layouts/simple.html
@ -208,6 +232,7 @@ Gem::Specification.new do |s|
test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep
test/source/_posts/2013-04-11-custom-excerpt.markdown test/source/_posts/2013-04-11-custom-excerpt.markdown
test/source/_posts/2013-05-10-number-category.textile test/source/_posts/2013-05-10-number-category.textile
test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown
test/source/_posts/es/2008-11-21-nested.textile test/source/_posts/es/2008-11-21-nested.textile
test/source/about.html test/source/about.html
test/source/category/_posts/2008-9-23-categories.textile test/source/category/_posts/2008-9-23-categories.textile
@ -228,6 +253,7 @@ Gem::Specification.new do |s|
test/test_configuration.rb test/test_configuration.rb
test/test_convertible.rb test/test_convertible.rb
test/test_core_ext.rb test/test_core_ext.rb
test/test_excerpt.rb
test/test_filters.rb test/test_filters.rb
test/test_generated_site.rb test/test_generated_site.rb
test/test_kramdown.rb test/test_kramdown.rb

View File

@ -37,6 +37,7 @@ require 'jekyll/url'
require 'jekyll/layout' require 'jekyll/layout'
require 'jekyll/page' require 'jekyll/page'
require 'jekyll/post' require 'jekyll/post'
require 'jekyll/excerpt'
require 'jekyll/draft' require 'jekyll/draft'
require 'jekyll/filters' require 'jekyll/filters'
require 'jekyll/static_file' require 'jekyll/static_file'
@ -58,7 +59,7 @@ require_all 'jekyll/tags'
SafeYAML::OPTIONS[:suppress_warnings] = true SafeYAML::OPTIONS[:suppress_warnings] = true
module Jekyll module Jekyll
VERSION = '1.0.3' VERSION = '1.1.2'
# Public: Generate a Jekyll configuration Hash by merging the default # Public: Generate a Jekyll configuration Hash by merging the default
# options with anything in _config.yml, and adding the given options on top. # options with anything in _config.yml, and adding the given options on top.

View File

@ -102,7 +102,10 @@ module Jekyll
def config_files(override) def config_files(override)
# Get configuration from <source>/_config.yml or <source>/<config_file> # Get configuration from <source>/_config.yml or <source>/<config_file>
config_files = override.delete('config') config_files = override.delete('config')
config_files = File.join(source(override), "_config.yml") if config_files.to_s.empty? if config_files.to_s.empty?
config_files = File.join(source(override), "_config.yml")
@default_config_file = true
end
config_files = [config_files] unless config_files.is_a? Array config_files = [config_files] unless config_files.is_a? Array
config_files config_files
end end
@ -114,9 +117,17 @@ module Jekyll
# Returns this configuration, overridden by the values in the file # Returns this configuration, overridden by the values in the file
def read_config_file(file) def read_config_file(file)
next_config = YAML.safe_load_file(file) next_config = YAML.safe_load_file(file)
raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash) raise ArgumentError.new("Configuration file: (INVALID) #{file}".yellow) if !next_config.is_a?(Hash)
Jekyll.logger.info "Configuration file:", file Jekyll.logger.info "Configuration file:", file
next_config next_config
rescue SystemCallError
if @default_config_file
Jekyll.logger.warn "Configuration file:", "none"
{}
else
Jekyll.logger.error "Fatal:", "The configuration file '#{file}' could not be found."
raise LoadError
end
end end
# Public: Read in a list of configuration files and merge with this hash # Public: Read in a list of configuration files and merge with this hash
@ -133,10 +144,7 @@ module Jekyll
new_config = read_config_file(config_file) new_config = read_config_file(config_file)
configuration = configuration.deep_merge(new_config) configuration = configuration.deep_merge(new_config)
end end
rescue SystemCallError rescue ArgumentError => err
# Errno:ENOENT = file not found
Jekyll.logger.warn "Configuration file:", "none"
rescue => err
Jekyll.logger.warn "WARNING:", "Error reading configuration. " + Jekyll.logger.warn "WARNING:", "Error reading configuration. " +
"Using defaults (and options)." "Using defaults (and options)."
$stderr.puts "#{err}" $stderr.puts "#{err}"

View File

@ -13,8 +13,8 @@ module Jekyll
def convert(content) def convert(content)
# Check for use of coderay # Check for use of coderay
kramdown_configs = if @config['kramdown']['use_coderay'] if @config['kramdown']['use_coderay']
base_kramdown_configs.merge({ @config['kramdown'].merge!({
:coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'], :coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'],
:coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'], :coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'],
:coderay_line_number_start => @config['kramdown']['coderay']['coderay_line_number_start'], :coderay_line_number_start => @config['kramdown']['coderay']['coderay_line_number_start'],
@ -22,22 +22,11 @@ module Jekyll
:coderay_bold_every => @config['kramdown']['coderay']['coderay_bold_every'], :coderay_bold_every => @config['kramdown']['coderay']['coderay_bold_every'],
:coderay_css => @config['kramdown']['coderay']['coderay_css'] :coderay_css => @config['kramdown']['coderay']['coderay_css']
}) })
else
# not using coderay
base_kramdown_configs
end end
Kramdown::Document.new(content, kramdown_configs).to_html
Kramdown::Document.new(content, @config["kramdown"].symbolize_keys).to_html
end end
def base_kramdown_configs
{
:auto_ids => @config['kramdown']['auto_ids'],
:footnote_nr => @config['kramdown']['footnote_nr'],
:entity_output => @config['kramdown']['entity_output'],
:toc_levels => @config['kramdown']['toc_levels'],
:smart_quotes => @config['kramdown']['smart_quotes']
}
end
end end
end end
end end

View File

@ -41,6 +41,17 @@ class Hash
end end
array || [] array || []
end end
def symbolize_keys!
keys.each do |key|
self[(key.to_sym rescue key) || key] = delete(key)
end
self
end
def symbolize_keys
dup.symbolize_keys!
end
end end
# Thanks, ActiveSupport! # Thanks, ActiveSupport!

113
lib/jekyll/excerpt.rb Normal file
View File

@ -0,0 +1,113 @@
module Jekyll
class Excerpt
include Convertible
attr_accessor :post
attr_accessor :content, :output, :ext
# Initialize this Post instance.
#
# site - The Site.
# base - The String path to the dir containing the post file.
# name - The String filename of the post file.
#
# Returns the new Post.
def initialize(post)
self.post = post
self.content = extract_excerpt(post.content)
end
%w[site name ext].each do |meth|
define_method(meth) do
post.send(meth)
end
end
def to_liquid
post.to_liquid(Post::EXCERPT_ATTRIBUTES_FOR_LIQUID)
end
# Fetch YAML front-matter data from related post, without layout key
#
# Returns Hash of post data
def data
@data ||= post.data.dup
@data.delete("layout")
@data
end
# 'Path' of the excerpt.
#
# Returns the path for the post this excerpt belongs to with #excerpt appended
def path
File.join(post.path, "#excerpt")
end
# Check if excerpt includes a string
#
# Returns true if the string passed in
def include?(something)
(self.output && self.output.include?(something)) || self.content.include?(something)
end
# The UID for this post (useful in feeds).
# e.g. /2008/11/05/my-awesome-post
#
# Returns the String UID.
def id
File.join(post.dir, post.slug, "#excerpt")
end
def to_s
self.output || self.content
end
# Returns the shorthand String identifier of this Post.
def inspect
"<Excerpt: #{self.id}>"
end
protected
# Internal: Extract excerpt from the content
#
# By default excerpt is your first paragraph of a post: everything before
# the first two new lines:
#
# ---
# title: Example
# ---
#
# First paragraph with [link][1].
#
# Second paragraph.
#
# [1]: http://example.com/
#
# This is fairly good option for Markdown and Textile files. But might cause
# problems for HTML posts (which is quite unusual for Jekyll). If default
# excerpt delimiter is not good for you, you might want to set your own via
# configuration option `excerpt_separator`. For example, following is a good
# alternative for HTML posts:
#
# # file: _config.yml
# excerpt_separator: "<!-- more -->"
#
# Notice that all markdown-style link references will be appended to the
# excerpt. So the example post above will have this excerpt source:
#
# First paragraph with [link][1].
#
# [1]: http://example.com/
#
# Excerpts are rendered same time as content is rendered.
#
# Returns excerpt String
def extract_excerpt(post_content)
separator = site.config['excerpt_separator']
head, _, tail = post_content.partition(separator)
"" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n")
end
end
end

View File

@ -11,8 +11,7 @@ module Jekyll
# Valid post name regex. # Valid post name regex.
MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/ MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/
# Attributes for Liquid templates EXCERPT_ATTRIBUTES_FOR_LIQUID = %w[
ATTRIBUTES_FOR_LIQUID = %w[
title title
url url
date date
@ -21,11 +20,15 @@ module Jekyll
next next
previous previous
tags tags
content
excerpt
path path
] ]
# Attributes for Liquid templates
ATTRIBUTES_FOR_LIQUID = EXCERPT_ATTRIBUTES_FOR_LIQUID.concat(%w[
content
excerpt
])
# Post name validator. Post filenames must be like: # Post name validator. Post filenames must be like:
# 2008-11-05-my-awesome-post.textile # 2008-11-05-my-awesome-post.textile
# #
@ -110,7 +113,7 @@ module Jekyll
if self.data.has_key? 'excerpt' if self.data.has_key? 'excerpt'
self.data['excerpt'] self.data['excerpt']
else else
self.extracted_excerpt self.extracted_excerpt.to_s
end end
end end
@ -159,14 +162,6 @@ module Jekyll
raise FatalException.new("Post #{name} does not have a valid date.") raise FatalException.new("Post #{name} does not have a valid date.")
end end
# Transform the contents and excerpt based on the content type.
#
# Returns nothing.
def transform
super
self.extracted_excerpt = converter.convert(self.extracted_excerpt)
end
# The generated directory into which the post will be placed # The generated directory into which the post will be placed
# upon generation. This is derived from the permalink or, if # upon generation. This is derived from the permalink or, if
# permalink is absent, set to the default date # permalink is absent, set to the default date
@ -241,10 +236,12 @@ module Jekyll
# construct payload # construct payload
payload = { payload = {
"site" => { "related_posts" => related_posts(site_payload["site"]["posts"]) }, "site" => { "related_posts" => related_posts(site_payload["site"]["posts"]) },
"page" => self.to_liquid "page" => self.to_liquid(EXCERPT_ATTRIBUTES_FOR_LIQUID)
}.deep_merge(site_payload) }.deep_merge(site_payload)
do_layout(payload, layouts) self.extracted_excerpt.do_layout(payload, {})
do_layout(payload.merge({"page" => self.to_liquid}), layouts)
end end
# Obtain destination path. # Obtain destination path.
@ -262,8 +259,8 @@ module Jekyll
# Convert this post into a Hash for use in Liquid templates. # Convert this post into a Hash for use in Liquid templates.
# #
# Returns the representative Hash. # Returns the representative Hash.
def to_liquid def to_liquid(attrs = ATTRIBUTES_FOR_LIQUID)
further_data = Hash[ATTRIBUTES_FOR_LIQUID.map { |attribute| further_data = Hash[attrs.map { |attribute|
[attribute, send(attribute)] [attribute, send(attribute)]
}] }]
data.deep_merge(further_data) data.deep_merge(further_data)
@ -295,45 +292,8 @@ module Jekyll
protected protected
# Internal: Extract excerpt from the content
#
# By default excerpt is your first paragraph of a post: everything before
# the first two new lines:
#
# ---
# title: Example
# ---
#
# First paragraph with [link][1].
#
# Second paragraph.
#
# [1]: http://example.com/
#
# This is fairly good option for Markdown and Textile files. But might cause
# problems for HTML posts (which is quite unusual for Jekyll). If default
# excerpt delimiter is not good for you, you might want to set your own via
# configuration option `excerpt_separator`. For example, following is a good
# alternative for HTML posts:
#
# # file: _config.yml
# excerpt_separator: "<!-- more -->"
#
# Notice that all markdown-style link references will be appended to the
# excerpt. So the example post above will have this excerpt source:
#
# First paragraph with [link][1].
#
# [1]: http://example.com/
#
# Excerpts are rendered same time as content is rendered.
#
# Returns excerpt String
def extract_excerpt def extract_excerpt
separator = self.site.config['excerpt_separator'] Jekyll::Excerpt.new(self)
head, _, tail = self.content.partition(separator)
"" << head << "\n\n" << tail.scan(/^\[[^\]]+\]:.+$/).join("\n")
end end
end end
end end

View File

@ -138,34 +138,19 @@ module Jekyll
entries = Dir.chdir(base) { filter_entries(Dir.entries('.')) } entries = Dir.chdir(base) { filter_entries(Dir.entries('.')) }
self.read_posts(dir) self.read_posts(dir)
self.read_drafts(dir) if self.show_drafts
if self.show_drafts
self.read_drafts(dir)
end
self.posts.sort! self.posts.sort!
limit_posts! if limit_posts > 0 # limit the posts if :limit_posts option is set
# limit the posts if :limit_posts option is set
if limit_posts > 0
limit = self.posts.length < limit_posts ? self.posts.length : limit_posts
self.posts = self.posts[-limit, limit]
end
entries.each do |f| entries.each do |f|
f_abs = File.join(base, f) f_abs = File.join(base, f)
f_rel = File.join(dir, f)
if File.directory?(f_abs) if File.directory?(f_abs)
next if self.dest.sub(/\/$/, '') == f_abs f_rel = File.join(dir, f)
read_directories(f_rel) read_directories(f_rel) unless self.dest.sub(/\/$/, '') == f_abs
elsif has_yaml_header?(f_abs)
pages << Page.new(self, self.source, dir, f)
else else
first3 = File.open(f_abs) { |fd| fd.read(3) } static_files << StaticFile.new(self, self.source, dir, f)
if first3 == "---"
# file appears to have a YAML header so process it as a page
pages << Page.new(self, self.source, dir, f)
else
# otherwise treat it as a static file
static_files << StaticFile.new(self, self.source, dir, f)
end
end end
end end
end end
@ -255,15 +240,7 @@ module Jekyll
# files to be written # files to be written
files = Set.new files = Set.new
self.posts.each do |post| each_site_file { |item| files << item.destination(self.dest) }
files << post.destination(self.dest)
end
self.pages.each do |page|
files << page.destination(self.dest)
end
self.static_files.each do |sf|
files << sf.destination(self.dest)
end
# adding files' parent directories # adding files' parent directories
dirs = Set.new dirs = Set.new
@ -294,15 +271,7 @@ module Jekyll
# #
# Returns nothing. # Returns nothing.
def write def write
self.posts.each do |post| each_site_file { |item| item.write(self.dest) }
post.write(self.dest)
end
self.pages.each do |page|
page.write(self.dest)
end
self.static_files.each do |sf|
sf.write(self.dest)
end
end end
# Construct a Hash of Posts indexed by the specified Post attribute. # Construct a Hash of Posts indexed by the specified Post attribute.
@ -434,5 +403,24 @@ module Jekyll
@deprecated_relative_permalinks = true @deprecated_relative_permalinks = true
end end
end end
def each_site_file
%w(posts pages static_files).each do |type|
self.send(type).each do |item|
yield item
end
end
end
private
def has_yaml_header?(file)
"---" == File.open(file) { |fd| fd.read(3) }
end
def limit_posts!
limit = self.posts.length < limit_posts ? self.posts.length : limit_posts
self.posts = self.posts[-limit, limit]
end
end end
end end

View File

@ -5,7 +5,7 @@ module Jekyll
DEBUG = 0 DEBUG = 0
INFO = 1 INFO = 1
WARN = 2 WARN = 2
ERROR = 3 ERROR = 3
# Public: Create a new instance of Stevenson, Jekyll's logger # Public: Create a new instance of Stevenson, Jekyll's logger
# #
@ -15,6 +15,16 @@ module Jekyll
def initialize(level = INFO) def initialize(level = INFO)
@log_level = level @log_level = level
end end
# Public: Print a jekyll debug message to stdout
#
# topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
# message - the message detail
#
# Returns nothing
def debug(topic, message = nil)
$stdout.puts(message(topic, message)) if log_level <= DEBUG
end
# Public: Print a jekyll message to stdout # Public: Print a jekyll message to stdout
# #
@ -22,7 +32,7 @@ module Jekyll
# message - the message detail # message - the message detail
# #
# Returns nothing # Returns nothing
def info(topic, message) def info(topic, message = nil)
$stdout.puts(message(topic, message)) if log_level <= INFO $stdout.puts(message(topic, message)) if log_level <= INFO
end end
@ -32,7 +42,7 @@ module Jekyll
# message - the message detail # message - the message detail
# #
# Returns nothing # Returns nothing
def warn(topic, message) def warn(topic, message = nil)
$stderr.puts(message(topic, message).yellow) if log_level <= WARN $stderr.puts(message(topic, message).yellow) if log_level <= WARN
end end
@ -42,10 +52,21 @@ module Jekyll
# message - the message detail # message - the message detail
# #
# Returns nothing # Returns nothing
def error(topic, message) def error(topic, message = nil)
$stderr.puts(message(topic, message).red) if log_level <= ERROR $stderr.puts(message(topic, message).red) if log_level <= ERROR
end end
# Public: Print a Jekyll error message to stderr and immediately abort the process
#
# topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
# message - the message detail (can be omitted)
#
# Returns nothing
def abort_with(topic, message = nil)
error(topic, message)
abort
end
# Public: Build a Jekyll topic method # Public: Build a Jekyll topic method
# #
# topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc. # topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.

View File

@ -29,11 +29,6 @@ a { color: #00a; }
a:hover { color: #000; } a:hover { color: #000; }
a:visited { color: #a0a; } a:visited { color: #a0a; }
table {
font-size: inherit;
font: 100%;
}
/*****************************************************************************/ /*****************************************************************************/
/* /*
/* Home /* Home

View File

@ -2,43 +2,43 @@
<aside> <aside>
<h4>Getting Started</h4> <h4>Getting Started</h4>
<ul> <ul>
<li class="{% if page.title == "Welcome" %}current{% endif %}"> <li class="{% if page.title == 'Welcome' %}current{% endif %}">
<a href="{{ site.url }}/docs/home">Welcome</a> <a href="{{ site.url }}/docs/home">Welcome</a>
</li> </li>
<li class="{% if page.title == "Quick-start guide" %}current{% endif %}"> <li class="{% if page.title == 'Quick-start guide' %}current{% endif %}">
<a href="{{ site.url }}/docs/quickstart">Quick-start guide</a> <a href="{{ site.url }}/docs/quickstart">Quick-start guide</a>
</li> </li>
<li class="{% if page.title == "Installation" %}current{% endif %}"> <li class="{% if page.title == 'Installation' %}current{% endif %}">
<a href="{{ site.url }}/docs/installation">Installation</a> <a href="{{ site.url }}/docs/installation">Installation</a>
</li> </li>
<li class="{% if page.title == "Basic Usage" %}current{% endif %}"> <li class="{% if page.title == 'Basic Usage' %}current{% endif %}">
<a href="{{ site.url }}/docs/usage">Basic Usage</a> <a href="{{ site.url }}/docs/usage">Basic Usage</a>
</li> </li>
<li class="{% if page.title == "Directory structure" %}current{% endif %}"> <li class="{% if page.title == 'Directory structure' %}current{% endif %}">
<a href="{{ site.url }}/docs/structure">Directory structure</a> <a href="{{ site.url }}/docs/structure">Directory structure</a>
</li> </li>
<li class="{% if page.title == "Configuration" %}current{% endif %}"> <li class="{% if page.title == 'Configuration' %}current{% endif %}">
<a href="{{ site.url }}/docs/configuration">Configuration</a> <a href="{{ site.url }}/docs/configuration">Configuration</a>
</li> </li>
</ul> </ul>
<h4>Your Content</h4> <h4>Your Content</h4>
<ul> <ul>
<li class="{% if page.title == "Front-matter" %}current{% endif %}"> <li class="{% if page.title == 'Front-matter' %}current{% endif %}">
<a href="{{ site.url }}/docs/frontmatter">Front-matter</a> <a href="{{ site.url }}/docs/frontmatter">Front-matter</a>
</li> </li>
<li class="{% if page.title == "Writing posts" %}current{% endif %}"> <li class="{% if page.title == 'Writing posts' %}current{% endif %}">
<a href="{{ site.url }}/docs/posts">Writing posts</a> <a href="{{ site.url }}/docs/posts">Writing posts</a>
</li> </li>
<li class="{% if page.title == "Working with drafts" %}current{% endif %}"> <li class="{% if page.title == 'Working with drafts' %}current{% endif %}">
<a href="{{ site.url }}/docs/drafts">Working with drafts</a> <a href="{{ site.url }}/docs/drafts">Working with drafts</a>
</li> </li>
<li class="{% if page.title == "Creating pages" %}current{% endif %}"> <li class="{% if page.title == 'Creating pages' %}current{% endif %}">
<a href="{{ site.url }}/docs/pages">Creating pages</a> <a href="{{ site.url }}/docs/pages">Creating pages</a>
</li> </li>
<li class="{% if page.title == "Variables" %}current{% endif %}"> <li class="{% if page.title == 'Variables' %}current{% endif %}">
<a href="{{ site.url }}/docs/variables">Variables</a> <a href="{{ site.url }}/docs/variables">Variables</a>
</li> </li>
<li class="{% if page.title == "Blog migrations" %}current{% endif %}"> <li class="{% if page.title == 'Blog migrations' %}current{% endif %}">
<a href="{{ site.url }}/docs/migrations">Blog migrations</a> <a href="{{ site.url }}/docs/migrations">Blog migrations</a>
</li> </li>
</ul> </ul>

View File

@ -5,6 +5,7 @@
<title>{{ page.title }}</title> <title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="alternate" type="application/rss+xml" title="Jekyll • Simple, blog-aware, static sites - Feed" href="/feed.xml" /> <link rel="alternate" type="application/rss+xml" title="Jekyll • Simple, blog-aware, static sites - Feed" href="/feed.xml" />
<link rel="alternate" type="application/atom+xml" title="Recent commits to Jekylls master branch" href="https://github.com/mojombo/jekyll/commits/master.atom" />
<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=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 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/normalize.css" />

View File

@ -0,0 +1,27 @@
---
layout: news_item
title: "Jekyll 1.1.0 Released"
date: "2013-07-14 19:38:02 +0200"
author: parkr
version: 1.1.0
categories: [release]
---
After a month of hard work, the Jekyll core team is excited to announce the release of
Jekyll v1.1.0! This latest release of Jekyll brings some really exciting new additions:
- Add `docs` subcommand to read Jekyll's docs when offline. ([#1046][])
- Support passing parameters to templates in `include` tag ([#1204][])
- Add support for Liquid tags to post excerpts ([#1302][])
- Fix pagination for subdirectories ([#1198][])
- Provide better error reporting when generating sites ([#1253][])
- Latest posts first in non-LSI `related_posts` ([#1271][])
See the [GitHub Release][] page for more a more detailed changelog for this release.
{% assign issue_numbers = "1046|1204|1302|1198|1171|1118|1098|1215|1253|1271" | split: "|" %}
{% for issue in issue_numbers %}
[#{{ issue }}]: https://github.com/mojombo/jekyll/issues/{{ issue }}
{% endfor %}
[GitHub Release]: https://github.com/mojombo/jekyll/releases/tag/v1.1.0

View File

@ -0,0 +1,31 @@
---
layout: news_item
title: "Jekyll 1.1.1 Released"
date: "2013-07-24 22:24:14 +0200"
author: parkr
version: 1.1.1
categories: [release]
---
Coming just 10 days after the release of v1.1.0, v1.1.1 is out with a patch for the nasty
excerpt inception bug ([#1339][]) and non-zero exit codes for invalid commands
([#1338][]).
To all those affected by the [strange excerpt bug in v1.1.0][#1321], I'm sorry. I think we
have it all patched up and it should be deployed to [GitHub Pages][gh_pages] in the next
couple weeks. Thank you for your patience!
If you're checking out v1.1.x for the first time, definitely check out [what shipped with
v1.1.0!][v1_1_0]
See the [GitHub Release][] page for more a more detailed changelog for this release.
{% assign issue_numbers = "1339|1338|1321" | split: "|" %}
{% for issue in issue_numbers %}
[{{ issue }}]: https://github.com/mojombo/jekyll/issues/{{ issue }}
{% endfor %}
[GitHub Release]: https://github.com/mojombo/jekyll/releases/tag/v1.1.1
[gh-pages]: http://pages.github.com
[v1_1_0]: https://github.com/mojombo/jekyll/releases/tag/v1.1.0

View File

@ -0,0 +1,20 @@
---
layout: news_item
title: "Jekyll 1.0.4 Released"
date: "2013-07-25 09:08:38 +0200"
author: mattr-
version: 1.0.4
categories: [release]
---
Version 1.0.4 fixes a minor, but nonetheless important security vulnerability affecting several third-party Jekyll plugins. If your Jekyll site does not use plugins, you may, but are not required to upgrade at this time.
Community and custom plugins extending the `Liquid::Drop` class may inadvertently disclose some system information such as directory structure or software configuration to users with access to the Liquid templating system.
We recommend you upgrade to Jekyll v1.0.4 immediately if you use `Liquid::Drop` plugins on your Jekyll site.
Many thanks for [Ben Balter](http://github.com/benbalter) for alerting us to the problem
and [submitting a patch][1349] so quickly.
[230]: https://github.com/Shopify/liquid/pull/230
[1349]: https://github.com/mojombo/jekyll/issues/1349

View File

@ -0,0 +1,20 @@
---
layout: news_item
title: "Jekyll 1.1.2 Released"
date: "2013-07-25 09:08:38 +0200"
author: parkr
version: 1.1.2
categories: [release]
---
Version 1.1.2 fixes a minor, but nonetheless important security vulnerability affecting several third-party Jekyll plugins. If your Jekyll site does not use plugins, you may, but are not required to upgrade at this time.
Community and custom plugins extending the `Liquid::Drop` class may inadvertently disclose some system information such as directory structure or software configuration to users with access to the Liquid templating system.
We recommend you upgrade to Jekyll v1.1.2 immediately if you use `Liquid::Drop` plugins on your Jekyll site.
Many thanks for [Ben Balter](http://github.com/benbalter) for alerting us to the problem
and [submitting a patch][1349] so quickly.
[230]: https://github.com/Shopify/liquid/pull/230
[1349]: https://github.com/mojombo/jekyll/issues/1349

View File

@ -236,7 +236,16 @@ before your site is served.
Jekyll runs with the following configuration options by default. Unless Jekyll runs with the following configuration options by default. Unless
alternative settings for these options are explicitly specified in the alternative settings for these options are explicitly specified in the
configuration file or on the command-line, Jekyll will run using these options. [[configuration]] file or on the command-line, Jekyll will run using these options.
<div class="note warning">
<h5>There are two unsupported kramdown options</h5>
<p>
Please note that both remove_block_html_tags and
remove_span_html_tags are currently unsupported in jekyll due to the
fact that they are not included within the kramdown HTML converter.
</p>
</div>
{% highlight yaml %} {% highlight yaml %}
source: . source: .

View File

@ -19,17 +19,38 @@ fork](http://github.com/remi/maruku).
## RDiscount ## RDiscount
If you prefer to use [RDiscount](http://github.com/rtomayko/rdiscount) instead If you prefer to use [RDiscount](http://github.com/rtomayko/rdiscount) instead
of [Maruku](http://github.com/bhollis/maruku) for markdown, just make sure you have of [Maruku](http://github.com/bhollis/maruku) for Markdown, just make sure you have
it installed: it installed:
{% highlight bash %} {% highlight bash %}
$ sudo gem install rdiscount $ [sudo] gem install rdiscount
{% endhighlight %} {% endhighlight %}
And then specify RDiscount as the Markdown engine in your `_config.yml` file to And then specify RDiscount as the Markdown engine in your `_config.yml` file to
have Jekyll run with that option. have Jekyll run with that option.
{% highlight bash %} {% highlight yaml %}
# In _config.yml # In _config.yml
markdown: rdiscount markdown: rdiscount
{% endhighlight %} {% endhighlight %}
## Kramdown
You can also use [Kramdown](http://kramdown.rubyforge.org/) instead of Maruku
for Markdown. Make sure that Kramdown is installed:
{% highlight bash %}
$ [sudo] gem install kramdown
{% endhighlight %}
Then you can specify Kramdown as the Markdown engine in `_config.yml`.
{% highlight yaml %}
# In _config.yml
markdown: kramdown
{% endhighlight %}
Kramdown has various options for customizing the HTML output. The
[Configuration](/docs/configuration/) page lists the default options used by
Jekyll. A complete list of options is also available on the [Kramdown
website](http://kramdown.rubyforge.org/options.html).

View File

@ -5,6 +5,78 @@ permalink: /docs/history/
prev_section: contributing prev_section: contributing
--- ---
## 1.1.0 / 2013-07-14
### Major Enhancements
- Add `docs` subcommand to read Jekyll's docs when offline. ([#1046](https://github.com/mojombo/jekyll/issues/1046))
- Support passing parameters to templates in `include` tag ([#1204](https://github.com/mojombo/jekyll/issues/1204))
- Add support for Liquid tags to post excerpts ([#1302](https://github.com/mojombo/jekyll/issues/1302))
### Minor Enhancements
- Search the hierarchy of pagination path up to site root to determine template page for
pagination. ([#1198](https://github.com/mojombo/jekyll/issues/1198))
- Add the ability to generate a new Jekyll site without a template ([#1171](https://github.com/mojombo/jekyll/issues/1171))
- Use redcarpet as the default markdown engine in newly generated
sites ([#1245](https://github.com/mojombo/jekyll/issues/1245), [#1247](https://github.com/mojombo/jekyll/issues/1247))
- Add `redcarpet` as a runtime dependency so `jekyll build` works out-of-the-box for new
sites. ([#1247](https://github.com/mojombo/jekyll/issues/1247))
- In the generated site, remove files that will be replaced by a
directory ([#1118](https://github.com/mojombo/jekyll/issues/1118))
- Fail loudly if a user-specified configuration file doesn't exist ([#1098](https://github.com/mojombo/jekyll/issues/1098))
- Allow for all options for Kramdown HTML Converter ([#1201](https://github.com/mojombo/jekyll/issues/1201))
### Bug Fixes
- Fix pagination in subdirectories. ([#1198](https://github.com/mojombo/jekyll/issues/1198))
- Fix an issue with directories and permalinks that have a plus sign
(+) in them ([#1215](https://github.com/mojombo/jekyll/issues/1215))
- Provide better error reporting when generating sites ([#1253](https://github.com/mojombo/jekyll/issues/1253))
- Latest posts first in non-LSI `related_posts` ([#1271](https://github.com/mojombo/jekyll/issues/1271))
### Development Fixes
- Merge the theme and layout cucumber steps into one step ([#1151](https://github.com/mojombo/jekyll/issues/1151))
- Restrict activesupport dependency to pre-4.0.0 to maintain compatibility with `<= 1.9.2`
- Include/exclude deprecation handling simplification ([#1284](https://github.com/mojombo/jekyll/issues/1284))
- Convert README to Markdown. ([#1267](https://github.com/mojombo/jekyll/issues/1267))
- Refactor Jekyll::Site ([#1144](https://github.com/mojombo/jekyll/issues/1144))
### Site Enhancements
- Add "News" section for release notes, along with an RSS feed ([#1093](https://github.com/mojombo/jekyll/issues/1093), [#1285](https://github.com/mojombo/jekyll/issues/1285), [#1286](https://github.com/mojombo/jekyll/issues/1286))
- Add "History" page.
- Restructured docs sections to include "Meta" section.
- Add message to "Templates" page that specifies that Python must be installed in order
to use Pygments. ([#1182](https://github.com/mojombo/jekyll/issues/1182))
- Update link to the official Maruku repo ([#1175](https://github.com/mojombo/jekyll/issues/1175))
- Add documentation about `paginate_path` to "Templates" page in docs ([#1129](https://github.com/mojombo/jekyll/issues/1129))
- Give the quick-start guide its own page ([#1191](https://github.com/mojombo/jekyll/issues/1191))
- Update ProTip on Installation page in docs to point to all the info about Pygments and
the 'highlight' tag. ([#1196](https://github.com/mojombo/jekyll/issues/1196))
- Run `site/img` through ImageOptim (thanks [@qrush](https://github.com/qrush)!) ([#1208](https://github.com/mojombo/jekyll/issues/1208))
- Added Jade Converter to `site/docs/plugins` ([#1210](https://github.com/mojombo/jekyll/issues/1210))
- Fix location of docs pages in Contributing pages ([#1214](https://github.com/mojombo/jekyll/issues/1214))
- Add ReadInXMinutes plugin to the plugin list ([#1222](https://github.com/mojombo/jekyll/issues/1222))
- Remove plugins from the plugin list that have equivalents in Jekyll
proper ([#1223](https://github.com/mojombo/jekyll/issues/1223))
- Add jekyll-assets to the plugin list ([#1225](https://github.com/mojombo/jekyll/issues/1225))
- Add jekyll-pandoc-mulitple-formats to the plugin list ([#1229](https://github.com/mojombo/jekyll/issues/1229))
- Remove dead link to "Using Git to maintain your blog" ([#1227](https://github.com/mojombo/jekyll/issues/1227))
- Tidy up the third-party plugins listing ([#1228](https://github.com/mojombo/jekyll/issues/1228))
- Update contributor information ([#1192](https://github.com/mojombo/jekyll/issues/1192))
- Update URL of article about Blogger migration ([#1242](https://github.com/mojombo/jekyll/issues/1242))
- Specify that RedCarpet is the default for new Jekyll sites on Quickstart page ([#1247](https://github.com/mojombo/jekyll/issues/1247))
- Added site.pages to Variables page in docs ([#1251](https://github.com/mojombo/jekyll/issues/1251))
- Add Youku and Tudou Embed link on Plugins page. ([#1250](https://github.com/mojombo/jekyll/issues/1250))
- Add note that `gist` tag supports private gists. ([#1248](https://github.com/mojombo/jekyll/issues/1248))
- Add `jekyll-timeago` to list of third-party plugins. ([#1260](https://github.com/mojombo/jekyll/issues/1260))
- Add `jekyll-swfobject` to list of third-party plugins. ([#1263](https://github.com/mojombo/jekyll/issues/1263))
- Add `jekyll-picture-tag` to list of third-party plugins. ([#1280](https://github.com/mojombo/jekyll/issues/1280))
- Update the GitHub Pages documentation regarding relative URLs
([#1291](https://github.com/mojombo/jekyll/issues/1291))
- Update the S3 deployment documentation ([#1294](https://github.com/mojombo/jekyll/issues/1294))
- Add suggestion for Xcode CLT install to troubleshooting page in docs ([#1296](https://github.com/mojombo/jekyll/issues/1296))
- Add 'Working with drafts' page to docs ([#1289](https://github.com/mojombo/jekyll/issues/1289))
- Add information about time zones to the documentation for a page's
date ([#1304](https://github.com/mojombo/jekyll/issues/1304))
## 1.0.3 / 2013-06-07 ## 1.0.3 / 2013-06-07
### Minor Enhancements ### Minor Enhancements

View File

@ -350,91 +350,107 @@ end
## Available Plugins ## Available Plugins
There are a few useful, prebuilt plugins at the following locations: You can find a few useful plugins at the following locations:
- [Truncate HTML while preserving markup structure](https://github.com/MattHall/truncatehtml) by [Matt Hall](http://codebeef.com) #### Generators
- [Domain Name Filter by Lawrence Woodman](https://github.com/LawrenceWoodman/domain_name-liquid_filter): Filters the input text so that just the domain name is left
- [Jekyll Plugins by Recursive Design](http://recursive-design.com/projects/jekyll-plugins/): Plugin to generate Project pages from GitHub readmes, a Category page plugin, and a Sitemap generator
- [Pygments Cache Path by Raimonds Simanovskis](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb): Plugin to cache syntax-highlighted code from Pygments
- [Delicious Plugin by Christian Hellsten](https://github.com/christianhellsten/jekyll-plugins): Fetches and renders bookmarks from delicious.com.
- [Ultraviolet plugin by Steve Alex](https://gist.github.com/480380): Jekyll Plugin for Ultraviolet
- [Jade plugin by John Papandriopoulos](https://github.com/snappylabs/jade-jekyll-plugin): Jade Converter plugin for Jekyll
- [HAML plugin by Sam Z](https://gist.github.com/517556): HAML plugin for jekyll
- [ArchiveGenerator by Ilkka Laukkanen](https://gist.github.com/707909): Uses [this archive page](https://gist.github.com/707020) to generate archives
- [Tag Cloud Plugin by Ilkka Laukkanen](https://gist.github.com/710577): Jekyll tag cloud / tag pages plugin
- [HAML/SASS Converter by Adam Pearson](https://gist.github.com/481456): Simple haml-sass conversion for jekyll. [Fork](https://gist.github.com/528642) by Sam X
- [SASS scss Converter by Mark Wolfe](https://gist.github.com/960150): Jekyll Converter which uses the new css compatible syntax, based on the one written by Sam X.
- [GIT Tag by Alexandre Girard](https://gist.github.com/730347): Jekyll plugin to add Git activity inside a list
- [Draft/Publish Plugin by Michael Ivey](https://gist.github.com/49630)
- [Less.js generator by Andy Fowler](https://gist.github.com/642739): Jekyll plugin to render less.js files during generation.
- [Less Converter by Jason Graham](https://gist.github.com/639920): A Jekyll plugin to convert a .less file to .css
- [Less Converter by Josh Brown](https://gist.github.com/760265)
- [MathJax Liquid Tags by Jessy Cowan-Sharp](https://gist.github.com/834610): A simple liquid tag for Jekyll that converts and into inline math, and and into block equations, by replacing with the appropriate MathJax script tags. - [ArchiveGenerator by Ilkka Laukkanen](https://gist.github.com/707909): Uses [this archive page](https://gist.github.com/707020) to generate archives.
- [Non-JS Gist Tag by Brandon Tilley](https://gist.github.com/1027674) A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers. - [LESS.js Generator by Andy Fowler](https://gist.github.com/642739): Renders LESS.js files during generation.
- [Growl Notification Generator by Tate Johnson](https://gist.github.com/490101) - [Version Reporter by Blake Smith](https://gist.github.com/449491): Creates a version.html file containing the Jekyll version.
- [Growl Notification Hook by Tate Johnson](https://gist.github.com/525267): Better alternative to the above, but requires his “hook” fork. - [Sitemap.xml Generator by Michael Levin](https://github.com/kinnetica/jekyll-plugins): Generates a sitemap.xml file by traversing all of the available posts and pages.
- [Version Reporter by Blake Smith](https://gist.github.com/449491) - [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Adds full-text search to your Jekyll site with a plugin and a bit of JavaScript.
- [Upcase Converter by Blake Smith](https://gist.github.com/449463) - [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias is specified in the YAML Front Matter.
- [Render Time Tag by Blake Smith](https://gist.github.com/449509) - [Projectlist by Frederic Hemberger](https://github.com/fhemberger/jekyll-projectlist): Renders files in a directory as a single page instead of separate posts.
- [Summarize Filter by Mathieu Arnold](https://gist.github.com/731597) - [RssGenerator by Assaf Gelber](https://github.com/agelber/jekyll-rss): Automatically creates an RSS 2.0 feed from your posts.
- [Status.net/OStatus Tag by phaer](https://gist.github.com/912466)
- [CoffeeScript converter by phaer](https://gist.github.com/959938): Put this file in `plugins` and write a YAML header to your .coffee files. See [http://coffeescript.org](http://coffeescript.org) for more info #### Converters
- [Raw Tag by phaer.](https://gist.github.com/1020852): Keeps liquid from parsing text betweeen `{{ "{% raw " }}%}` and `{{ "{% endraw " }}%}`
- [URL encoding by James An](https://gist.github.com/919275) - [Jade plugin by John Papandriopoulos](https://github.com/snappylabs/jade-jekyll-plugin): Jade converter for Jekyll.
- [Sitemap.xml Generator by Michael - [HAML plugin by Sam Z](https://gist.github.com/517556): HAML converter for Jekyll.
Levin](https://github.com/kinnetica/jekyll-plugins) - [HAML-Sass Converter by Adam Pearson](https://gist.github.com/481456): Simple HAML-Sass converter for Jekyll. [Fork](https://gist.github.com/528642) by Sam X.
- [Markdown references by Olov Lassus](https://github.com/olov/jekyll-references): Keep all your markdown reference-style link definitions in one file (_references.md) - [Sass SCSS Converter by Mark Wolfe](https://gist.github.com/960150): Sass converter which uses the new CSS compatible syntax, based Sam X's fork above.
- [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Add full-text search to your Jekyll site with this plugin and a bit of JavaScript. - [LESS Converter by Jason Graham](https://gist.github.com/639920): Convert LESS files to CSS.
- [Stylus Converter](https://gist.github.com/988201) Convert .styl to .css. - [LESS Converter by Josh Brown](https://gist.github.com/760265): Simple LESS converter.
- [Embed.ly client by Robert Böhnke](https://github.com/robb/jekyll-embedly-client) Autogenerate embeds from URLs using oEmbed. - [Upcase Converter by Blake Smith](https://gist.github.com/449463): An example Jekyll converter.
- [Logarithmic Tag Cloud](https://gist.github.com/2290195): Flexible. Logarithmic distribution. Documentation inline. - [CoffeeScript Converter by phaer](https://gist.github.com/959938): A [CoffeeScript](http://coffeescript.org) to Javascript converter.
- [Related Posts by Lawrence Woodman](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin): Overrides `site.related_posts` to use categories to assess relationship - [Markdown References by Olov Lassus](https://github.com/olov/jekyll-references): Keep all your markdown reference-style link definitions in one \_references.md file.
- [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias configuration is specified in the YAML Front Matter. - [Stylus Converter](https://gist.github.com/988201): Convert .styl to .css.
- [FlickrSetTag by Thomas Mango](https://github.com/tsmango/jekyll_flickr_set_tag): Generates image galleries from Flickr sets. - [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting.
- [Projectlist by Frederic Hemberger](https://github.com/fhemberger/jekyll-projectlist): Loads all files from a directory and renders the entries into a single page, instead of creating separate posts. - [Jekyll-pandoc-plugin](https://github.com/dsanson/jekyll-pandoc-plugin): Use pandoc for rendering markdown.
- [Tiered Archives by Eli Naeher](https://gist.github.com/88cda643aa7e3b0ca1e5): creates a tiered template variable that allows you to create archives grouped by year and month. - [Jekyll-pandoc-multiple-formats](https://github.com/fauno/jekyll-pandoc-multiple-formats) by [edsl](https://github.com/edsl): Use pandoc to generate your site in multiple formats. Supports pandoc's markdown extensions.
- [oEmbed Tag by Tammo van Lessen](https://gist.github.com/1455726): enables easy content embedding (e.g. from YouTube, Flickr, Slideshare) via oEmbed. - [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting.
- [Company website and blog plugins](https://github.com/flatterline/jekyll-plugins) by Flatterline, a [Ruby on Rails development company](http://flatterline.com/): portfolio/project page generator, team/individual page generator, author bio liquid template tag for use on posts and a few other smaller plugins. - [Transform Layouts](https://gist.github.com/1472645): Allows HAML layouts (you need a HAML Converter plugin for this to work).
- [Transform Layouts](https://gist.github.com/1472645) Monkey patching allowing HAML layouts (you need a HAML Converter plugin for this to work)
- [ReStructuredText converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting. #### Filters
- [Tweet Tag by Scott W. Bradley](https://github.com/scottwb/jekyll-tweet-tag): Liquid tag for [Embedded Tweets](https://dev.twitter.com/docs/embedded-tweets) using Twitters shortcodes
- [jekyll-localization](https://github.com/blackwinter/jekyll-localization): Jekyll plugin that adds localization features to the rendering engine. - [Truncate HTML](https://github.com/MattHall/truncatehtml) by [Matt Hall](http://codebeef.com): A Jekyll filter that truncates HTML while preserving markup structure.
- [jekyll-rendering](https://github.com/blackwinter/jekyll-rendering): Jekyll plugin to provide alternative rendering engines. - [Domain Name Filter by Lawrence Woodman](https://github.com/LawrenceWoodman/domain_name-liquid_filter): Filters the input text so that just the domain name is left.
- [jekyll-pagination](https://github.com/blackwinter/jekyll-pagination): Jekyll plugin to extend the pagination generator. - [Summarize Filter by Mathieu Arnold](https://gist.github.com/731597): Remove markup after a `<div id="extended">` tag.
- [jekyll-tagging](https://github.com/pattex/jekyll-tagging): Jekyll plugin to automatically generate a tag cloud and tag pages. - [URL encoding by James An](https://gist.github.com/919275): Percent encoding for URIs.
- [jekyll-contentblocks](https://github.com/rustygeldmacher/jekyll-contentblocks): Lets you use Rails-like content_for tags in your templates, for passing content from your posts up to your layouts. - [JSON Filter](https://gist.github.com/1850654) by [joelverhagen](https://github.com/joelverhagen): Filter that takes input text and outputs it as JSON. Great for rendering JavaScript.
- [Generate YouTube Embed (tag)](https://gist.github.com/1805814) by [joelverhagen](https://github.com/joelverhagen): Jekyll plugin which allows you to embed a YouTube video in your page with the YouTube ID. Optionally specify width and height dimensions. Like “oEmbed Tag” but just for YouTube.
- [JSON Filter](https://gist.github.com/1850654) by [joelverhagen](https://github.com/joelverhagen): filter that takes input text and outputs it as JSON. Great for rendering JavaScript.
- [jekyll-beastiepress](https://github.com/okeeblow/jekyll-beastiepress): FreeBSD utility tags for Jekyll sites.
- [jsonball](https://gist.github.com/1895282): reads json files and produces maps for use in jekylled files
- [bibjekyll](https://github.com/pablooliveira/bibjekyll): render BibTeX-formatted bibliographies/citations included in posts/pages using bibtex2html
- [jekyll-citation](https://github.com/archome/jekyll-citation): render BibTeX-formatted bibliographies/citations included in posts/pages (pure Ruby)
- [jekyll-scholar](https://github.com/inukshuk/jekyll-scholar): Jekyll extensions for the blogging scholar
- [jekyll-asset_bundler](https://github.com/moshen/jekyll-asset_bundler): bundles and minifies JavaScript and CSS
- [Jekyll Dribbble Set Tag](https://github.com/ericdfields/Jekyll-Dribbble-Set-Tag): builds Dribbble image galleries from any user
- [debbugs](https://gist.github.com/2218470): allows posting links to Debian BTS easily
- [refheap_tag](https://github.com/aburdette/refheap_tag): Liquid tag that allows embedding pastes from [refheap](https://refheap.com)
- [i18n_filter](https://github.com/gacha/gacha.id.lv/blob/master/_plugins/i18n_filter.rb): Liquid filter to use I18n localization. - [i18n_filter](https://github.com/gacha/gacha.id.lv/blob/master/_plugins/i18n_filter.rb): Liquid filter to use I18n localization.
- [singlepage-jekyll](https://github.com/JCB-K/singlepage-jekyll) by [JCB-K](https://github.com/JCB-K): turns Jekyll into a dynamic one-page website. - [Smilify](https://github.com/SaswatPadhi/jekyll_smilify) by [SaswatPadhi](https://github.com/SaswatPadhi): Convert text emoticons in your content to themeable smiley pics ([Demo](http://saswatpadhi.github.com/)).
- [flickr](https://github.com/reagent/fleakr): Embed photos from flickr right into your posts. - [Read in X Minutes](https://gist.github.com/zachleat/5792681) by [zachleat](https://github.com/zachleat): Estimates the reading time of a string (for blog post content).
- [jekyll-devonly_tag](https://gist.github.com/2403522): A block tag for including markup only during development. - [Jekyll-timeago](https://github.com/markets/jekyll-timeago): Converts a time value to the time ago in words.
- [Jekyll plugins by Aucor](https://github.com/aucor/jekyll-plugins): Plugins for eg. trimming unwanted newlines/whitespace and sorting pages by weight attribute.
- [jekyll-pandoc-plugin](https://github.com/dsanson/jekyll-pandoc-plugin): use pandoc for rendering markdown. #### Tags
- [File compressor](https://gist.github.com/2758691) by [mytharcher](https://github.com/mytharcher): Compress HTML (\*.html) and JavaScript(\*.js) files when output.
- [smilify](https://github.com/SaswatPadhi/jekyll_smilify) by [SaswatPadhi](https://github.com/SaswatPadhi): Convert text emoticons in your content to themeable smiley pics. [Demo](http://saswatpadhi.github.com/) - [Delicious Plugin by Christian Hellsten](https://github.com/christianhellsten/jekyll-plugins): Fetches and renders bookmarks from delicious.com.
- [jekyll-minibundle](https://github.com/tkareine/jekyll-minibundle): Asset bundling and cache busting using external minification tool of your choice, no gem dependencies. - [Ultraviolet Plugin by Steve Alex](https://gist.github.com/480380): Jekyll tag for the [Ultraviolet](http://ultraviolet.rubyforge.org/) code highligher.
- [JekyllGalleryTag](https://github.com/redwallhp/JekyllGalleryTag) by [redwallhp](https://github.com/redwallhp): Generates thumbnails from a directory of images and displays them in a grid with a Liquid tag. - [Tag Cloud Plugin by Ilkka Laukkanen](https://gist.github.com/710577): Generate a tag cloud that links to tag pages.
- [Read in X Minutes](https://gist.github.com/zachleat/5792681) by [zachleat](https://github.com/zachleat): Estimates the reading time of a string (use for blog post content). - [GIT Tag by Alexandre Girard](https://gist.github.com/730347): Add Git activity inside a list.
- [jekyll-assets](http://ixti.net/jekyll-assets/) by [ixti](https://github.com/ixti): Rails-alike assets pipeline (write assets in CoffeeScript, SASS, LESS etc; specify dependencies for automatic bundling using simple declarative comments in assets; minify and compress; use JST templates; cache bust; and many-many more). - [MathJax Liquid Tags by Jessy Cowan-Sharp](https://gist.github.com/834610): Simple liquid tags for Jekyll that convert inline math and block equations to the appropriate MathJax script tags.
- [jekyll-pandoc-multiple-formats](https://github.com/fauno/jekyll-pandoc-multiple-formats) - [Non-JS Gist Tag by Brandon Tilley](https://gist.github.com/1027674) A Liquid tag that embeds Gists and shows code for non-JavaScript enabled browsers and readers.
by [edsl](https://github.com/edsl): Use pandoc to generate your site in - [Render Time Tag by Blake Smith](https://gist.github.com/449509): Displays the time a Jekyll page was generated.
multiple formats plus support for pandoc's markdown extensions. - [Status.net/OStatus Tag by phaer](https://gist.github.com/912466): Displays the notices in a given status.net/ostatus feed.
- [Youku and Tudou Embed](https://gist.github.com/Yexiaoxing/5891929): Liquid plugin for - [Raw Tag by phaer](https://gist.github.com/1020852): Keeps liquid from parsing text betweeen `raw` tags.
embedding Youku and Tudou videos - [Embed.ly client by Robert Böhnke](https://github.com/robb/jekyll-embedly-client): Autogenerate embeds from URLs using oEmbed.
- [jekyll-timeago](https://github.com/markets/jekyll-timeago): Time-ago Liquid filter - [Logarithmic Tag Cloud](https://gist.github.com/2290195): Flexible. Logarithmic distribution. Documentation inline.
- [jekyll-swfobject](https://github.com/sectore/jekyll-swfobject): Liquid plugin for embedding Adobe Flash files (`*.swf`) using [SWFObject](http://code.google.com/p/swfobject/) - [oEmbed Tag by Tammo van Lessen](https://gist.github.com/1455726): Enables easy content embedding (e.g. from YouTube, Flickr, Slideshare) via oEmbed.
- [FlickrSetTag by Thomas Mango](https://github.com/tsmango/jekyll_flickr_set_tag): Generates image galleries from Flickr sets.
- [Tweet Tag by Scott W. Bradley](https://github.com/scottwb/jekyll-tweet-tag): Liquid tag for [Embedded Tweets](https://dev.twitter.com/docs/embedded-tweets) using Twitters shortcodes.
- [Jekyll-contentblocks](https://github.com/rustygeldmacher/jekyll-contentblocks): Lets you use Rails-like content_for tags in your templates, for passing content from your posts up to your layouts.
- [Generate YouTube Embed](https://gist.github.com/1805814) by [joelverhagen](https://github.com/joelverhagen): Jekyll plugin which allows you to embed a YouTube video in your page with the YouTube ID. Optionally specify width and height dimensions. Like “oEmbed Tag” but just for YouTube.
- [Jekyll-beastiepress](https://github.com/okeeblow/jekyll-beastiepress): FreeBSD utility tags for Jekyll sites.
- [Jsonball](https://gist.github.com/1895282): Reads json files and produces maps for use in Jekyll files.
- [Bibjekyll](https://github.com/pablooliveira/bibjekyll): Render BibTeX-formatted bibliographies/citations included in posts and pages using bibtex2html.
- [Jekyll-citation](https://github.com/archome/jekyll-citation): Render BibTeX-formatted bibliographies/citations included in posts and pages (pure Ruby).
- [Jekyll Dribbble Set Tag](https://github.com/ericdfields/Jekyll-Dribbble-Set-Tag): Builds Dribbble image galleries from any user.
- [Debbugs](https://gist.github.com/2218470): Allows posting links to Debian BTS easily.
- [Refheap_tag](https://github.com/aburdette/refheap_tag): Liquid tag that allows embedding pastes from [refheap](https://refheap.com).
- [Jekyll-devonly_tag](https://gist.github.com/2403522): A block tag for including markup only during development.
- [JekyllGalleryTag](https://github.com/redwallhp/JekyllGalleryTag) by [redwallhp](https://github.com/redwallhp): Generates thumbnails from a directory of images and displays them in a grid.
- [Youku and Tudou Embed](https://gist.github.com/Yexiaoxing/5891929): Liquid plugin for embedding Youku and Tudou videos.
- [Jekyll-swfobject](https://github.com/sectore/jekyll-swfobject): Liquid plugin for embedding Adobe Flash files (.swf) using [SWFObject](http://code.google.com/p/swfobject/).
- [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [`<picture>`](http://picture.responsiveimages.org/) element, polyfilled with Scott Jelh's [Picturefill](https://github.com/scottjehl/picturefill). - [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [`<picture>`](http://picture.responsiveimages.org/) element, polyfilled with Scott Jelh's [Picturefill](https://github.com/scottjehl/picturefill).
- [Jekyll Image Tag](https://github.com/robwierzbowski/jekyll-image-tag): Better images for Jekyll. Save image presets, generate resized images, and add classes, alt text, and other attributes.
#### Collections
- [Jekyll Plugins by Recursive Design](http://recursive-design.com/projects/jekyll-plugins/): Plugins to generate Project pages from GitHub readmes, a Category page, and a Sitemap generator.
- [Company website and blog plugins](https://github.com/flatterline/jekyll-plugins) by Flatterline, a [Ruby on Rails development company](http://flatterline.com/): Portfolio/project page generator, team/individual page generator, an author bio liquid tag for use on posts, and a few other smaller plugins.
- [Jekyll plugins by Aucor](https://github.com/aucor/jekyll-plugins): Plugins for trimming unwanted newlines/whitespace and sorting pages by weight attribute.
#### Other
- [Pygments Cache Path by Raimonds Simanovskis](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb): Plugin to cache syntax-highlighted code from Pygments.
- [Draft/Publish Plugin by Michael Ivey](https://gist.github.com/49630): Save posts as drafts.
- [Growl Notification Generator by Tate Johnson](https://gist.github.com/490101): Send Jekyll notifications to Growl.
- [Growl Notification Hook by Tate Johnson](https://gist.github.com/525267): Better alternative to the above, but requires his “hook” fork.
- [Related Posts by Lawrence Woodman](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin): Overrides `site.related_posts` to use categories to assess relationship.
- [Tiered Archives by Eli Naeher](https://gist.github.com/88cda643aa7e3b0ca1e5): Create tiered template variable that allows you to group archives by year and month.
- [Jekyll-localization](https://github.com/blackwinter/jekyll-localization): Jekyll plugin that adds localization features to the rendering engine.
- [Jekyll-rendering](https://github.com/blackwinter/jekyll-rendering): Jekyll plugin to provide alternative rendering engines.
- [Jekyll-pagination](https://github.com/blackwinter/jekyll-pagination): Jekyll plugin to extend the pagination generator.
- [Jekyll-tagging](https://github.com/pattex/jekyll-tagging): Jekyll plugin to automatically generate a tag cloud and tag pages.
- [Jekyll-scholar](https://github.com/inukshuk/jekyll-scholar): Jekyll extensions for the blogging scholar.
- [Jekyll-asset_bundler](https://github.com/moshen/jekyll-asset_bundler): Bundles and minifies JavaScript and CSS.
- [Jekyll-assets](http://ixti.net/jekyll-assets/) by [ixti](https://github.com/ixti): Rails-alike assets pipeline (write assets in CoffeeScript, Sass, LESS etc; specify dependencies for automatic bundling using simple declarative comments in assets; minify and compress; use JST templates; cache bust; and many-many more).
- [File compressor](https://gist.github.com/2758691) by [mytharcher](https://github.com/mytharcher): Compress HTML and JavaScript files on site build.
- [Jekyll-minibundle](https://github.com/tkareine/jekyll-minibundle): Asset bundling and cache busting using external minification tool of your choice. No gem dependencies.
- [Singlepage-jekyll](https://github.com/JCB-K/singlepage-jekyll) by [JCB-K](https://github.com/JCB-K): Turns Jekyll into a dynamic one-page website.
- [generator-jekyllrb](https://github.com/robwierzbowski/generator-jekyllrb): A generator that wraps Jekyll in [Yeoman](http://yeoman.io/), a tool collection and workflow for builing modern web apps.
- [grunt-jekyll](https://github.com/dannygarcia/grunt-jekyll): A straightforward [Grunt](http://gruntjs.com/) plugin for Jekyll.
<div class="note info"> <div class="note info">
<h5>Jekyll Plugins Wanted</h5> <h5>Jekyll Plugins Wanted</h5>

View File

@ -25,3 +25,8 @@ advantage of all the awesome configuration options Jekyll makes available.
<p>In Jekyll 1.1, we switched the default markdown engine for sites <p>In Jekyll 1.1, we switched the default markdown engine for sites
generated with <code>jekyll new</code> to Redcarpet</p> generated with <code>jekyll new</code> to Redcarpet</p>
</div> </div>
If you're running into problems, ensure you have all the [requirements
installed][Installation].
[Installation]: /docs/installation/

View File

@ -60,6 +60,18 @@ An overview of what each of these does:
</p> </p>
</td> </td>
</tr> </tr>
<tr>
<td>
<p><code>_drafts</code></p>
</td>
<td>
<p>
Drafts are unpublished posts. The format of these files is without a date: <code>title.MARKUP</code>. Learn how to <a href="../drafts">work with drafts</a>.
</p>
</td>
</tr>
<tr> <tr>
<td> <td>
<p><code>_includes</code></p> <p><code>_includes</code></p>

View File

@ -185,17 +185,17 @@ If you have small page fragments that you wish to include in multiple places on
your site, you can use the `include` tag. your site, you can use the `include` tag.
{% highlight ruby %} {% highlight ruby %}
{% raw %}{% include sig.md %}{% endraw %} {% raw %}{% include footer.html %}{% endraw %}
{% endhighlight %} {% endhighlight %}
Jekyll expects all include files to be placed in an `_includes` directory at the Jekyll expects all include files to be placed in an `_includes` directory at the
root of your source directory. This will embed the contents of root of your source directory. This will embed the contents of
`<source>/_includes/sig.md` into the calling file. `<source>/_includes/footer.html` into the calling file.
You can also pass parameters to an include: You can also pass parameters to an include:
{% highlight ruby %} {% highlight ruby %}
{% raw %}{% include sig.textile param="value" %}{% endraw %} {% raw %}{% include footer.html param="value" %}{% endraw %}
{% endhighlight %} {% endhighlight %}
These parameters are available via Liquid in the include: These parameters are available via Liquid in the include:

View File

@ -88,7 +88,7 @@ following is a reference of the available data.
<td><p><code>site.pages</code></p></td> <td><p><code>site.pages</code></p></td>
<td><p> <td><p>
An alphabetical list of all Pages. A list of all Pages.
</p></td> </p></td>
</tr> </tr>
@ -169,7 +169,7 @@ following is a reference of the available data.
<td><p><code>page.title</code></p></td> <td><p><code>page.title</code></p></td>
<td><p> <td><p>
The title of the Post. The title of the Page.
</p></td> </p></td>
</tr> </tr>
@ -197,7 +197,9 @@ following is a reference of the available data.
The Date assigned to the Post. This can be overridden in a Posts front The Date assigned to the Post. This can be overridden in a Posts front
matter by specifying a new date/time in the format matter by specifying a new date/time in the format
<code>YYYY-MM-DD HH:MM:SS</code> <code>YYYY-MM-DD HH:MM:SS</code> (assuming UTC), or
<code>YYYY-MM-DD HH:MM:SS +/-TTTT</code> (to specify a time zone using
an offset from UTC. e.g. <code>2008-12-14 10:30:00 +0900</code>).
</p></td> </p></td>
</tr> </tr>

View File

@ -0,0 +1,23 @@
---
layout: post
title: Post Excerpt with Layout
categories:
- bar
- baz
- z_category
tags:
- first
- second
- third
- jekyllrb.com
---
First paragraph with [link ref][link].
Second paragraph
---
Third paragraph
[link]: http://www.jekyllrb.com/

View File

@ -82,6 +82,7 @@ class TestConfiguration < Test::Unit::TestCase
context "loading configuration" do context "loading configuration" do
setup do setup do
@path = File.join(Dir.pwd, '_config.yml') @path = File.join(Dir.pwd, '_config.yml')
@user_config = File.join(Dir.pwd, "my_config_file.yml")
end end
should "fire warning with no _config.yml" do should "fire warning with no _config.yml" do
@ -102,6 +103,14 @@ class TestConfiguration < Test::Unit::TestCase
mock($stderr).puts("Configuration file: (INVALID) #{@path}".yellow) mock($stderr).puts("Configuration file: (INVALID) #{@path}".yellow)
assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({}) assert_equal Jekyll::Configuration::DEFAULTS, Jekyll.configuration({})
end end
should "fire warning when user-specified config file isn't there" do
mock(YAML).safe_load_file(@user_config) { raise SystemCallError, "No such file or directory - #{@user_config}" }
mock($stderr).puts(("Fatal: ".rjust(20) + "The configuration file '#{@user_config}' could not be found.").red)
assert_raises LoadError do
Jekyll.configuration({'config' => [@user_config]})
end
end
end end
context "loading config from external file" do context "loading config from external file" do
setup do setup do

62
test/test_excerpt.rb Normal file
View File

@ -0,0 +1,62 @@
require 'helper'
class TestExcerpt < Test::Unit::TestCase
def setup_post(file)
Post.new(@site, source_dir, '', file)
end
def do_render(post)
layouts = { "default" => Layout.new(@site, source_dir('_layouts'), "simple.html")}
post.render(layouts, {"site" => {"posts" => []}})
end
context "An extracted excerpt" do
setup do
clear_dest
stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
@site = Site.new(Jekyll.configuration)
@post = setup_post("2013-07-22-post-excerpt-with-layout.markdown")
@excerpt = @post.send :extract_excerpt
end
context "#to_liquid" do
should "contain the proper page data to mimick the post liquid" do
assert_equal "Post Excerpt with Layout", @excerpt.to_liquid["title"]
assert_equal "/bar/baz/z_category/2013/07/22/post-excerpt-with-layout.html", @excerpt.to_liquid["url"]
assert_equal Time.parse("2013-07-22"), @excerpt.to_liquid["date"]
assert_equal %w[bar baz z_category], @excerpt.to_liquid["categories"]
assert_equal %w[first second third jekyllrb.com], @excerpt.to_liquid["tags"]
assert_equal "_posts/2013-07-22-post-excerpt-with-layout.markdown", @excerpt.to_liquid["path"]
end
end
context "#content" do
context "before render" do
should "be the first paragraph of the page" do
assert_equal "First paragraph with [link ref][link].\n\n[link]: http://www.jekyllrb.com/", @excerpt.content
end
should "contain any refs at the bottom of the page" do
assert @excerpt.content.include?("[link]: http://www.jekyllrb.com/")
end
end
context "after render" do
setup do
@rendered_post = @post.dup
do_render(@rendered_post)
@extracted_excerpt = @rendered_post.send :extracted_excerpt
end
should "be the first paragraph of the page" do
assert_equal "<p>First paragraph with <a href='http://www.jekyllrb.com/'>link ref</a>.</p>", @extracted_excerpt.content
end
should "link properly" do
assert @extracted_excerpt.content.include?("http://www.jekyllrb.com/")
end
end
end
end
end

View File

@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
end end
should "ensure post count is as expected" do should "ensure post count is as expected" do
assert_equal 34, @site.posts.size assert_equal 35, @site.posts.size
end end
should "insert site.posts into the index" do should "insert site.posts into the index" do

View File

@ -267,9 +267,10 @@ class TestPost < Test::Unit::TestCase
context "#excerpt" do context "#excerpt" do
setup do setup do
file = "2013-01-02-post-excerpt.markdown" file = "2013-01-02-post-excerpt.markdown"
@post = setup_post(file)
@post.process(file) @post.process(file)
@post.read_yaml(@source, file) @post.read_yaml(@source, file)
@post.transform do_render(@post)
end end
should "return first paragraph by default" do should "return first paragraph by default" do