mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
24 Commits
cache-incl
...
no-dots-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7312a5af4f | ||
|
|
46d2794acb | ||
|
|
e2a5a9dbc1 | ||
|
|
f2650e7b0f | ||
|
|
8b6a9d66ec | ||
|
|
0bf82e9cf7 | ||
|
|
4e9b0663be | ||
|
|
b9542c5426 | ||
|
|
0a4bd99e6b | ||
|
|
5536f950f9 | ||
|
|
989639256d | ||
|
|
9a52d56b5a | ||
|
|
a6238c36d5 | ||
|
|
730aedd0a3 | ||
|
|
4cbd814546 | ||
|
|
cae9d96cc4 | ||
|
|
8a9c48c7b4 | ||
|
|
faccf8f802 | ||
|
|
bce4680182 | ||
|
|
b92274b101 | ||
|
|
e7c0e313a3 | ||
|
|
b6c197d312 | ||
|
|
1062fdf89f | ||
|
|
a2b6aa263e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -13,5 +13,5 @@ site/_site/
|
||||
coverage
|
||||
.ruby-version
|
||||
.sass-cache
|
||||
tmp/stackprof-*
|
||||
tmp/*
|
||||
.jekyll-metadata
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* Kramdown: Use `enable_coderay` key instead of `use_coderay` (#3237)
|
||||
* Unescape `Document` output path (#2924)
|
||||
* Fix nav items alignment when on multiple rows (#3264)
|
||||
* Highlight: Only Strip Newlines/Carriage Returns, not Spaces (#3278)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
@@ -32,6 +33,8 @@
|
||||
* Update rake task `site:publish` to fix minor bugs. (#3254)
|
||||
* Switch to shields.io for the README badges. (#3255)
|
||||
* Use `FileList` instead of `Dir.glob` in `site:publish` rake task (#3261)
|
||||
* Fix test script to be platform-independent (#3279)
|
||||
* Instead of symlinking `/tmp`, create and symlink a local `tmp` in the tests (#3258)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
@@ -40,6 +43,9 @@
|
||||
* Add link to 'Adding Ajax pagination to Jekyll' to Resources page (#3186)
|
||||
* Add a Resources link to tutorial on building dynamic navbars (#3185)
|
||||
* Semantic structure improvements to the post and page layouts (#3251)
|
||||
* Add new AsciiDoc plugin to list of third-party plugins. (#3277)
|
||||
* Specify that all transformable collection documents must contain YAML front matter (#3271)
|
||||
* Assorted accessibility fixes (#3256)
|
||||
|
||||
## 2.5.3 / 2014-12-22
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ module Jekyll
|
||||
begin
|
||||
self.content = File.read(site.in_source_dir(base, name),
|
||||
merged_file_read_opts(opts))
|
||||
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
||||
if content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
self.data = SafeYAML.load($1)
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ eos
|
||||
def render(context)
|
||||
prefix = context["highlighter_prefix"] || ""
|
||||
suffix = context["highlighter_suffix"] || ""
|
||||
code = super.to_s.strip
|
||||
code = super.to_s.gsub(/^(\n|\r)+|(\n|\r)+$/, '')
|
||||
|
||||
is_safe = !!context.registers[:site].safe
|
||||
|
||||
|
||||
21
script/test
21
script/test
@@ -4,25 +4,16 @@
|
||||
# script/test
|
||||
# script/test <test_file>
|
||||
|
||||
if [ ! -d tmp ]; then
|
||||
mkdir tmp
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
TEST_FILES="./test/test_*.rb"
|
||||
TEST_FILES=$(ruby -e "puts Dir.glob('test/test_*.rb')")
|
||||
else
|
||||
TEST_FILES="$@"
|
||||
fi
|
||||
|
||||
# bundle exec gem env
|
||||
GEM_DIR=$(bundle exec gem env | grep -C 1 "GEM PATHS" | tail -1 | cut -d '-' -f2 | cut -d' ' -f2)
|
||||
RAKE_LIB_WITH_VERSION=$(bundle exec ruby -e "puts Gem::Specification.find_by_name('rake').gem_dir.split('/').last + '/lib'")
|
||||
RAKE_LIB_DIR="${GEM_DIR}/gems/${RAKE_LIB_WITH_VERSION}"
|
||||
|
||||
test -d "${RAKE_LIB_DIR}" || {
|
||||
echo "No ${RAKE_LIB_DIR}. Installing Rake."
|
||||
bundle show rake | cut -d'/' -f12 | cut -d'-' -f 2 | xargs bundle exec gem install rake -v
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
time bundle exec ruby -I"lib:test" \
|
||||
-I"${RAKE_LIB_DIR}" \
|
||||
"${RAKE_LIB_DIR}/rake/rake_test_loader.rb" \
|
||||
$TEST_FILES
|
||||
time bundle exec ruby -I"lib:test" -rloader $TEST_FILES
|
||||
|
||||
@@ -37,7 +37,7 @@ collections:
|
||||
### Step 2: Add your content
|
||||
|
||||
Create a corresponding folder (e.g. `<source>/_my_collection`) and add documents.
|
||||
YAML Front Matter is read in as data if it exists, if not, then everything is just stuck in the Document's `content` attribute.
|
||||
YAML Front Matter is read in as data if it exists, and everything after it is stuck in the Document's `content` attribute. If no YAML Front Matter is provided, Jekyll will not generate the file in your collection.
|
||||
|
||||
Note: the folder must be named identically to the collection you defined in your `_config.yml` file, with the addition of the preceding `_` character.
|
||||
|
||||
@@ -211,8 +211,7 @@ In addition to any YAML Front Matter provided in the document's corresponding fi
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The (unrendered) content of the document. If no YAML Front Matter is provided,
|
||||
this is the entirety of the file contents. If YAML Front Matter
|
||||
The (unrendered) content of the document. If no YAML Front Matter is provided, Jekyll will not generate the file in your collection. If YAML Front Matter
|
||||
is used, then this is all the contents of the file after the terminating
|
||||
`---` of the front matter.
|
||||
</p>
|
||||
|
||||
@@ -514,6 +514,7 @@ You can find a few useful plugins at the following locations:
|
||||
- [Org-mode Converter](https://gist.github.com/abhiyerra/7377603): Org-mode converter for Jekyll.
|
||||
- [Customized Kramdown Converter](https://github.com/mvdbos/kramdown-with-pygments): Enable Pygments syntax highlighting for Kramdown-parsed fenced code blocks.
|
||||
- [Bigfootnotes Plugin](https://github.com/TheFox/jekyll-bigfootnotes): Enables big footnotes for Kramdown.
|
||||
- [AsciiDoc Plugin](https://github.com/asciidoctor/jekyll-asciidoc): AsciiDoc convertor for Jekyll using [Asciidoctor](http://asciidoctor.org/).
|
||||
|
||||
#### Filters
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
var anchor = document.createElement("a");
|
||||
anchor.className = "header-link";
|
||||
anchor.href = "#" + id;
|
||||
anchor.innerHTML = "<i class=\"fa fa-link\"></i>";
|
||||
anchor.innerHTML = "<span class=\"sr-only\">Permalink</span><i class=\"fa fa-link\"></i>";
|
||||
anchor.title = "Permalink";
|
||||
return anchor;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<footer>
|
||||
<footer role="contentinfo">
|
||||
<div class="grid">
|
||||
<div class="unit one-third center-on-mobiles">
|
||||
<p>The contents of this website are © {{ site.time | date: '%Y' }} <a href="http://tom.preston-werner.com/">Tom Preston-Werner</a> under the terms of the <a href="{{ site.repository }}/blob/master/LICENSE">MIT License</a>.</p>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<header>
|
||||
<header role="banner">
|
||||
<nav class="mobile-nav show-on-mobiles">
|
||||
{% include primary-nav-items.html %}
|
||||
</nav>
|
||||
@@ -6,8 +6,8 @@
|
||||
<div class="unit one-third center-on-mobiles">
|
||||
<h1>
|
||||
<a href="/">
|
||||
<span>Jekyll</span>
|
||||
<img src="/img/logo-2x.png" width="249" height="115" alt="Logo">
|
||||
<span class="sr-only">Jekyll</span>
|
||||
<img src="/img/logo-2x.png" width="249" height="115" alt="Jekyll Logo">
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{ post.date | date_to_string }}
|
||||
</span>
|
||||
<a href="https://github.com/{{ post.author }}" class="post-author">
|
||||
<img src="https://github.com/{{ post.author }}.png" class="avatar" alt="{{ post.author }}" width="24" height="24">
|
||||
<img src="https://github.com/{{ post.author }}.png" class="avatar" alt="{{ post.author }} avatar" width="24" height="24">
|
||||
{{ post.author }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@ layout: news
|
||||
{{ page.date | date_to_string }}
|
||||
</span>
|
||||
<a href="https://github.com/{{ page.author }}" class="post-author">
|
||||
<img src="https://github.com/{{ page.author }}.png" class="avatar" alt="{{ page.author }}" width="24" height="24">
|
||||
<img src="https://github.com/{{ page.author }}.png" class="avatar" alt="{{ page.author }} avatar" width="24" height="24">
|
||||
{{ page.author }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -44,9 +44,6 @@ header {
|
||||
h1,
|
||||
nav { display: inline-block; }
|
||||
|
||||
h1 {
|
||||
span { display: none; }
|
||||
}
|
||||
}
|
||||
|
||||
nav {
|
||||
@@ -165,10 +162,10 @@ h6:hover .header-link {
|
||||
/* Footer */
|
||||
|
||||
footer {
|
||||
background-color: #222;
|
||||
background-color: #212121;
|
||||
font-size: 16px;
|
||||
padding-bottom: 5px;
|
||||
color: #888;
|
||||
color: #c0c0c0;
|
||||
margin-top: 40px;
|
||||
|
||||
a {
|
||||
@@ -230,7 +227,7 @@ footer {
|
||||
|
||||
.content { padding: 0; }
|
||||
|
||||
h4 {
|
||||
h3 {
|
||||
font-size: 24px;
|
||||
line-height: 24px;
|
||||
margin-top: 20px;
|
||||
@@ -253,7 +250,7 @@ footer {
|
||||
float: right;
|
||||
}
|
||||
|
||||
h4 {
|
||||
h3 {
|
||||
margin: 50px 0 0;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -295,7 +292,7 @@ footer {
|
||||
padding: 20px;
|
||||
text-shadow: none;
|
||||
margin: 0 20px;
|
||||
background-color: #3d3d3d;
|
||||
background-color: #171717;
|
||||
@include border-radius(0 0 5px 5px);
|
||||
@include box-shadow(0 5px 30px rgba(0,0,0,.3));
|
||||
}
|
||||
@@ -333,7 +330,7 @@ footer {
|
||||
.free-hosting {
|
||||
|
||||
.pane {
|
||||
background-color: #444;
|
||||
background-color: #3e3e3e;
|
||||
@include border-radius(10px);
|
||||
text-shadow: none;
|
||||
position: relative;
|
||||
@@ -483,7 +480,7 @@ aside {
|
||||
@include border-radius(5px);
|
||||
/*border: 1px solid #333;*/
|
||||
@include box-shadow(0 1px 3px rgba(0,0,0,.3), inset 0 1px 1px rgba(255,255,255,.5));
|
||||
background-color: #777;
|
||||
background-color: #767676;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
@@ -597,7 +594,7 @@ article h2:first-child { margin-top: 0; }
|
||||
|
||||
.post-meta {
|
||||
padding: 5px 0;
|
||||
color: #aaa;
|
||||
color: #c0c0c0;
|
||||
font-weight: 600;
|
||||
text-shadow: 0 -1px 0 #000;
|
||||
}
|
||||
@@ -635,7 +632,7 @@ p > nobr > code,
|
||||
li > code,
|
||||
h5 > code,
|
||||
.note > code {
|
||||
background-color: #333;
|
||||
background-color: #2b2b2b;
|
||||
color: #fff;
|
||||
@include border-radius(5px);
|
||||
@include box-shadow(inset 0 1px 10px rgba(0,0,0,.3),
|
||||
@@ -971,3 +968,18 @@ code.output {
|
||||
display: inline !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Helper class taken from Bootstrap.
|
||||
Hides an element to all devices except screen readers.
|
||||
*/
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ overview: true
|
||||
<section class="quickstart">
|
||||
<div class="grid">
|
||||
<div class="unit golden-small center-on-mobiles">
|
||||
<h4>Get up and running <em>in seconds</em>.</h4>
|
||||
<h3>Get up and running <em>in seconds</em>.</h3>
|
||||
</div>
|
||||
<div class="unit golden-large code">
|
||||
<p class="title">Quick-start Instructions</p>
|
||||
|
||||
44
test/loader.rb
Normal file
44
test/loader.rb
Normal file
@@ -0,0 +1,44 @@
|
||||
# Yoinked lovingly from Rake's source code.
|
||||
#
|
||||
# Copyright (c) Jim Weirich
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the
|
||||
# "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||
# permit persons to whom the Software is furnished to do so, subject to
|
||||
# the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
require 'rake'
|
||||
|
||||
# Load the test files from the command line.
|
||||
argv = ARGV.select do |argument|
|
||||
case argument
|
||||
when /^-/ then
|
||||
argument
|
||||
when /\*/ then
|
||||
FileList[argument].to_a.each do |file|
|
||||
require File.expand_path file
|
||||
end
|
||||
|
||||
false
|
||||
else
|
||||
require File.expand_path argument
|
||||
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
ARGV.replace argv
|
||||
@@ -1 +1 @@
|
||||
/tmp
|
||||
../../../tmp/
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Test Post Where YAML Ends in Dots
|
||||
...
|
||||
|
||||
# Test
|
||||
@@ -26,4 +26,4 @@ Partial variable test
|
||||
|
||||
Relative to self test:
|
||||
|
||||
- 9 {% include_relative 2014-03-03-yaml-with-dots.md %}
|
||||
- 9 {% include_relative 2010-01-08-triple-dash.markdown %}
|
||||
|
||||
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
should "ensure post count is as expected" do
|
||||
assert_equal 44, @site.posts.size
|
||||
assert_equal 43, @site.posts.size
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
|
||||
@@ -165,18 +165,6 @@ class TestPost < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "with three dots ending YAML header" do
|
||||
setup do
|
||||
@real_file = "2014-03-03-yaml-with-dots.md"
|
||||
end
|
||||
should "should read the YAML header" do
|
||||
@post.read_yaml(@source, @real_file)
|
||||
|
||||
assert_equal({"title" => "Test Post Where YAML Ends in Dots"},
|
||||
@post.data)
|
||||
end
|
||||
end
|
||||
|
||||
context "with embedded triple dash" do
|
||||
setup do
|
||||
@real_file = "2010-01-08-triple-dash.markdown"
|
||||
|
||||
@@ -174,6 +174,46 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "post content has highlight tag with preceding spaces & lines" do
|
||||
setup do
|
||||
fill_post <<-EOS
|
||||
|
||||
|
||||
[,1] [,2]
|
||||
[1,] FALSE TRUE
|
||||
[2,] FALSE TRUE
|
||||
EOS
|
||||
end
|
||||
|
||||
should "only strip the preceding newlines" do
|
||||
assert_match %{<pre><code class=\"language-text\" data-lang=\"text\"> [,1] [,2]}, @result
|
||||
end
|
||||
end
|
||||
|
||||
context "post content has highlight tag with preceding spaces & Windows-style newlines" do
|
||||
setup do
|
||||
fill_post "\r\n\r\n\r\n [,1] [,2]"
|
||||
end
|
||||
|
||||
should "only strip the preceding newlines" do
|
||||
assert_match %{<pre><code class=\"language-text\" data-lang=\"text\"> [,1] [,2]}, @result
|
||||
end
|
||||
end
|
||||
|
||||
context "post content has highlight tag with only preceding spaces" do
|
||||
setup do
|
||||
fill_post <<-EOS
|
||||
[,1] [,2]
|
||||
[1,] FALSE TRUE
|
||||
[2,] FALSE TRUE
|
||||
EOS
|
||||
end
|
||||
|
||||
should "only strip the preceding newlines" do
|
||||
assert_match %{<pre><code class=\"language-text\" data-lang=\"text\"> [,1] [,2]}, @result
|
||||
end
|
||||
end
|
||||
|
||||
context "simple post with markdown and pre tags" do
|
||||
setup do
|
||||
@content = <<CONTENT
|
||||
@@ -319,7 +359,7 @@ CONTENT
|
||||
context "with symlink'd include" do
|
||||
|
||||
should "not allow symlink includes" do
|
||||
File.open("/tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") }
|
||||
File.open("tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") }
|
||||
assert_raise IOError do
|
||||
content = <<CONTENT
|
||||
---
|
||||
@@ -610,7 +650,7 @@ CONTENT
|
||||
context "with symlink'd include" do
|
||||
|
||||
should "not allow symlink includes" do
|
||||
File.open("/tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") }
|
||||
File.open("tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") }
|
||||
assert_raise IOError do
|
||||
content = <<CONTENT
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user