mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
51 Commits
v3.3.0
...
pull/markd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0c591a3f2 | ||
|
|
167af4552b | ||
|
|
3cc4bef2e6 | ||
|
|
4785f6f71f | ||
|
|
12a86c1298 | ||
|
|
0ce9d726f5 | ||
|
|
d6844d284c | ||
|
|
4d597643ec | ||
|
|
343d5f7be5 | ||
|
|
11a0b6578e | ||
|
|
3431c9f7b8 | ||
|
|
eca7f46749 | ||
|
|
821a845166 | ||
|
|
d979b4bf9b | ||
|
|
124c63fd59 | ||
|
|
89bbb249af | ||
|
|
344d07cb55 | ||
|
|
0484986c16 | ||
|
|
c7d0dda5a7 | ||
|
|
ea72f98609 | ||
|
|
0f5c34d16d | ||
|
|
0d8e21f779 | ||
|
|
2be5d56059 | ||
|
|
e6829b5949 | ||
|
|
8a4edc550b | ||
|
|
cc1972848d | ||
|
|
51d9be83a1 | ||
|
|
c4a23b4ced | ||
|
|
b9275920dd | ||
|
|
53d20bc77e | ||
|
|
7aa9c3f12c | ||
|
|
00e3c979c9 | ||
|
|
0a1c837755 | ||
|
|
7c901baac1 | ||
|
|
1f9c2b1380 | ||
|
|
146d5930a4 | ||
|
|
6ec86f4207 | ||
|
|
d1f67bf85a | ||
|
|
c9d24b7d18 | ||
|
|
62ec32c883 | ||
|
|
aa97be3ab5 | ||
|
|
389bbe1621 | ||
|
|
0d12a02893 | ||
|
|
d4b7b44328 | ||
|
|
6cec4aebc6 | ||
|
|
f2fcd17627 | ||
|
|
c569edcf0a | ||
|
|
53d472b7e2 | ||
|
|
f93e40209c | ||
|
|
c61752a336 | ||
|
|
fcef78c4b6 |
@@ -6,6 +6,7 @@ AllCops:
|
||||
Exclude:
|
||||
- lib/jekyll/renderer.rb
|
||||
- bin/**/*
|
||||
- exe/**/*
|
||||
- benchmark/**/*
|
||||
- script/**/*
|
||||
- vendor/**/*
|
||||
@@ -17,6 +18,10 @@ Lint/UselessAccessModifier:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Max: 21
|
||||
Metrics/BlockLength:
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
- lib/jekyll/configuration.rb
|
||||
Metrics/ClassLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
@@ -34,6 +39,8 @@ Metrics/MethodLength:
|
||||
Max: 20
|
||||
Severity: error
|
||||
Metrics/ModuleLength:
|
||||
Exclude:
|
||||
- lib/jekyll/filters.rb
|
||||
Max: 240
|
||||
Metrics/ParameterLists:
|
||||
Max: 4
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -18,7 +18,7 @@ end
|
||||
#
|
||||
|
||||
group :test do
|
||||
gem "rubocop"
|
||||
gem "rubocop", "~> 0.44.1"
|
||||
gem "cucumber", "~> 2.1"
|
||||
gem "jekyll_test_plugin"
|
||||
gem "jekyll_test_plugin_malicious"
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
## HEAD
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
* Documentation: {% link %} tag (#5449)
|
||||
* Updating install instruction link for Jekyll 3 on Windows (#5475)
|
||||
* Update normalize.css to v5.0.0 (#5471)
|
||||
* Add jekyll-data to the list of plugins (#5491)
|
||||
* Add info about checking version + updating (#5497)
|
||||
* Add jekyll-include-absolute-plugin to list of third-party plugins (#5492)
|
||||
* Remove jekyll-hook from deployment methods (#5502)
|
||||
* Update deployment-methods.md (#5504)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix typo in theme_template README (#5472)
|
||||
* Do not swallow all exceptions on render (#5495)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* fix rubocop errors on testing with Rubocop 0.44 (#5489)
|
||||
* script/test: add missing whitespace (#5479)
|
||||
* Restrict Rubocop version (#5496)
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Collapse `gsub` (#5494)
|
||||
|
||||
## 3.3.0 / 2016-10-06
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
@@ -63,6 +63,18 @@ Feature: Embed filters
|
||||
And the _site directory should exist
|
||||
And I should see "By <p><em>Obi-wan</em></p>" in "_site/2009/03/27/star-wars.html"
|
||||
|
||||
Scenario: Markdownify a given inline string
|
||||
Given I have a _posts directory
|
||||
And I have a _layouts directory
|
||||
And I have the following post:
|
||||
| title | date | layout | content |
|
||||
| Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
|
||||
And I have a default layout that contains "By {{ '_Obi-wan_' | markdownify:'inline' }}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "By <em>Obi-wan</em>" in "_site/2009/03/27/star-wars.html"
|
||||
|
||||
Scenario: Sort by an arbitrary variable
|
||||
Given I have a _layouts directory
|
||||
And I have the following page:
|
||||
|
||||
35
lib/jekyll/converters/markdown/inline.rb
Normal file
35
lib/jekyll/converters/markdown/inline.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
class Kramdown::Parser::Inline < Kramdown::Parser::Kramdown
|
||||
def initialize(source, options)
|
||||
super
|
||||
@block_parsers = [:block_html].freeze
|
||||
end
|
||||
end
|
||||
|
||||
module Jekyll
|
||||
module Converters
|
||||
class Markdown
|
||||
class Inline < Converter
|
||||
safe true
|
||||
priority :low
|
||||
|
||||
def initialize(config)
|
||||
Jekyll::External.require_with_graceful_fail "kramdown"
|
||||
@config = config["kramdown"].dup || {}
|
||||
@config[:input] = :Inline
|
||||
end
|
||||
|
||||
def matches(_)
|
||||
false
|
||||
end
|
||||
|
||||
def output_ext(_)
|
||||
nil
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
Kramdown::Document.new(content, @config).to_html.chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -13,9 +13,13 @@ module Jekyll
|
||||
# input - The Markdown String to convert.
|
||||
#
|
||||
# Returns the HTML formatted String.
|
||||
def markdownify(input)
|
||||
def markdownify(input, mode = nil)
|
||||
site = @context.registers[:site]
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
|
||||
if mode.to_s == "inline"
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown::Inline)
|
||||
else
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
|
||||
end
|
||||
converter.convert(input.to_s)
|
||||
end
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ module Jekyll
|
||||
if path.nil? || path.empty?
|
||||
""
|
||||
else
|
||||
path.gsub(%r!\A/!, "").gsub(%r!([^/])\z!, '\1')
|
||||
path.gsub(%r!\A/|(?<=[^/])\z!, "".freeze)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,8 +62,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def sanitize_filename(name)
|
||||
name.gsub!(%r![^\w\s-]+!, "")
|
||||
name.gsub!(%r!(^|\b\s)\s+($|\s?\b)!, '\\1\\2')
|
||||
name.gsub!(%r![^\w\s-]+|(?<=^|\b\s)\s+(?=$|\s?\b)!, "".freeze)
|
||||
name.gsub(%r!\s+!, "_")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -191,11 +191,7 @@ module Jekyll
|
||||
render_pages(payload)
|
||||
|
||||
Jekyll::Hooks.trigger :site, :post_render, self, payload
|
||||
# rubocop: disable HandleExceptions
|
||||
rescue Errno::ENOENT
|
||||
# ignore missing layout dir
|
||||
end
|
||||
# rubocop: enable HandleExceptions
|
||||
|
||||
# Remove orphaned files and empty directories in destination.
|
||||
#
|
||||
|
||||
@@ -38,7 +38,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
||||
|
||||
To set up your environment to develop this theme, run `bundle install`.
|
||||
|
||||
You theme is setup just like a normal Jelyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
||||
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
||||
|
||||
When your theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ for ruby in $rubies; do
|
||||
rake TESTOPTS=$testopts test
|
||||
else
|
||||
set -x
|
||||
time $ruby -S bundle exec ruby -Itest \
|
||||
time $ruby -S bundle exec ruby -I test \
|
||||
"$@" $testops
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -72,19 +72,6 @@ Deploying is now as easy as telling nginx or Apache to look at
|
||||
laptops$ git push deploy master
|
||||
```
|
||||
|
||||
### Jekyll-hook
|
||||
|
||||
You can also use jekyll-hook, a server that listens for webhook posts from
|
||||
GitHub, generates a website with Jekyll, and moves it somewhere to be
|
||||
published. Use this to run your own GitHub Pages-style web server.
|
||||
|
||||
This method is useful if you need to serve your websites behind a firewall,
|
||||
need extra server-level features like HTTP basic authentication or want to
|
||||
host your site directly on a CDN or file host like S3.
|
||||
|
||||
Setup steps are fully documented
|
||||
[in the `jekyll-hook` repo](https://github.com/developmentseed/jekyll-hook).
|
||||
|
||||
### Static Publisher
|
||||
|
||||
[Static Publisher](https://github.com/static-publisher/static-publisher) is another automated deployment option with a server listening for webhook posts, though it's not tied to GitHub specifically. It has a one-click deploy to Heroku, it can watch multiple projects from one server, it has an easy to user admin interface and can publish to either S3 or to a git repository (e.g. gh-pages).
|
||||
@@ -102,7 +89,7 @@ Once you’ve generated the `_site` directory, you can easily scp it using a
|
||||
need to change the values to reflect your site’s details. There is even [a
|
||||
matching TextMate command][] that will help you run this script.
|
||||
|
||||
[this deploy script here]: https://github.com/henrik/henrik.nyh.se/blob/master/script/deploy
|
||||
[this deploy script]: https://github.com/henrik/henrik.nyh.se/blob/master/script/deploy
|
||||
|
||||
[a matching TextMate command]: https://gist.github.com/henrik/214959
|
||||
|
||||
|
||||
@@ -103,4 +103,25 @@ Check out [the extras page](../extras/) for more information.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Now that you’ve got everything installed, let’s get to work!
|
||||
## Already Have Jekyll?
|
||||
|
||||
Before you start developing with Jekyll, you may want to check that you're up to date with the latest version. To find your version of Jekyll, run one of these commands:
|
||||
|
||||
```sh
|
||||
$ jekyll --version
|
||||
$ gem list jekyll
|
||||
```
|
||||
|
||||
You can also use [RubyGems](https://rubygems.org/gems/jekyll) to find the current versioning of any gem. But you can also use the `gem` command line tool:
|
||||
|
||||
```sh
|
||||
$ gem search jekyll --remote
|
||||
```
|
||||
|
||||
and you'll search for just the name `jekyll`, and in brackets will be latest version. Another way to check if you have the latest version is to run the command `gem outdated`. This will provide a list of all the gems on your system that need to be updated. If you aren't running the latest version, run this command:
|
||||
|
||||
```sh
|
||||
$ gem update jekyll
|
||||
```
|
||||
|
||||
Now that you’ve got everything up-to-date and installed, let’s get to work!
|
||||
|
||||
@@ -866,6 +866,7 @@ LESS.js files during generation.
|
||||
- [Jekyll Tags List Plugin](https://github.com/crispgm/jekyll-tags-list-plugin): A Liquid tag plugin that creates tags list in specific order.
|
||||
- [Jekyll Maps](https://github.com/ayastreb/jekyll-maps) by [Anatoliy Yastreb](https://github.com/ayastreb): A Jekyll plugin to easily embed maps with filterable locations.
|
||||
- [Jekyll Cloudinary](https://nhoizey.github.io/jekyll-cloudinary/) by [Nicolas Hoizey](https://nicolas-hoizey.com/): a Jekyll plugin adding a Liquid tag to ease the use of Cloudinary for responsive images in your Markdown/Kramdown posts.
|
||||
- [jekyll-include-absolute-plugin](https://github.com/tnhu/jekyll-include-absolute-plugin) by [Tan Nhu](https://github.com/tnhu): A Jekyll plugin to include a file from its path relative to Jekyll's source folder.
|
||||
|
||||
#### Collections
|
||||
|
||||
@@ -912,6 +913,7 @@ LESS.js files during generation.
|
||||
- [generator-jekyllized](https://github.com/sondr3/generator-jekyllized): A Yeoman generator for rapidly developing sites with Gulp. Live reload your site, automatically minify and optimize your assets and much more.
|
||||
- [Jekyll-Spotify](https://github.com/MertcanGokgoz/Jekyll-Spotify): Easily output Spotify Embed Player for jekyll
|
||||
- [jekyll-menus](https://github.com/forestryio/jekyll-menus): Hugo style menus for your Jekyll site... recursive menus included.
|
||||
- [jekyll-data](https://github.com/ashmaroli/jekyll-data): Read data files within Jekyll Theme Gems.
|
||||
|
||||
#### Editors
|
||||
|
||||
|
||||
@@ -510,9 +510,9 @@ numbers from the highlighted code.
|
||||
|
||||
### Link
|
||||
|
||||
If you would like to include a link to a collection's document, or a post
|
||||
the `link` tag will generate the correct permalink URL for the path you
|
||||
specify.
|
||||
If you want to include a link to a collection's document, a post, a page
|
||||
or a file the `link` tag will generate the correct permalink URL for the path
|
||||
you specify.
|
||||
|
||||
You must include the file extension when using the `link` tag.
|
||||
|
||||
@@ -520,6 +520,8 @@ You must include the file extension when using the `link` tag.
|
||||
{% raw %}
|
||||
{% link _collection/name-of-document.md %}
|
||||
{% link _posts/2016-07-26-name-of-post.md %}
|
||||
{% link news/index.html %}
|
||||
{% link /assets/files/doc.pdf %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
@@ -529,12 +531,11 @@ You can also use this tag to create a link in Markdown as follows:
|
||||
{% raw %}
|
||||
[Link to a document]({% link _collection/name-of-document.md %})
|
||||
[Link to a post]({% link _posts/2016-07-26-name-of-post.md %})
|
||||
[Link to a page]({% link news/index.html %})
|
||||
[Link to a file]({% link /assets/files/doc.pdf %})
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
Support for static files and pages is coming in a later release but is
|
||||
**not** released as of v3.2.1.
|
||||
|
||||
### Post URL
|
||||
|
||||
If you would like to include a link to a post on your site, the `post_url` tag
|
||||
|
||||
@@ -1 +1 @@
|
||||
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold}button,input{overflow:visible}button,select{text-transform:none}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:0.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
|
||||
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:0.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}
|
||||
|
||||
@@ -57,6 +57,20 @@ class TestFilters < JekyllUnitTest
|
||||
)
|
||||
end
|
||||
|
||||
should "markdownify with simple string in inline mode" do
|
||||
assert_equal(
|
||||
"one <em>simple</em> string",
|
||||
@filter.markdownify("one _simple_ string", :inline)
|
||||
)
|
||||
end
|
||||
|
||||
should "markdownify with multi-line string in inline mode" do
|
||||
assert_equal(
|
||||
"first line\nsecond line",
|
||||
@filter.markdownify("first line\n\nsecond line", :inline)
|
||||
)
|
||||
end
|
||||
|
||||
context "smartify filter" do
|
||||
should "convert quotes and typographic characters" do
|
||||
assert_equal(
|
||||
|
||||
Reference in New Issue
Block a user