mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
88 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08a4c02d38 | ||
|
|
1cbff6b771 | ||
|
|
9df9edc4c7 | ||
|
|
685cdbe124 | ||
|
|
57a9deb98d | ||
|
|
ece22497dd | ||
|
|
fb170007c8 | ||
|
|
36c5017300 | ||
|
|
e8e245e20f | ||
|
|
2141ea6564 | ||
|
|
d3959d5899 | ||
|
|
cbb4b10ce6 | ||
|
|
861c81b590 | ||
|
|
28131624b8 | ||
|
|
ce1f01c494 | ||
|
|
a13a4ca532 | ||
|
|
f830120044 | ||
|
|
7645a72b2f | ||
|
|
ff8a8b8302 | ||
|
|
a7cc026e2c | ||
|
|
c78bf2775f | ||
|
|
0082bb22fb | ||
|
|
febf80cccd | ||
|
|
4d8dab6e33 | ||
|
|
f385fd9efd | ||
|
|
a66d96ce0a | ||
|
|
05f1fac2a7 | ||
|
|
03ae38a41e | ||
|
|
fbb8c056d4 | ||
|
|
0e68d34e1b | ||
|
|
a62027d5f3 | ||
|
|
db38498d06 | ||
|
|
af11f66646 | ||
|
|
2a422e1d83 | ||
|
|
f463aea399 | ||
|
|
f93da3cfb1 | ||
|
|
253b10818c | ||
|
|
2c0e086761 | ||
|
|
8882f4dd14 | ||
|
|
2cf76cb701 | ||
|
|
bb9517b73f | ||
|
|
f681b35b65 | ||
|
|
8c5d36f0ee | ||
|
|
08d0ff0922 | ||
|
|
e5683b1da5 | ||
|
|
3dffa8284f | ||
|
|
e332197660 | ||
|
|
8b36b71833 | ||
|
|
7eb5e07e9d | ||
|
|
0b9eb3c111 | ||
|
|
5f7a3f2b69 | ||
|
|
02676572dd | ||
|
|
404661fc72 | ||
|
|
5c3f013325 | ||
|
|
ea4aa4f149 | ||
|
|
0c8fc63b33 | ||
|
|
c239746363 | ||
|
|
12b47cc037 | ||
|
|
2c636086bd | ||
|
|
6a7386e6ba | ||
|
|
21ab9f8b9e | ||
|
|
eab113e4f5 | ||
|
|
bd4a8c1ce2 | ||
|
|
e2de7ab0c7 | ||
|
|
a6e80b2bc1 | ||
|
|
3f5a55e240 | ||
|
|
b79be6d320 | ||
|
|
60bb78e25b | ||
|
|
281fb549f8 | ||
|
|
d16f62cb38 | ||
|
|
912bd84629 | ||
|
|
d77078518d | ||
|
|
e310af00b4 | ||
|
|
cedbdf43ca | ||
|
|
911559fe05 | ||
|
|
c958eae551 | ||
|
|
053ba9a9ca | ||
|
|
c5aa74f823 | ||
|
|
20180923cf | ||
|
|
6e104c3ed0 | ||
|
|
880a503094 | ||
|
|
edbc273829 | ||
|
|
5f807e7421 | ||
|
|
b202b508f2 | ||
|
|
a7d20df95a | ||
|
|
674b540c6f | ||
|
|
8b860d3f0e | ||
|
|
a79279b1cc |
@@ -2,6 +2,31 @@
|
||||
|
||||
### Major Enhancements
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
### Development Fixes
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
## 2.1.1 / 2014-07-01
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Patch read vulnerabilities for data & confirm none for layouts (#2563)
|
||||
* Update Maruku dependency to allow use of the latest version (#2576)
|
||||
* Remove conditional assignment from document URL to prevent stale urls (#2575)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Add vertical margin to `highlight` to separate code blocks (#2558)
|
||||
* Add `html_pages` to Variables docs (#2567)
|
||||
* Fixed broken link to Permalinks page (#2572)
|
||||
* Update link to Windows installation guide (#2578)
|
||||
|
||||
## 2.1.0 / 2014-06-28
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Bump to the latest Liquid version, 2.6.1 (#2495)
|
||||
@@ -27,6 +52,8 @@
|
||||
* Make `highlight` tag use `language-` prefix in CSS class (#2511)
|
||||
* Lookup item property via `item#to_liquid` before `#data` or `#[]` in filters (#2493)
|
||||
* Skip initial build of site on serve with flag (#2477)
|
||||
* Add support for `hl_lines` in `highlight` tag (#2532)
|
||||
* Spike out `--watch` flag into a separate gem (#2550)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -46,6 +73,11 @@
|
||||
* Ignore *all* directories and files that merit it on auto-generation (#2459)
|
||||
* Before copying file, explicitly remove the old one (#2535)
|
||||
* Merge file system categories with categories from YAML. (#2531)
|
||||
* Deep merge front matter defaults (#2490)
|
||||
* Ensure exclude and include arrays are arrays of strings (#2542)
|
||||
* Allow collections to have dots in their filenames (#2552)
|
||||
* Collections shouldn't try to read in directories as files (#2552)
|
||||
* Be quiet very quickly. (#2520)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
@@ -53,6 +85,7 @@
|
||||
* Add test for sorting UTF-8 characters (#2384)
|
||||
* Use `https` for GitHub links in documentation (#2470)
|
||||
* Remove coverage reporting with Coveralls (#2494)
|
||||
* Fix a bit of missing TomDoc to `Jekyll::Commands::Build#build` (#2554)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
@@ -74,6 +107,9 @@
|
||||
* Add link to jekyll-compress-html to list of third-party plugins (#2514)
|
||||
* Add Piwigo Gallery to list of third-party plugins (#2526)
|
||||
* Set `show_drafts` to `false` in default configuration listing (#2536)
|
||||
* Provide an updated link for Windows installation instructions (#2544)
|
||||
* Remove `url` from configuration docs (#2547)
|
||||
* Documentation for Continuous Integration for your Jekyll Site (#2432)
|
||||
|
||||
## 2.0.3 / 2014-05-08
|
||||
|
||||
|
||||
4
Rakefile
4
Rakefile
@@ -14,7 +14,7 @@ require 'jekyll/version'
|
||||
#############################################################################
|
||||
|
||||
def name
|
||||
@name ||= Dir['*.gemspec'].first.split('.').first
|
||||
@name ||= File.basename(Dir['*.gemspec'].first, ".*")
|
||||
end
|
||||
|
||||
def version
|
||||
@@ -228,6 +228,7 @@ end
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
desc "Release #{name} v#{version}"
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
puts "You must be on the master branch to release!"
|
||||
@@ -240,6 +241,7 @@ task :release => :build do
|
||||
sh "gem push pkg/#{name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc "Build #{name} v#{version} into pkg/"
|
||||
task :build do
|
||||
mkdir_p "pkg"
|
||||
sh "gem build #{gemspec_file}"
|
||||
|
||||
@@ -128,3 +128,9 @@ Feature: frontmatter defaults
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "Value: Override" in "_site/slides/slide2.html"
|
||||
|
||||
Scenario: Deep merge frontmatter defaults
|
||||
Given I have an "index.html" page with fruit "{orange: 1}" that contains "Fruits: {{ page.fruit.orange | plus: page.fruit.apple }}"
|
||||
And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {fruit: {apple: 2}}}]"
|
||||
When I run jekyll build
|
||||
Then I should see "Fruits: 3" in "_site/index.html"
|
||||
|
||||
@@ -45,7 +45,7 @@ Feature: Markdown
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "My awesome code" in "_site/index.html"
|
||||
And I should see "<pre><code>\nMy awesome code\n</code></pre>" in "_site/index.html"
|
||||
And I should see "<pre><code>My awesome code</code></pre>" in "_site/index.html"
|
||||
|
||||
Scenario: Maruku fenced codeblocks
|
||||
Given I have a configuration file with "markdown" set to "maruku"
|
||||
@@ -64,4 +64,4 @@ Feature: Markdown
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "My awesome string" in "_site/index.html"
|
||||
And I should see "<pre class="ruby"><code class="ruby">\nputs "My awesome string"\n</code></pre>" in "_site/index.html"
|
||||
And I should see "<pre class="ruby"><code class="ruby">puts "My awesome string"</code></pre>" in "_site/index.html"
|
||||
|
||||
@@ -273,3 +273,11 @@ Feature: Site configuration
|
||||
And I should see "Whatever" in "_site/index.html"
|
||||
And the "_site/test.txt" file should exist
|
||||
And I should see "this is a test" in "_site/test.txt"
|
||||
|
||||
Scenario: arbitrary file reads via layouts
|
||||
Given I have an "index.html" page with layout "page" that contains "FOO"
|
||||
And I have a "_config.yml" file that contains "layouts: '../../../../../../../../../../../../../../usr/include'"
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "FOO" in "_site/index.html"
|
||||
And I should not see " " in "_site/index.html"
|
||||
|
||||
@@ -30,7 +30,6 @@ Gem::Specification.new do |s|
|
||||
|
||||
s.add_runtime_dependency('liquid', "~> 2.6.1")
|
||||
s.add_runtime_dependency('classifier', "~> 1.3")
|
||||
s.add_runtime_dependency('listen', [">= 2.7.6", "< 3.0.0"])
|
||||
s.add_runtime_dependency('kramdown', "~> 1.3")
|
||||
s.add_runtime_dependency('pygments.rb', "~> 0.6.0")
|
||||
s.add_runtime_dependency('mercenary', "~> 0.3.3")
|
||||
@@ -42,6 +41,7 @@ Gem::Specification.new do |s|
|
||||
s.add_runtime_dependency('jekyll-gist', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-coffeescript', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-watch', '~> 1.0')
|
||||
|
||||
s.add_development_dependency('rake', "~> 10.1")
|
||||
s.add_development_dependency('rdoc', "~> 3.11")
|
||||
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
|
||||
s.add_development_dependency('rr', "~> 1.1")
|
||||
s.add_development_dependency('cucumber', "1.3.11")
|
||||
s.add_development_dependency('RedCloth', "~> 4.2")
|
||||
s.add_development_dependency('maruku', "0.7.0")
|
||||
s.add_development_dependency('maruku', "~> 0.7.0")
|
||||
s.add_development_dependency('rdiscount', "~> 1.6")
|
||||
s.add_development_dependency('launchy', "~> 2.3")
|
||||
s.add_development_dependency('simplecov', "~> 0.7")
|
||||
|
||||
@@ -32,7 +32,6 @@ require 'toml'
|
||||
# internal requires
|
||||
require 'jekyll/version'
|
||||
require 'jekyll/utils'
|
||||
require 'jekyll/hooks'
|
||||
require 'jekyll/log_adapter'
|
||||
require 'jekyll/stevenson'
|
||||
require 'jekyll/deprecator'
|
||||
|
||||
@@ -52,7 +52,7 @@ module Jekyll
|
||||
def filtered_entries
|
||||
return Array.new unless exists?
|
||||
Dir.chdir(directory) do
|
||||
entry_filter.filter(entries)
|
||||
entry_filter.filter(entries).reject { |f| File.directory?(f) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -105,7 +105,7 @@ module Jekyll
|
||||
#
|
||||
# Returns a sanitized version of the label.
|
||||
def sanitize_label(label)
|
||||
label.gsub(/[^a-z0-9_\-]/i, '')
|
||||
label.gsub(/[^a-z0-9_\-\.]/i, '')
|
||||
end
|
||||
|
||||
# Produce a representation of this Collection for use in Liquid.
|
||||
|
||||
@@ -38,7 +38,7 @@ module Jekyll
|
||||
# Build your Jekyll site.
|
||||
#
|
||||
# site - the Jekyll::Site instance to build
|
||||
# options - the
|
||||
# options - A Hash of options passed to the command
|
||||
#
|
||||
# Returns nothing.
|
||||
def build(site, options)
|
||||
@@ -58,38 +58,8 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def watch(site, options)
|
||||
require 'listen'
|
||||
|
||||
listener = Listen.to(
|
||||
options['source'],
|
||||
:ignore => ignore_paths(options),
|
||||
:force_polling => options['force_polling']
|
||||
) do |modified, added, removed|
|
||||
t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
n = modified.length + added.length + removed.length
|
||||
print Jekyll.logger.formatted_topic("Regenerating:") + "#{n} files at #{t} "
|
||||
begin
|
||||
process_site(site)
|
||||
puts "...done."
|
||||
rescue => e
|
||||
puts "...error:"
|
||||
Jekyll.logger.warn "Error:", e.message
|
||||
Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
|
||||
end
|
||||
end
|
||||
listener.start
|
||||
|
||||
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{source}'"
|
||||
|
||||
unless options['serving']
|
||||
trap("INT") do
|
||||
listener.stop
|
||||
puts " Halting auto-regeneration."
|
||||
exit 0
|
||||
end
|
||||
|
||||
loop { sleep 1000 }
|
||||
end
|
||||
require 'jekyll-watch'
|
||||
Jekyll::Commands::Watch.watch(site, options)
|
||||
end
|
||||
|
||||
end # end of class << self
|
||||
|
||||
@@ -40,6 +40,7 @@ module Jekyll
|
||||
'markdown_ext' => 'markdown,mkdown,mkdn,mkd,md',
|
||||
'textile_ext' => 'textile',
|
||||
|
||||
'quiet' => false,
|
||||
'port' => '4000',
|
||||
'host' => '0.0.0.0',
|
||||
|
||||
@@ -103,6 +104,10 @@ module Jekyll
|
||||
override['source'] || self['source'] || DEFAULTS['source']
|
||||
end
|
||||
|
||||
def quiet?(override = {})
|
||||
override['quiet'] || self['quiet'] || DEFAULTS['quiet']
|
||||
end
|
||||
|
||||
def safe_load_file(filename)
|
||||
case File.extname(filename)
|
||||
when '.toml'
|
||||
@@ -120,6 +125,9 @@ module Jekyll
|
||||
#
|
||||
# Returns an Array of config files
|
||||
def config_files(override)
|
||||
# Be quiet quickly.
|
||||
Jekyll.logger.log_level = :error if quiet?(override)
|
||||
|
||||
# Get configuration from <source>/_config.yml or <source>/<config_file>
|
||||
config_files = override.delete('config')
|
||||
if config_files.to_s.empty?
|
||||
@@ -234,6 +242,7 @@ module Jekyll
|
||||
" as a list of comma-separated values."
|
||||
config[option] = csv_to_array(config[option])
|
||||
end
|
||||
config[option].map!(&:to_s)
|
||||
end
|
||||
|
||||
if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
|
||||
|
||||
@@ -43,7 +43,7 @@ module Jekyll
|
||||
# Returns nothing.
|
||||
def read_yaml(base, name, opts = {})
|
||||
begin
|
||||
self.content = File.read(File.join(base, name),
|
||||
self.content = File.read(Jekyll.sanitized_path(base, name),
|
||||
merged_file_read_opts(opts))
|
||||
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
|
||||
@@ -127,7 +127,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the computed URL for the document.
|
||||
def url
|
||||
@url ||= URL.new({
|
||||
@url = URL.new({
|
||||
template: url_template,
|
||||
placeholders: url_placeholders,
|
||||
permalink: permalink
|
||||
|
||||
@@ -41,10 +41,10 @@ module Jekyll
|
||||
old_scope = nil
|
||||
matching_sets(path, type).each do |set|
|
||||
if has_precedence?(old_scope, set['scope'])
|
||||
defaults.merge! set['values']
|
||||
defaults = Utils.deep_merge_hashes(defaults, set['values'])
|
||||
old_scope = set['scope']
|
||||
else
|
||||
defaults = set['values'].merge(defaults)
|
||||
defaults = Utils.deep_merge_hashes(set['values'], defaults)
|
||||
end
|
||||
end
|
||||
defaults
|
||||
@@ -145,4 +145,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
module Jekyll
|
||||
module Hooks
|
||||
|
||||
class HookCollection
|
||||
include Enumerable
|
||||
|
||||
def each(&block)
|
||||
if block.nil?
|
||||
hook_methods
|
||||
else
|
||||
hook_methods.each &block
|
||||
end
|
||||
end
|
||||
|
||||
def hook_methods
|
||||
@hook_methods ||= Array.new
|
||||
end
|
||||
|
||||
def add_hook(proc)
|
||||
hook_methods << proc
|
||||
end
|
||||
|
||||
def exec(*args)
|
||||
if args.empty?
|
||||
hook_methods.each { |hook| hook.call }
|
||||
else
|
||||
hook_methods.each do |hook|
|
||||
args.each { |arg| hook.call(arg) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
%w[
|
||||
post_reset
|
||||
pre_read
|
||||
post_read
|
||||
pre_generate
|
||||
post_generate
|
||||
pre_render
|
||||
post_render
|
||||
pre_cleanup
|
||||
post_cleanup
|
||||
pre_write
|
||||
post_write
|
||||
].each do |method|
|
||||
declaration = <<-METH
|
||||
def #{method}(method_name, *args)
|
||||
cr = caller
|
||||
((@hooks ||= Hash.new).fetch(method_name.to_s, HookCollection.new)).add_hook -> { cr.send(method_name.to_sym, args) }
|
||||
end
|
||||
def #{method}_exec(*args)
|
||||
((@hooks ||= Hash.new).fetch(method_name.to_s, HookCollection.new)).exec(*args)
|
||||
end
|
||||
METH
|
||||
puts declaration
|
||||
class_eval declaration
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -78,8 +78,9 @@ module Jekyll
|
||||
|
||||
def populate_categories
|
||||
categories_from_data = Utils.pluralized_array_from_hash(data, 'category', 'categories')
|
||||
self.categories = (Array(categories) + categories_from_data).map {|c| c.to_s.downcase}
|
||||
categories.flatten!
|
||||
self.categories = (
|
||||
Array(categories) + categories_from_data
|
||||
).map {|c| c.to_s.downcase}.flatten.uniq
|
||||
end
|
||||
|
||||
def populate_tags
|
||||
|
||||
@@ -8,8 +8,6 @@ module Jekyll
|
||||
|
||||
attr_accessor :converters, :generators
|
||||
|
||||
include Jekyll::Hooks
|
||||
|
||||
# Public: Initialize a new Site.
|
||||
#
|
||||
# config - A Hash containing site configuration details.
|
||||
@@ -197,7 +195,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def read_data(dir)
|
||||
base = File.join(source, dir)
|
||||
base = Jekyll.sanitized_path(source, dir)
|
||||
read_data_to(base, self.data)
|
||||
end
|
||||
|
||||
@@ -216,7 +214,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
entries.each do |entry|
|
||||
path = File.join(dir, entry)
|
||||
path = Jekyll.sanitized_path(dir, entry)
|
||||
next if File.symlink?(path) && safe
|
||||
|
||||
key = sanitize_filename(File.basename(entry, '.*'))
|
||||
|
||||
@@ -4,9 +4,11 @@ module Jekyll
|
||||
include Liquid::StandardFilters
|
||||
|
||||
# The regular expression syntax checker. Start with the language specifier.
|
||||
# Follow that by zero or more space separated options that take one of two
|
||||
# forms: name or name=value
|
||||
SYNTAX = /^([a-zA-Z0-9.+#-]+)((\s+\w+(=\w+)?)*)$/
|
||||
# Follow that by zero or more space separated options that take one of three
|
||||
# forms: name, name=value, or name="<quoted list>"
|
||||
#
|
||||
# <quoted list> is a space-separated list of numbers
|
||||
SYNTAX = /^([a-zA-Z0-9.+#-]+)((\s+\w+(=(\w+|"([0-9]+\s)*[0-9]+"))?)*)$/
|
||||
|
||||
def initialize(tag_name, markup, tokens)
|
||||
super
|
||||
@@ -14,8 +16,14 @@ module Jekyll
|
||||
@lang = $1.downcase
|
||||
@options = {}
|
||||
if defined?($2) && $2 != ''
|
||||
$2.split.each do |opt|
|
||||
# Split along 3 possible forms -- key="<quoted list>", key=value, or key
|
||||
$2.scan(/(?:\w="[^"]*"|\w=\w|\w)+/) do |opt|
|
||||
key, value = opt.split('=')
|
||||
# If a quoted list, convert to array
|
||||
if value && value.include?("\"")
|
||||
value.gsub!(/"/, "")
|
||||
value = value.split
|
||||
end
|
||||
@options[key.to_sym] = value || true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Jekyll
|
||||
VERSION = '2.0.3'
|
||||
VERSION = '2.1.1'
|
||||
end
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
docs:
|
||||
- github-pages
|
||||
- deployment-methods
|
||||
- continuous-integration
|
||||
|
||||
- title: Miscellaneous
|
||||
docs:
|
||||
|
||||
@@ -699,6 +699,7 @@ pre, code {
|
||||
}
|
||||
|
||||
.highlight {
|
||||
margin: 1em 0;
|
||||
padding: 10px 0;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
|
||||
31
site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown
Normal file
31
site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
layout: news_item
|
||||
title: 'Jekyll Turns 21! Err... I mean 2.1.0.'
|
||||
date: 2014-06-28 17:26:59 -0400
|
||||
author: parkr
|
||||
version: 2.1.0
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Jekyll's finally [legal to drink in the States](http://en.wikipedia.org/wiki/Legal_drinking_age).
|
||||
And he's done a lot of learning in the process! Here are some of the new
|
||||
things to look forward to:
|
||||
|
||||
- Uses the latest Liquid version (2.6.1) (#2495)
|
||||
- Set front-matter defaults for collections (#2419)
|
||||
- Set a collection-specific URL template (#2418)
|
||||
- `pygments.rb` 0.6.0! (#2504)
|
||||
- `.json` files in `_data` (#2369)
|
||||
- Allow subdirectories in `_data` (#2395)
|
||||
- Add support for `hl_lines` in `highlight` tag (#2532)
|
||||
- Post categories now merge with directory, front-matter, and defaults (#2373)
|
||||
- New `--skip_initial_build` flag for `jekyll serve` (#2477)
|
||||
- A bajilion bug fixes and site updates!
|
||||
|
||||
Let's go party!
|
||||
|
||||
*Check out the [full changelog](/docs/history/) for more.*
|
||||
|
||||
Many thanks to these 37 contributors for the 2.1.0 release:
|
||||
|
||||
Alberto Grespan, Alessandro Lorenzi, Alex Medearis, Alfred Xing, Anatol Broder, Ben, Ben Balter, Bud Parr, Chezou, Denilson Figueiredo de Sá, Denilson Sá, Ivan Tse, Jens Nazarenus, Jesse Shawl, Jordon Bedwell, Josh Davis, János Rusiczki, Marc Ransome, Mathieu Bruyen, Matt Rogers, Parker Moore, Pat Hawks, Paul Henry, Peter Rhoades, Philipp Rudloff, Quinn Shanahan, Renaud Martinet, Rob Murray, Rodrigo Dumont, Simon Sarris, Terry, Terry Schmidt, Tomer Cohen, XhmikosR, Yihang Ho, jaybe@jekyll, and mikecole.
|
||||
30
site/_posts/2014-07-01-jekyll-2-1-1-released.markdown
Normal file
30
site/_posts/2014-07-01-jekyll-2-1-1-released.markdown
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
layout: news_item
|
||||
title: 'Jekyll 2.1.1 Released'
|
||||
date: 2014-07-01 20:16:43 -0400
|
||||
author: parkr
|
||||
version: 2.1.1
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
This is a minor release for Jekyll 2.1.0. It fixes a couple bugs and
|
||||
introduces fixes for a couple security-related issues.
|
||||
|
||||
It covers two security vulnerabilities:
|
||||
|
||||
1. One in the reading of data
|
||||
2. One in the `layouts` setting
|
||||
|
||||
They were identified in Jekyll 1.5.1 and has been confirmed as patched
|
||||
in this version and the version used by GitHub Pages. If you are in the
|
||||
business of building Jekyll sites, please ensure you upgrade to 2.1.1 as
|
||||
soon as possible.
|
||||
|
||||
For more, check out [`jekyll/jekyll#2563`](https://github.com/jekyll/jekyll/pull/2563).
|
||||
|
||||
Additionally, the dependency on Maruku has been loosened and a bug was
|
||||
fixed with document URLs.
|
||||
|
||||
As always, check out the [full changelog](/docs/history/) for more info!
|
||||
|
||||
Happy Jekylling!
|
||||
@@ -56,7 +56,7 @@ For example, if you have `_my_collection/some_subdir/some_doc.md`,
|
||||
it will be rendered using Liquid and the Markdown converter of your
|
||||
choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`.
|
||||
|
||||
As for posts with [Permalinks](../Permalinks/), document URL can be customized by setting a `permalink` metadata to the collection:
|
||||
As for posts with [Permalinks](../permalinks/), document URL can be customized by setting a `permalink` metadata to the collection:
|
||||
|
||||
{% highlight yaml %}
|
||||
collections:
|
||||
|
||||
@@ -434,7 +434,6 @@ server: false # deprecated
|
||||
host: 0.0.0.0
|
||||
port: 4000
|
||||
baseurl: ""
|
||||
url: http://localhost:4000
|
||||
lsi: false
|
||||
|
||||
maruku:
|
||||
|
||||
177
site/docs/continuous-integration.md
Normal file
177
site/docs/continuous-integration.md
Normal file
@@ -0,0 +1,177 @@
|
||||
---
|
||||
layout: docs
|
||||
title: Continuous Integration
|
||||
prev_section: deployment-methods
|
||||
next_section: troubleshooting
|
||||
permalink: /docs/continuous-integration/
|
||||
---
|
||||
|
||||
You can easily test your website build against one or more versions of Ruby.
|
||||
The following guide will show you how to set up a free build environment on
|
||||
[Travis][0], with [GitHub][1] integration for pull requests. Paid
|
||||
alternatives exist for private repositories.
|
||||
|
||||
[0]: https://travis-ci.org/
|
||||
[1]: https://github.com/
|
||||
|
||||
## 1. Enabling Travis and GitHub
|
||||
|
||||
Enabling Travis builds for your GitHub repository is pretty simple:
|
||||
|
||||
1. Go to your profile on travis-ci.org: https://travis-ci.org/profile/username
|
||||
2. Find the repository for which you're interested in enabling builds.
|
||||
3. Click the slider on the right so it says "ON" and is a dark grey.
|
||||
4. Optionally configure the build by clicking on the wrench icon. Further
|
||||
configuration happens in you `.travis.yml` file. More details on that
|
||||
below.
|
||||
|
||||
## 2. The Test Script
|
||||
|
||||
The simplest test script simply runs `jekyll build` and ensures that Jekyll
|
||||
doesn't fail to build the site. It doesn't check the resulting site, but it
|
||||
does ensure things are built properly.
|
||||
|
||||
When testing Jekyll output, there is no better tool than [html-proofer][2].
|
||||
This tool checks your resulting site to ensure all links and images exist.
|
||||
Utilize it either with the convenient `htmlproof` command-line executable,
|
||||
or write a Ruby script which utilizes the gem.
|
||||
|
||||
### The HTML Proofer Executable
|
||||
|
||||
{% highlight bash %}
|
||||
#!/usr/bin/env bash
|
||||
set -e # halt script on error
|
||||
|
||||
bundle exec jekyll build
|
||||
bundle exec htmlproof ./_site
|
||||
{% endhighlight %}
|
||||
|
||||
Some options can be specified via command-line switches. Check out the
|
||||
`html-proofer` README for more information about these switches, or run
|
||||
`htmlproof --help` locally.
|
||||
|
||||
### The HTML Proofer Library
|
||||
|
||||
You can also invoke `html-proofer` in Ruby scripts (e.g. in a Rakefile):
|
||||
|
||||
{% highlight ruby %}
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'html/proofer'
|
||||
HTML::Proofer.new("./_site").run
|
||||
{% endhighlight %}
|
||||
|
||||
Options are given as a second argument to `.new`, and are encoded in a
|
||||
symbol-keyed Ruby Hash. More information about the configuration options,
|
||||
check out `html-proofer`'s README file.
|
||||
|
||||
[2]: https://github.com/gjtorikian/html-proofer
|
||||
|
||||
## 3. Configuring Your Travis Builds
|
||||
|
||||
This file is used to configure your Travis builds. Because Jekyll is built
|
||||
with Ruby and requires RubyGems to install, we use the Ruby language build
|
||||
environment. Below is a sample `.travis.yml` file, and what follows that is
|
||||
an explanation of each line.
|
||||
|
||||
{% highlight yaml %}
|
||||
language: ruby
|
||||
rvm:
|
||||
- 2.1
|
||||
script: ./script/cibuild
|
||||
|
||||
# branch whitelist
|
||||
branches:
|
||||
only:
|
||||
- gh-pages # test the gh-pages branch
|
||||
- /pages-(.*)/ # test every branch which starts with "pages-"
|
||||
|
||||
env:
|
||||
global:
|
||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
|
||||
{% endhighlight %}
|
||||
|
||||
Ok, now for an explanation of each line:
|
||||
|
||||
{% highlight yaml %}
|
||||
language: ruby
|
||||
{% endhighlight %}
|
||||
|
||||
This line tells Travis to use a Ruby build container. It gives your script
|
||||
access to Bundler, RubyGems, and and Ruby runtime.
|
||||
|
||||
{% highlight yaml %}
|
||||
rvm:
|
||||
- 2.1
|
||||
{% endhighlight %}
|
||||
|
||||
RVM is a popular Ruby Version Manager (like rbenv, chruby, etc). This
|
||||
directive tells Travis the Ruby version to use when running your test
|
||||
script.
|
||||
|
||||
{% highlight yaml %}
|
||||
script: ./script/cibuild
|
||||
{% endhighlight %}
|
||||
|
||||
Travis allows you to run any arbitrary shell script to test your site. One
|
||||
convention is to put all scripts for your project in the `script`
|
||||
directory, and to call your test script `cibuild`. This line is completely
|
||||
customizable. If your script won't change much, you can write your test
|
||||
incantation here directly:
|
||||
|
||||
{% highlight yaml %}
|
||||
script: jekyll build && htmlproof ./_site
|
||||
{% endhighlight %}
|
||||
|
||||
The `script` directive can be absolutely any valid shell command.
|
||||
|
||||
{% highlight yaml %}
|
||||
# branch whitelist
|
||||
branches:
|
||||
only:
|
||||
- gh-pages # test the gh-pages branch
|
||||
- /pages-(.*)/ # test every branch which starts with "pages-"
|
||||
{% endhighlight %}
|
||||
|
||||
You want to ensure the Travis builds for your site are being run only on
|
||||
the branch or branches which contain your site. One means of ensuring this
|
||||
isolation is including a branch whitelist in your Travis configuration
|
||||
file. By specifying the `gh-pages` branch, you will ensure the associated
|
||||
test script (discussed above) is only executed on site branches. If you use
|
||||
a pull request flow for proposing changes, you may wish to enforce a
|
||||
convention for your builds such that all branches containing edits are
|
||||
prefixed, exemplified above with the `/pages-(.*)/` regular expression.
|
||||
|
||||
The `branches` directive is completely optional.
|
||||
|
||||
{% highlight yaml %}
|
||||
env:
|
||||
global:
|
||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
|
||||
{% endhighlight %}
|
||||
|
||||
Using `html-proofer`? You'll want this environment variable. Nokogiri, used
|
||||
to parse HTML files in your compiled site, comes bundled with libraries
|
||||
which it must compile each time it is installed. Luckily, you can
|
||||
dramatically increase the install time of Nokogiri by setting the
|
||||
environment variable `NOKOGIRI_USE_SYSTEM_LIBRARIES` to `true`.
|
||||
|
||||
## 4. Gotchas
|
||||
|
||||
### Exclude `vendor`
|
||||
|
||||
Travis bundles all gems in the `vendor` directory on its build servers,
|
||||
which Jekyll will mistakenly read and explode on. To avoid this, exclude
|
||||
`vendor` in your `_config.yml`:
|
||||
|
||||
{% highlight yaml %}
|
||||
exclude: [vendor]
|
||||
{% endhighlight %}
|
||||
|
||||
### Questions?
|
||||
|
||||
This entire guide is open-source. Go ahead and [edit it][3] if you have a
|
||||
fix or [ask for help][4] if you run into trouble and need some help.
|
||||
|
||||
[3]: https://github.com/jekyll/jekyll/edit/master/site/docs/continuous-integration.md
|
||||
[4]: https://github.com/jekyll/jekyll-help#how-do-i-ask-a-question
|
||||
@@ -94,7 +94,8 @@ The organizations can then be accessed via `site.data.orgs`, followed by the fil
|
||||
{% highlight html %}
|
||||
{% raw %}
|
||||
<ul>
|
||||
{% for org in site.data.orgs %}
|
||||
{% for org_hash in site.data.orgs %}
|
||||
{% assign org = org_hash[1] %}
|
||||
<li>
|
||||
<a href="https://github.com/{{ org.username }}">
|
||||
{{ org.name }}
|
||||
|
||||
@@ -5,6 +5,92 @@ permalink: "/docs/history/"
|
||||
prev_section: contributing
|
||||
---
|
||||
|
||||
## 2.1.0 / 2014-06-28
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
- Bump to the latest Liquid version, 2.6.1 ([#2495]({{ site.repository }}/issues/2495))
|
||||
- Add support for JSON files in the `_data` directory ([#2369]({{ site.repository }}/issues/2369))
|
||||
- Allow subclasses to override `EXCERPT_ATTRIBUTES_FOR_LIQUID` ([#2408]({{ site.repository }}/issues/2408))
|
||||
- Add `Jekyll.env` and `jekyll.environment` (the Liquid var) ([#2417]({{ site.repository }}/issues/2417))
|
||||
- Use `_config.yaml` or `_config.yml` (`.yml` takes precedence) ([#2406]({{ site.repository }}/issues/2406))
|
||||
- Override collection url template ([#2418]({{ site.repository }}/issues/2418))
|
||||
- Allow subdirectories in `_data` ([#2395]({{ site.repository }}/issues/2395))
|
||||
- Extract Pagination Generator into gem: `jekyll-paginate` ([#2455]({{ site.repository }}/issues/2455))
|
||||
- Utilize `date_to_rfc822` filter in site template ([#2437]({{ site.repository }}/issues/2437))
|
||||
- Add categories, last build datetime, and generator to site template
|
||||
feed ([#2438]({{ site.repository }}/issues/2438))
|
||||
- Configurable, replaceable Logger-compliant logger ([#2444]({{ site.repository }}/issues/2444))
|
||||
- Extract `gist` tag into a separate gem ([#2469]({{ site.repository }}/issues/2469))
|
||||
- Add `collection` attribute to `Document#to_liquid` to access the
|
||||
document's collection label. ([#2436]({{ site.repository }}/issues/2436))
|
||||
- Upgrade listen to `2.7.6 <= x < 3.0.0` ([#2492]({{ site.repository }}/issues/2492))
|
||||
- Allow configuration of different Twitter and GitHub usernames in site template ([#2485]({{ site.repository }}/issues/2485))
|
||||
- Bump Pygments to v0.6.0 ([#2504]({{ site.repository }}/issues/2504))
|
||||
- Front-matter defaults for documents in collections ([#2419]({{ site.repository }}/issues/2419))
|
||||
- Include files with a url which ends in `/` in the `site.html_pages` list ([#2524]({{ site.repository }}/issues/2524))
|
||||
- Make `highlight` tag use `language-` prefix in CSS class ([#2511]({{ site.repository }}/issues/2511))
|
||||
- Lookup item property via `item#to_liquid` before `#data` or `#[]` in filters ([#2493]({{ site.repository }}/issues/2493))
|
||||
- Skip initial build of site on serve with flag ([#2477]({{ site.repository }}/issues/2477))
|
||||
- Add support for `hl_lines` in `highlight` tag ([#2532]({{ site.repository }}/issues/2532))
|
||||
- Spike out `--watch` flag into a separate gem ([#2550]({{ site.repository }}/issues/2550))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Liquid `sort` filter should sort even if one of the values is `nil` ([#2345]({{ site.repository }}/issues/2345))
|
||||
- Remove padding on `pre code` in the site template CSS ([#2383]({{ site.repository }}/issues/2383))
|
||||
- Set `log_level` earlier to silence info level configuration output ([#2393]({{ site.repository }}/issues/2393))
|
||||
- Only list pages which have `title` in site template ([#2411]({{ site.repository }}/issues/2411))
|
||||
- Accept `Numeric` values for dates, not `Number` values ([#2377]({{ site.repository }}/issues/2377))
|
||||
- Prevent code from overflowing container in site template ([#2429]({{ site.repository }}/issues/2429))
|
||||
- Encode URLs in UTF-8 when escaping and unescaping ([#2420]({{ site.repository }}/issues/2420))
|
||||
- No Layouts or Liquid for Asset Files ([#2431]({{ site.repository }}/issues/2431))
|
||||
- Allow front-matter defaults to set post categories ([#2373]({{ site.repository }}/issues/2373))
|
||||
- Fix command in subcommand deprecation warning ([#2457]({{ site.repository }}/issues/2457))
|
||||
- Keep all parent directories of files/dirs in `keep_files` ([#2458]({{ site.repository }}/issues/2458))
|
||||
- When using RedCarpet and Rouge without Rouge installed, fixed erroneous
|
||||
error which stated that redcarpet was missing, not rouge. ([#2464]({{ site.repository }}/issues/2464))
|
||||
- Ignore *all* directories and files that merit it on auto-generation ([#2459]({{ site.repository }}/issues/2459))
|
||||
- Before copying file, explicitly remove the old one ([#2535]({{ site.repository }}/issues/2535))
|
||||
- Merge file system categories with categories from YAML. ([#2531]({{ site.repository }}/issues/2531))
|
||||
- Deep merge front matter defaults ([#2490]({{ site.repository }}/issues/2490))
|
||||
- Ensure exclude and include arrays are arrays of strings ([#2542]({{ site.repository }}/issues/2542))
|
||||
- Allow collections to have dots in their filenames ([#2552]({{ site.repository }}/issues/2552))
|
||||
- Collections shouldn't try to read in directories as files ([#2552]({{ site.repository }}/issues/2552))
|
||||
- Be quiet very quickly. ([#2520]({{ site.repository }}/issues/2520))
|
||||
|
||||
### Development Fixes
|
||||
|
||||
- Test Ruby 2.1.2 instead of 2.1.1 ([#2374]({{ site.repository }}/issues/2374))
|
||||
- Add test for sorting UTF-8 characters ([#2384]({{ site.repository }}/issues/2384))
|
||||
- Use `https` for GitHub links in documentation ([#2470]({{ site.repository }}/issues/2470))
|
||||
- Remove coverage reporting with Coveralls ([#2494]({{ site.repository }}/issues/2494))
|
||||
- Fix a bit of missing TomDoc to `Jekyll::Commands::Build#build` ([#2554]({{ site.repository }}/issues/2554))
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
- Set `timezone` to `America/Los_Angeles` ([#2394]({{ site.repository }}/issues/2394))
|
||||
- Improve JavaScript in `anchor_links.html` ([#2368]({{ site.repository }}/issues/2368))
|
||||
- Remove note on Quickstart page about default markdown converter ([#2387]({{ site.repository }}/issues/2387))
|
||||
- Remove broken link in extras.md to a Maruku fork ([#2401]({{ site.repository }}/issues/2401))
|
||||
- Update Font Awesome to v4.1.0. ([#2410]({{ site.repository }}/issues/2410))
|
||||
- Fix broken link on Installation page to Templates page ([#2421]({{ site.repository }}/issues/2421))
|
||||
- Prevent table from extending parent width in permalink style table ([#2424]({{ site.repository }}/issues/2424))
|
||||
- Add collections to info about pagination support ([#2389]({{ site.repository }}/issues/2389))
|
||||
- Add `jekyll_github_sample` plugin to list of third-party plugins ([#2463]({{ site.repository }}/issues/2463))
|
||||
- Clarify documentation around front-matter defaults and add details
|
||||
about defaults for collections. ([#2439]({{ site.repository }}/issues/2439))
|
||||
- Add Jekyll Project Version Tag to list of third-party plugins ([#2468]({{ site.repository }}/issues/2468))
|
||||
- Use `https` for GitHub links across whole site ([#2470]({{ site.repository }}/issues/2470))
|
||||
- Add StickerMule + Jekyll post ([#2476]({{ site.repository }}/issues/2476))
|
||||
- Add Jekyll Asset Pipeline Reborn to list of third-party plugins ([#2479]({{ site.repository }}/issues/2479))
|
||||
- Add link to jekyll-compress-html to list of third-party plugins ([#2514]({{ site.repository }}/issues/2514))
|
||||
- Add Piwigo Gallery to list of third-party plugins ([#2526]({{ site.repository }}/issues/2526))
|
||||
- Set `show_drafts` to `false` in default configuration listing ([#2536]({{ site.repository }}/issues/2536))
|
||||
- Provide an updated link for Windows installation instructions ([#2544]({{ site.repository }}/issues/2544))
|
||||
- Remove `url` from configuration docs ([#2547]({{ site.repository }}/issues/2547))
|
||||
- Documentation for Continuous Integration for your Jekyll Site ([#2432]({{ site.repository }}/issues/2432))
|
||||
|
||||
## 2.0.3 / 2014-05-08
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -19,6 +19,8 @@ you’ll need to make sure your system has before you start.
|
||||
- [Ruby](http://www.ruby-lang.org/en/downloads/)
|
||||
- [RubyGems](http://rubygems.org/pages/download)
|
||||
- Linux, Unix, or Mac OS X
|
||||
- [NodeJS](http://nodejs.org), or another JavaScript runtime (for
|
||||
CoffeeScript support).
|
||||
|
||||
<div class="note info">
|
||||
<h5>Running Jekyll on Windows</h5>
|
||||
|
||||
@@ -122,6 +122,30 @@ following is a reference of the available data.
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><code>site.html_pages</code></p></td>
|
||||
<td><p>
|
||||
|
||||
A list of all HTML Pages.
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><code>site.collections</code></p></td>
|
||||
<td><p>
|
||||
|
||||
A list of all the collections.
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><code>site.data</code></p></td>
|
||||
<td><p>
|
||||
|
||||
A list containing the data loaded from the YAML files located in the <code>_data</code> directory.
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><code>site.documents</code></p></td>
|
||||
<td><p>
|
||||
|
||||
@@ -12,7 +12,7 @@ knowledge and lessons that have been unearthed by Windows users.
|
||||
|
||||
## Installation
|
||||
|
||||
Madhur Ahuja has written up instructions to get
|
||||
Julian Thilo has written up instructions to get
|
||||
[Jekyll running on Windows][windows-installation] and it seems to work for most.
|
||||
|
||||
## Encoding
|
||||
@@ -29,7 +29,7 @@ the site generation process. It can be done with the following command:
|
||||
$ chcp 65001
|
||||
{% endhighlight %}
|
||||
|
||||
[windows-installation]: http://www.madhur.co.in/blog/2011/09/01/runningjekyllwindows.html
|
||||
[windows-installation]: http://jekyll-windows.juthilo.com/
|
||||
|
||||
## Auto-regeneration
|
||||
|
||||
|
||||
5
test/source/_slides/example-slide-3.html
Normal file
5
test/source/_slides/example-slide-3.html
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: Override permalink
|
||||
layout: slide
|
||||
permalink: /slide/3/
|
||||
---
|
||||
5
test/source/_with.dots/all.dots/2.4.0.md
Normal file
5
test/source/_with.dots/all.dots/2.4.0.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: v2.4.0
|
||||
---
|
||||
|
||||
v2.4.0
|
||||
0
test/source/_with.dots/file.with.dots.md
Normal file
0
test/source/_with.dots/file.with.dots.md
Normal file
@@ -17,15 +17,15 @@ class TestCollections < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
should "sanitize the label name" do
|
||||
assert_equal @collection.label, "etcpassword"
|
||||
assert_equal @collection.label, "....etcpassword"
|
||||
end
|
||||
|
||||
should "have a sanitized relative path name" do
|
||||
assert_equal @collection.relative_directory, "_etcpassword"
|
||||
assert_equal @collection.relative_directory, "_....etcpassword"
|
||||
end
|
||||
|
||||
should "have a sanitized full path" do
|
||||
assert_equal @collection.directory, source_dir("_etcpassword")
|
||||
assert_equal @collection.directory, source_dir("_....etcpassword")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -194,4 +194,31 @@ class TestCollections < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "with dots in the filenames" do
|
||||
setup do
|
||||
@site = fixture_site({
|
||||
"collections" => ["with.dots"],
|
||||
"safe" => true
|
||||
})
|
||||
@site.process
|
||||
@collection = @site.collections["with.dots"]
|
||||
end
|
||||
|
||||
should "exist" do
|
||||
assert_not_nil @collection
|
||||
end
|
||||
|
||||
should "contain one document" do
|
||||
assert_equal 2, @collection.docs.size
|
||||
end
|
||||
|
||||
should "allow dots in the filename" do
|
||||
assert_equal "_with.dots", @collection.relative_directory
|
||||
end
|
||||
|
||||
should "read document in subfolders with dots" do
|
||||
assert @collection.docs.any? { |d| d.path.include?("all.dots") }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -165,6 +165,28 @@ class TestDocument < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "a document in a collection with a custom permalink" do
|
||||
setup do
|
||||
@site = Site.new(Jekyll.configuration({
|
||||
"collections" => ["slides"],
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir
|
||||
}))
|
||||
@site.process
|
||||
@document = @site.collections["slides"].docs[2]
|
||||
@dest_file = dest_dir("slide/3/index.html")
|
||||
end
|
||||
|
||||
should "know its permalink" do
|
||||
assert_equal "/slide/3/", @document.permalink
|
||||
end
|
||||
|
||||
should "produce the right URL" do
|
||||
assert_equal "/slide/3/", @document.url
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
context " a document part of a rendered collection" do
|
||||
end
|
||||
|
||||
|
||||
@@ -76,6 +76,12 @@ CONTENT
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ :cssclass => 'hl', :linenos => 'table' }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos=3', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => '3' }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'ruby linenos=table cssclass=hl hl_linenos="3 5 6"', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal({ :cssclass => 'hl', :linenos => 'table', :hl_linenos => ['3', '5', '6'] }, tag.instance_variable_get(:@options))
|
||||
|
||||
tag = Jekyll::Tags::HighlightBlock.new('highlight', 'Ruby ', ["test", "{% endhighlight %}", "\n"])
|
||||
assert_equal "ruby", tag.instance_variable_get(:@lang), "lexers should be case insensitive"
|
||||
end
|
||||
@@ -414,9 +420,8 @@ CONTENT
|
||||
)
|
||||
end
|
||||
|
||||
# todo: if #112 is merged into maruku, update to remove the newlines inside code block
|
||||
should "render fenced code blocks" do
|
||||
assert_match %r{<pre class=\"ruby\"><code class=\"ruby\">\nputs "Hello world"\n</code></pre>}, @result.strip
|
||||
assert_match %r{<pre class=\"ruby\"><code class=\"ruby\">puts "Hello world"</code></pre>}, @result.strip
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user