mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
252 Commits
make-jekyl
...
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 | ||
|
|
5e93ca6353 | ||
|
|
8bac0559d1 | ||
|
|
b4393e2d36 | ||
|
|
dc554c2cd5 | ||
|
|
21cd382409 | ||
|
|
b37d18234a | ||
|
|
6f05ebb520 | ||
|
|
ed042de6c4 | ||
|
|
7c8c825f27 | ||
|
|
63e4e750ec | ||
|
|
6d1bc6c6ea | ||
|
|
c90d44d2be | ||
|
|
7133bddfb2 | ||
|
|
41d0ba66ea | ||
|
|
8ec7421c03 | ||
|
|
c61752a336 | ||
|
|
fcef78c4b6 | ||
|
|
6f2d1591fc | ||
|
|
f67dfb71fe | ||
|
|
3de78877c0 | ||
|
|
38f9e93a10 | ||
|
|
22a7714bba | ||
|
|
55257d2a14 | ||
|
|
275f5a6209 | ||
|
|
7ea610f8c0 | ||
|
|
d879840cc5 | ||
|
|
a945a65818 | ||
|
|
e27a65d9e3 | ||
|
|
01c33907a3 | ||
|
|
a138b02b10 | ||
|
|
761ddcae24 | ||
|
|
274d350d61 | ||
|
|
80ae013541 | ||
|
|
a0a351aa7a | ||
|
|
cff8f2994c | ||
|
|
aa901cdaba | ||
|
|
ef3f9d0e7a | ||
|
|
d716d9b7be | ||
|
|
5a31aacfbe | ||
|
|
7118999958 | ||
|
|
553fae8f17 | ||
|
|
459bc17019 | ||
|
|
f0574e047e | ||
|
|
b38ac5d938 | ||
|
|
feddd7daec | ||
|
|
1c7aa4729e | ||
|
|
54927d6522 | ||
|
|
91ef3a7cc9 | ||
|
|
69172bcc4a | ||
|
|
3d3f310a5e | ||
|
|
51695b2165 | ||
|
|
5b4269eca5 | ||
|
|
8e91263031 | ||
|
|
fd5f2eb399 | ||
|
|
682c0fc98f | ||
|
|
6847b604c8 | ||
|
|
b6d4ba56b7 | ||
|
|
9c197d9555 | ||
|
|
79b0f27bf6 | ||
|
|
0f70bb1320 | ||
|
|
d57b04782d | ||
|
|
2f5b7dc1dc | ||
|
|
8138e67ffb | ||
|
|
719c0938a5 | ||
|
|
93c7cdf0d0 | ||
|
|
06651c960a | ||
|
|
a920cf040b | ||
|
|
6c5a371b92 | ||
|
|
157c8e888e | ||
|
|
a69919ecbe | ||
|
|
6dbb5e2df1 | ||
|
|
c4ccfae3af | ||
|
|
481901b413 | ||
|
|
8321b14b29 | ||
|
|
81b16b24fc | ||
|
|
6b6ce3cf18 | ||
|
|
6366f56c21 | ||
|
|
5df8ef5717 | ||
|
|
d79ca534e4 | ||
|
|
5c55d95446 | ||
|
|
2b30c06140 | ||
|
|
fc6f7802a2 | ||
|
|
aebf711c61 | ||
|
|
bacb300876 | ||
|
|
3966a37d71 | ||
|
|
93c5f71faf | ||
|
|
59fa8549f9 | ||
|
|
db53213d16 | ||
|
|
9564782054 | ||
|
|
aaa062b047 | ||
|
|
8e027fced9 | ||
|
|
f277baa975 | ||
|
|
8197e17495 | ||
|
|
69937373bd | ||
|
|
0dc15dba88 | ||
|
|
fa96843555 | ||
|
|
6571ea0c1a | ||
|
|
992be253a6 | ||
|
|
081d7c016a | ||
|
|
2a02c798ac | ||
|
|
eab6752f52 | ||
|
|
aa86651650 | ||
|
|
ae27db62eb | ||
|
|
87c745573f | ||
|
|
25d4291d62 | ||
|
|
588b3a6649 | ||
|
|
99fc60e28c | ||
|
|
846ab94f43 | ||
|
|
3a7cbadd82 | ||
|
|
f3859384c0 | ||
|
|
ee84a95a38 | ||
|
|
9ae0a7023b | ||
|
|
1ac87eaae2 | ||
|
|
cfe61771e0 | ||
|
|
262be85c49 | ||
|
|
504411e476 | ||
|
|
650a3c7932 | ||
|
|
ad0f329d1c | ||
|
|
152fa877f6 | ||
|
|
3a45bf7d26 | ||
|
|
279f1516d2 | ||
|
|
29d8fee4ce | ||
|
|
950a37395f | ||
|
|
d8d42f6abc | ||
|
|
92dbe313e9 | ||
|
|
2eedf7d79c | ||
|
|
75d59911ae | ||
|
|
b78827cecb | ||
|
|
7309ecf8e1 | ||
|
|
3bfdc00d14 | ||
|
|
f2bfc832a0 | ||
|
|
054b23f69a | ||
|
|
0b94cf3fa1 | ||
|
|
1a11536a2c | ||
|
|
74baeb889a | ||
|
|
7a9427ccec | ||
|
|
5a1c5311f3 | ||
|
|
9aea71137e | ||
|
|
5a932c90b5 | ||
|
|
6d7f305e7c | ||
|
|
cf26bf5db0 | ||
|
|
87b9cfe2b5 | ||
|
|
13aec48137 | ||
|
|
b8f17b9034 | ||
|
|
562ffe7a3f | ||
|
|
c877d6f75c | ||
|
|
0233d93352 | ||
|
|
59b61c3f9f | ||
|
|
57fd5f887d | ||
|
|
4888b84b44 | ||
|
|
345f043cc4 | ||
|
|
566b42b8b3 | ||
|
|
55de780520 | ||
|
|
42725b1325 | ||
|
|
d86a293d78 | ||
|
|
a2e911c1b5 | ||
|
|
3e0363be4a | ||
|
|
aa2cfc81b7 | ||
|
|
a70abbeab5 | ||
|
|
8813173ba7 | ||
|
|
6ebdcdb198 | ||
|
|
9fd7e2c063 | ||
|
|
eefcbf5dde | ||
|
|
19f7a0b8fc | ||
|
|
c1e6f1fb94 | ||
|
|
9164973a6c | ||
|
|
f53a3b6272 | ||
|
|
dddafccb36 | ||
|
|
8c979ec565 | ||
|
|
3d38e8510c | ||
|
|
3840a38081 | ||
|
|
d632cdda68 | ||
|
|
57ab7c5f98 | ||
|
|
f0293def80 | ||
|
|
42b85bb82f | ||
|
|
b47db14f86 | ||
|
|
a666e6faee | ||
|
|
57b86ee77e | ||
|
|
9b09d8a8e8 | ||
|
|
63595f388d | ||
|
|
a9da814f17 | ||
|
|
349569592e | ||
|
|
23d7929948 | ||
|
|
0d8796fbe6 | ||
|
|
7892c5e1f3 | ||
|
|
326332a5d5 | ||
|
|
87c00b2756 | ||
|
|
596f5d1af3 | ||
|
|
f1f8319566 | ||
|
|
6167c09569 | ||
|
|
e0ce4a00f8 | ||
|
|
05445b81c7 | ||
|
|
82d6657ae8 | ||
|
|
73223f3a5a | ||
|
|
49e97ef9b0 | ||
|
|
0e8f204011 | ||
|
|
4effe25cc1 | ||
|
|
4c65772c44 | ||
|
|
764a2c1b39 | ||
|
|
487631e935 | ||
|
|
e823ac5180 | ||
|
|
c0dec091a2 | ||
|
|
36dc8c2169 |
14
.editorconfig
Normal file
14
.editorconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
11
.rubocop.yml
11
.rubocop.yml
@@ -6,6 +6,7 @@ AllCops:
|
||||
Exclude:
|
||||
- lib/jekyll/renderer.rb
|
||||
- bin/**/*
|
||||
- exe/**/*
|
||||
- benchmark/**/*
|
||||
- script/**/*
|
||||
- vendor/**/*
|
||||
@@ -16,14 +17,18 @@ Lint/UnreachableCode:
|
||||
Lint/UselessAccessModifier:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Max: 20
|
||||
Max: 21
|
||||
Metrics/BlockLength:
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
- lib/jekyll/configuration.rb
|
||||
Metrics/ClassLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
Max: 300
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 8
|
||||
Max: 9
|
||||
Metrics/LineLength:
|
||||
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
|
||||
|
||||
@@ -30,10 +30,6 @@ branches:
|
||||
- themes
|
||||
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- jordon@envygeeks.io
|
||||
|
||||
slack:
|
||||
secure: "\
|
||||
dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4Y\
|
||||
|
||||
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,14 +1,69 @@
|
||||
## 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
|
||||
|
||||
* Colorize interpolated output in logger.info (#5239)
|
||||
* Site template: exclude Gemfile and Gemfile.lock in site config (#5293)
|
||||
* Fix #5233: Increase our ability to detect Windows. (#5235)
|
||||
* update gitignore template to ignore theme gems built by user (#5326)
|
||||
* Adds ability to link to all files (#5199)
|
||||
* Exclude vendor by default (#5361)
|
||||
* Add ThemeAssetsReader which reads assets from a theme (#5364)
|
||||
* Add bundle install to jekyll new command (#5237)
|
||||
* Add absolute_url and relative_url filters. (#5399)
|
||||
* Site template: remove `css/` from new site scaffolding (#5402)
|
||||
* Site template: Move contents of the index.html page to the 'home' layout (#5420)
|
||||
* Exclude node_modules by default (#5210)
|
||||
* Run hooks in priority order. (#5157)
|
||||
* Add `static_file.name` and `.basename` Liquid attributes (#5264)
|
||||
* set site.url in dev environment to `http://localhost:4000` (#5431)
|
||||
* Add support for indented link references on excerpt (#5212)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Use jekyll-feed to generate the default site's RSS feed (#5196)
|
||||
* Site#configure_theme: do not set theme unless it's a string (#5189)
|
||||
* Convertible: set self.output in #render_all_layouts and #do_layout (#5337)
|
||||
* Only complain about `kramdown.coderay` if it is actually in the config (#5380)
|
||||
* Clarify documentation in theme gem's README template (#5376)
|
||||
* Allow underscore in highlighter language (#5375)
|
||||
* Site template: set empty url in config file by default (#5338)
|
||||
* Site template config: prepend 'jekyll serve' with 'bundle exec' (#5430)
|
||||
* Don't call `File.utime` for StaticFiles if it's a symlink (#5427)
|
||||
* Fix handling of non-ASCII characters in new `*_url` filters (#5410)
|
||||
* Remove autoload of Draft which no longer exists. (#5441)
|
||||
* Fix issue where Windows drive name is stripped from Jekyll.sanitized_path incorrectly (#5256)
|
||||
* Fix bug where `post_url` tag matched incorrect post with subdirectory (#4873)
|
||||
* Fix loading data from subdir with a period in name (#5433)
|
||||
* Revert Commands::Serve#server_address signature change. (#5456)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
@@ -37,6 +92,22 @@
|
||||
* Site: exclude README.md and .gitignore (#5304)
|
||||
* Add link to Staticman (#5224)
|
||||
* Update url for OpenShift (#5320)
|
||||
* [docs] add help for missing static_file e.g. on heroku (#5334)
|
||||
* Add a line about updating theme-gems in the docs (#5318)
|
||||
* Explain how to copy a theme's files (#5335)
|
||||
* [docs] .md as default extension in examples (#5316)
|
||||
* Fix small typo in docs (#5347)
|
||||
* Add missing period to sentence in first paragraph. (#5372)
|
||||
* added jekyll-spotify plugin (#5369)
|
||||
* Add jekyll-menus to the list of plugins. (#5397)
|
||||
* macOS and one grammar fix (#5403)
|
||||
* Add documentation for `relative_url` and `absolute_url` (#5405)
|
||||
* Bugfix on logo in JSON-LD (#5421)
|
||||
* Fix Travis.ci documentation (#5413)
|
||||
* [docs] Update documentation regarding `bundle install` after `jekyll new` (#5428)
|
||||
* Replace classic box-sizing reset with inheritance reset (#5411)
|
||||
* Update Wikipedia YAML list link (#5452)
|
||||
* Add Jekyll 3.3 release post (#5442)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
@@ -50,6 +121,12 @@
|
||||
* Execute jekyll from clone instead of defined binary when running 'script/default-site' (#5295)
|
||||
* rubocop: lib/jekyll/document.rb complexity fixes (#5045)
|
||||
* Proxy a number of Convertible methods to Renderer (#5308)
|
||||
* Run executable for Cucumber via Ruby instead of Shell (#5383)
|
||||
* Appease Rubocop (#5381)
|
||||
* remove features' directories on windows with proper access (#5389)
|
||||
* `site_configuration.feature`: use UTC format in timezone (#5416)
|
||||
* swallow bundle output from `jekyll new` while in CI (#5408)
|
||||
* Add .editorconfig (#5412)
|
||||
|
||||
## 3.2.1 / 2016-08-02
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env ruby
|
||||
STDOUT.sync = true
|
||||
|
||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w(.. lib)))
|
||||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
||||
|
||||
require "jekyll"
|
||||
require "mercenary"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -235,7 +235,7 @@ Feature: Hooks
|
||||
owner.output = "1 #{owner.output.chomp}"
|
||||
end
|
||||
Jekyll::Hooks.register :pages, :post_render, priority: :high do |owner|
|
||||
# high runs last
|
||||
# high runs first
|
||||
owner.output = "2 #{owner.output.chomp}"
|
||||
end
|
||||
Jekyll::Hooks.register :pages, :post_render do |owner|
|
||||
@@ -243,13 +243,13 @@ Feature: Hooks
|
||||
owner.output = "3 #{owner.output.chomp}"
|
||||
end
|
||||
Jekyll::Hooks.register :pages, :post_render, priority: :low do |owner|
|
||||
# low runs first
|
||||
# low runs last
|
||||
owner.output = "4 #{owner.output.chomp}"
|
||||
end
|
||||
"""
|
||||
And I have a "index.html" page that contains "WRAP ME"
|
||||
When I run jekyll build
|
||||
Then I should see "2 3 1 4 WRAP ME" in "_site/index.html"
|
||||
Then I should see "4 3 1 2 WRAP ME" in "_site/index.html"
|
||||
|
||||
Scenario: Alter a document right after it is initialized
|
||||
Given I have a _plugins directory
|
||||
|
||||
@@ -161,8 +161,8 @@ Feature: Site configuration
|
||||
And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
|
||||
And I have an "index.html" page with layout "page" that contains "site index page"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| timezone | America/New_York |
|
||||
| key | value |
|
||||
| timezone | UTC+04:00 |
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
@@ -181,8 +181,8 @@ Feature: Site configuration
|
||||
And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
|
||||
And I have an "index.html" page with layout "page" that contains "site index page"
|
||||
And I have a configuration file with:
|
||||
| key | value |
|
||||
| timezone | Pacific/Honolulu |
|
||||
| key | value |
|
||||
| timezone | UTC+10:00 |
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Before do
|
||||
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
|
||||
FileUtils.mkdir_p(Paths.test_dir) unless Paths.test_dir.directory?
|
||||
Dir.chdir(Paths.test_dir)
|
||||
end
|
||||
@@ -6,7 +7,7 @@ end
|
||||
#
|
||||
|
||||
After do
|
||||
Paths.test_dir.rmtree if Paths.test_dir.exist?
|
||||
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
|
||||
Paths.output_file.delete if Paths.output_file.exist?
|
||||
Paths.status_file.delete if Paths.status_file.exist?
|
||||
Dir.chdir(Paths.test_dir.parent)
|
||||
|
||||
@@ -90,7 +90,7 @@ end
|
||||
|
||||
def run_jekyll(args)
|
||||
args = args.strip.split(" ") # Shellwords?
|
||||
process = run_in_shell(Paths.jekyll_bin.to_s, *args, "--trace")
|
||||
process = run_in_shell("ruby", Paths.jekyll_bin.to_s, *args, "--trace")
|
||||
process.exitstatus.zero?
|
||||
end
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Feature: Writing themes
|
||||
Scenario: A theme with SCSS
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have a css directory
|
||||
And I have a "css/main.scss" page that contains "@import 'style';"
|
||||
And I have a "css/main.scss" page that contains "@import 'test-theme-black';"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
|
||||
@@ -38,4 +38,5 @@ Gem::Specification.new do |s|
|
||||
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-watch', '~> 1.1')
|
||||
s.add_runtime_dependency("pathutil", "~> 0.9")
|
||||
s.add_runtime_dependency('addressable', '~> 2.4')
|
||||
end
|
||||
|
||||
@@ -41,7 +41,6 @@ module Jekyll
|
||||
autoload :Convertible, "jekyll/convertible"
|
||||
autoload :Deprecator, "jekyll/deprecator"
|
||||
autoload :Document, "jekyll/document"
|
||||
autoload :Draft, "jekyll/draft"
|
||||
autoload :EntryFilter, "jekyll/entry_filter"
|
||||
autoload :Errors, "jekyll/errors"
|
||||
autoload :Excerpt, "jekyll/excerpt"
|
||||
@@ -55,6 +54,7 @@ module Jekyll
|
||||
autoload :PostReader, "jekyll/readers/post_reader"
|
||||
autoload :PageReader, "jekyll/readers/page_reader"
|
||||
autoload :StaticFileReader, "jekyll/readers/static_file_reader"
|
||||
autoload :ThemeAssetsReader, "jekyll/readers/theme_assets_reader"
|
||||
autoload :LogAdapter, "jekyll/log_adapter"
|
||||
autoload :Page, "jekyll/page"
|
||||
autoload :PluginManager, "jekyll/plugin_manager"
|
||||
@@ -160,11 +160,13 @@ module Jekyll
|
||||
|
||||
questionable_path.insert(0, "/") if questionable_path.start_with?("~")
|
||||
clean_path = File.expand_path(questionable_path, "/")
|
||||
clean_path.sub!(%r!\A\w:/!, "/")
|
||||
|
||||
if clean_path.start_with?(base_directory.sub(%r!\A\w:/!, "/"))
|
||||
return clean_path if clean_path.eql?(base_directory)
|
||||
|
||||
if clean_path.start_with?(base_directory.sub(%r!\z!, "/"))
|
||||
clean_path
|
||||
else
|
||||
clean_path.sub!(%r!\A\w:/!, "/")
|
||||
File.join(base_directory, clean_path)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -71,12 +71,23 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def watch(site, options)
|
||||
External.require_with_graceful_fail "jekyll-watch"
|
||||
watch_method = Jekyll::Watcher.method(:watch)
|
||||
if watch_method.parameters.size == 1
|
||||
watch_method.call(options)
|
||||
if Utils::Platforms.windows?
|
||||
Jekyll.logger.warn "", "--watch arg is unsupported on Windows. "
|
||||
Jekyll.logger.warn "", "If you are on Windows Bash, please see: " \
|
||||
"https://github.com/Microsoft/BashOnWindows/issues/216"
|
||||
|
||||
else
|
||||
watch_method.call(options, site)
|
||||
External.require_with_graceful_fail "jekyll-watch"
|
||||
watch_method = Jekyll::Watcher.method(:watch)
|
||||
if watch_method.parameters.size == 1
|
||||
watch_method.call(
|
||||
options
|
||||
)
|
||||
else
|
||||
watch_method.call(
|
||||
options, site
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end # end of class << self
|
||||
|
||||
@@ -11,6 +11,7 @@ module Jekyll
|
||||
|
||||
c.option "force", "--force", "Force creation even if PATH already exists"
|
||||
c.option "blank", "--blank", "Creates scaffolding but with empty files"
|
||||
c.option "skip-bundle", "--skip-bundle", "Skip 'bundle install'"
|
||||
|
||||
c.action do |args, options|
|
||||
Jekyll::Commands::New.process(args, options)
|
||||
@@ -34,7 +35,7 @@ module Jekyll
|
||||
create_site new_blog_path
|
||||
end
|
||||
|
||||
Jekyll.logger.info "New jekyll site installed in #{new_blog_path.cyan}."
|
||||
after_install(new_blog_path, options)
|
||||
end
|
||||
|
||||
def create_blank_site(path)
|
||||
@@ -73,7 +74,7 @@ ruby RUBY_VERSION
|
||||
gem "jekyll", "#{Jekyll::VERSION}"
|
||||
|
||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||
gem "minima"
|
||||
gem "minima", "~> 2.0"
|
||||
|
||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
||||
@@ -114,6 +115,31 @@ RUBY
|
||||
def scaffold_path
|
||||
"_posts/0000-00-00-welcome-to-jekyll.markdown.erb"
|
||||
end
|
||||
|
||||
# After a new blog has been created, print a success notification and
|
||||
# then automatically execute bundle install from within the new blog dir
|
||||
# unless the user opts to generate a blank blog or skip 'bundle install'.
|
||||
|
||||
def after_install(path, options = {})
|
||||
Jekyll.logger.info "New jekyll site installed in #{path.cyan}."
|
||||
Jekyll.logger.info "Bundle install skipped." if options["skip-bundle"]
|
||||
|
||||
unless options["blank"] || options["skip-bundle"]
|
||||
bundle_install path
|
||||
end
|
||||
end
|
||||
|
||||
def bundle_install(path)
|
||||
Jekyll::External.require_with_graceful_fail "bundler"
|
||||
Jekyll.logger.info "Running bundle install in #{path.cyan}..."
|
||||
Dir.chdir(path) do
|
||||
if ENV["CI"]
|
||||
system("bundle", "install", "--quiet")
|
||||
else
|
||||
system("bundle", "install")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,6 +33,7 @@ module Jekyll
|
||||
opts["serving"] = true
|
||||
opts["watch" ] = true unless opts.key?("watch")
|
||||
config = opts["config"]
|
||||
opts["url"] = default_url(opts) if Jekyll.env == "development"
|
||||
Build.process(opts)
|
||||
opts["config"] = config
|
||||
Serve.process(opts)
|
||||
@@ -47,11 +48,7 @@ module Jekyll
|
||||
destination = opts["destination"]
|
||||
setup(destination)
|
||||
|
||||
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
||||
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
||||
Jekyll.logger.info "Server address:", server_address(server, opts)
|
||||
launch_browser server, opts if opts["open_url"]
|
||||
boot_or_detach server, opts
|
||||
start_up_webrick(opts, destination)
|
||||
end
|
||||
|
||||
# Do a base pre-setup of WEBRick so that everything is in place
|
||||
@@ -101,6 +98,17 @@ module Jekyll
|
||||
opts
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def start_up_webrick(opts, destination)
|
||||
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
|
||||
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
|
||||
Jekyll.logger.info "Server address:", server_address(server, opts)
|
||||
launch_browser server, opts if opts["open_url"]
|
||||
boot_or_detach server, opts
|
||||
end
|
||||
|
||||
# Recreate NondisclosureName under utf-8 circumstance
|
||||
|
||||
private
|
||||
@@ -116,17 +124,39 @@ module Jekyll
|
||||
#
|
||||
|
||||
private
|
||||
def server_address(server, opts)
|
||||
def server_address(server, options = {})
|
||||
format_url(
|
||||
server.config[:SSLEnable],
|
||||
server.config[:BindAddress],
|
||||
server.config[:Port],
|
||||
options["baseurl"]
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
def format_url(ssl_enabled, address, port, baseurl = nil)
|
||||
format("%{prefix}://%{address}:%{port}%{baseurl}", {
|
||||
:prefix => server.config[:SSLEnable] ? "https" : "http",
|
||||
:baseurl => opts["baseurl"] ? "#{opts["baseurl"]}/" : "",
|
||||
:address => server.config[:BindAddress],
|
||||
:port => server.config[:Port]
|
||||
:prefix => ssl_enabled ? "https" : "http",
|
||||
:address => address,
|
||||
:port => port,
|
||||
:baseurl => baseurl ? "#{baseurl}/" : ""
|
||||
})
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def default_url(opts)
|
||||
config = configuration_from_options(opts)
|
||||
format_url(
|
||||
config["ssl_cert"] && config["ssl_key"],
|
||||
config["host"] == "127.0.0.1" ? "localhost" : config["host"],
|
||||
config["port"]
|
||||
)
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def launch_browser(server, opts)
|
||||
address = server_address(server, opts)
|
||||
|
||||
@@ -17,7 +17,7 @@ module Jekyll
|
||||
# Handling Reading
|
||||
"safe" => false,
|
||||
"include" => [".htaccess"],
|
||||
"exclude" => [],
|
||||
"exclude" => %w(node_modules vendor),
|
||||
"keep_files" => [".git", ".svn"],
|
||||
"encoding" => "utf-8",
|
||||
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
|
||||
|
||||
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
|
||||
@@ -104,7 +104,7 @@ module Jekyll
|
||||
|
||||
private
|
||||
def modernize_coderay_config
|
||||
if highlighter == "coderay"
|
||||
unless @config["coderay"].empty?
|
||||
Jekyll::Deprecator.deprecation_message(
|
||||
"You are using 'kramdown.coderay' in your configuration, " \
|
||||
"please use 'syntax_highlighter_opts' instead."
|
||||
|
||||
@@ -193,7 +193,7 @@ module Jekyll
|
||||
# Returns nothing
|
||||
def render_all_layouts(layouts, payload, info)
|
||||
_renderer.layouts = layouts
|
||||
_renderer.place_in_layouts(output, payload, info)
|
||||
self.output = _renderer.place_in_layouts(output, payload, info)
|
||||
ensure
|
||||
@_renderer = nil # this will allow the modifications above to disappear
|
||||
end
|
||||
@@ -205,11 +205,10 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def do_layout(payload, layouts)
|
||||
_renderer.tap do |renderer|
|
||||
self.output = _renderer.tap do |renderer|
|
||||
renderer.layouts = layouts
|
||||
renderer.payload = payload
|
||||
renderer.run
|
||||
end
|
||||
end.run
|
||||
|
||||
Jekyll.logger.debug "Post-Render Hooks:", self.relative_path
|
||||
Jekyll::Hooks.trigger hook_owner, :post_render, self
|
||||
|
||||
@@ -118,7 +118,7 @@ module Jekyll
|
||||
if tail.empty?
|
||||
head
|
||||
else
|
||||
"" << head << "\n\n" << tail.scan(%r!^\[[^\]]+\]:.+$!).join("\n")
|
||||
"" << head << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,16 +3,23 @@ require "json"
|
||||
require "date"
|
||||
require "liquid"
|
||||
|
||||
require_all "jekyll/filters"
|
||||
|
||||
module Jekyll
|
||||
module Filters
|
||||
include URLFilters
|
||||
# Convert a Markdown string into HTML output.
|
||||
#
|
||||
# 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
|
||||
|
||||
|
||||
40
lib/jekyll/filters/url_filters.rb
Normal file
40
lib/jekyll/filters/url_filters.rb
Normal file
@@ -0,0 +1,40 @@
|
||||
require "addressable/uri"
|
||||
|
||||
module Jekyll
|
||||
module Filters
|
||||
module URLFilters
|
||||
# Produces an absolute URL based on site.url and site.baseurl.
|
||||
#
|
||||
# input - the URL to make absolute.
|
||||
#
|
||||
# Returns the absolute URL as a String.
|
||||
def absolute_url(input)
|
||||
return if input.nil?
|
||||
site = @context.registers[:site]
|
||||
return relative_url(input).to_s if site.config["url"].nil?
|
||||
Addressable::URI.parse(site.config["url"] + relative_url(input)).normalize.to_s
|
||||
end
|
||||
|
||||
# Produces a URL relative to the domain root based on site.baseurl.
|
||||
#
|
||||
# input - the URL to make relative to the domain root
|
||||
#
|
||||
# Returns a URL relative to the domain root as a String.
|
||||
def relative_url(input)
|
||||
return if input.nil?
|
||||
site = @context.registers[:site]
|
||||
return ensure_leading_slash(input.to_s) if site.config["baseurl"].nil?
|
||||
Addressable::URI.parse(
|
||||
ensure_leading_slash(site.config["baseurl"]) + ensure_leading_slash(input.to_s)
|
||||
).normalize.to_s
|
||||
end
|
||||
|
||||
private
|
||||
def ensure_leading_slash(input)
|
||||
return input if input.nil? || input.empty? || input.start_with?("/")
|
||||
"/#{input}"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
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
|
||||
|
||||
@@ -54,7 +54,7 @@ module Jekyll
|
||||
|
||||
# Ensure the priority is a Fixnum
|
||||
def self.priority_value(priority)
|
||||
return priority if priority.is_a?(Fixnum)
|
||||
return priority if priority.is_a?(Integer)
|
||||
PRIORITY_MAP[priority] || DEFAULT_PRIORITY
|
||||
end
|
||||
|
||||
@@ -80,7 +80,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def self.insert_hook(owner, event, priority, &block)
|
||||
@hook_priority[block] = "#{priority}.#{@hook_priority.size}".to_f
|
||||
@hook_priority[block] = [-priority, @hook_priority.size]
|
||||
@registry[owner][event] << block
|
||||
end
|
||||
|
||||
|
||||
@@ -40,7 +40,11 @@ module Jekyll
|
||||
@base = base
|
||||
@dir = dir
|
||||
@name = name
|
||||
@path = site.in_source_dir(base, dir, name)
|
||||
@path = if site.in_theme_dir(base) == base # we're in a theme
|
||||
site.in_theme_dir(base, dir, name)
|
||||
else
|
||||
site.in_source_dir(base, dir, name)
|
||||
end
|
||||
|
||||
process(name)
|
||||
read_yaml(File.join(base, dir), name)
|
||||
|
||||
@@ -18,6 +18,7 @@ module Jekyll
|
||||
sort_files!
|
||||
@site.data = DataReader.new(site).read(site.config["data_dir"])
|
||||
CollectionReader.new(site).read
|
||||
ThemeAssetsReader.new(site).read
|
||||
end
|
||||
|
||||
# Sorts posts, pages, and static files.
|
||||
|
||||
@@ -37,10 +37,10 @@ module Jekyll
|
||||
path = @site.in_source_dir(dir, entry)
|
||||
next if @entry_filter.symlink?(path)
|
||||
|
||||
key = sanitize_filename(File.basename(entry, ".*"))
|
||||
if File.directory?(path)
|
||||
read_data_to(path, data[key] = {})
|
||||
read_data_to(path, data[sanitize_filename(entry)] = {})
|
||||
else
|
||||
key = sanitize_filename(File.basename(entry, ".*"))
|
||||
data[key] = read_data_file(path)
|
||||
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
|
||||
|
||||
47
lib/jekyll/readers/theme_assets_reader.rb
Normal file
47
lib/jekyll/readers/theme_assets_reader.rb
Normal file
@@ -0,0 +1,47 @@
|
||||
module Jekyll
|
||||
class ThemeAssetsReader
|
||||
attr_reader :site
|
||||
def initialize(site)
|
||||
@site = site
|
||||
end
|
||||
|
||||
def read
|
||||
return unless site.theme && site.theme.assets_path
|
||||
|
||||
Find.find(site.theme.assets_path) do |path|
|
||||
next if File.directory?(path)
|
||||
if File.symlink?(path)
|
||||
Jekyll.logger.warn "Theme reader:", "Ignored symlinked asset: #{path}"
|
||||
else
|
||||
read_theme_asset(path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def read_theme_asset(path)
|
||||
base = site.theme.root
|
||||
dir = File.dirname(path.sub("#{site.theme.root}/", ""))
|
||||
name = File.basename(path)
|
||||
|
||||
if Utils.has_yaml_header?(path)
|
||||
append_unless_exists site.pages,
|
||||
Jekyll::Page.new(site, base, dir, name)
|
||||
else
|
||||
append_unless_exists site.static_files,
|
||||
Jekyll::StaticFile.new(site, base, dir, name)
|
||||
end
|
||||
end
|
||||
|
||||
def append_unless_exists(haystack, new_item)
|
||||
if haystack.any? { |file| file.relative_path == new_item.relative_path }
|
||||
Jekyll.logger.debug "Theme:",
|
||||
"Ignoring #{new_item.relative_path} in theme due to existing file " \
|
||||
"with that path in site."
|
||||
return
|
||||
end
|
||||
|
||||
haystack << new_item
|
||||
end
|
||||
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.
|
||||
#
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Jekyll
|
||||
class StaticFile
|
||||
attr_reader :relative_path, :extname
|
||||
attr_reader :relative_path, :extname, :name
|
||||
|
||||
class << self
|
||||
# The cache of last modification times [path] -> mtime.
|
||||
@@ -97,6 +97,8 @@ module Jekyll
|
||||
|
||||
def to_liquid
|
||||
{
|
||||
"basename" => File.basename(name, extname),
|
||||
"name" => name,
|
||||
"extname" => extname,
|
||||
"modified_time" => modified_time,
|
||||
"path" => File.join("", relative_path)
|
||||
@@ -146,7 +148,10 @@ module Jekyll
|
||||
else
|
||||
FileUtils.copy_entry(path, dest_path)
|
||||
end
|
||||
File.utime(self.class.mtimes[path], self.class.mtimes[path], dest_path)
|
||||
|
||||
unless File.symlink?(dest_path)
|
||||
File.utime(self.class.mtimes[path], self.class.mtimes[path], dest_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ module Jekyll
|
||||
# forms: name, name=value, or name="<quoted list>"
|
||||
#
|
||||
# <quoted list> is a space-separated list of numbers
|
||||
SYNTAX = %r!^([a-zA-Z0-9.+#-]+)((\s+\w+(=(\w+|"([0-9]+\s)*[0-9]+"))?)*)$!
|
||||
SYNTAX = %r!^([a-zA-Z0-9.+#_-]+)((\s+\w+(=(\w+|"([0-9]+\s)*[0-9]+"))?)*)$!
|
||||
|
||||
def initialize(tag_name, markup, tokens)
|
||||
super
|
||||
|
||||
@@ -16,8 +16,10 @@ module Jekyll
|
||||
def render(context)
|
||||
site = context.registers[:site]
|
||||
|
||||
site.docs_to_write.each do |document|
|
||||
return document.url if document.relative_path == @relative_path
|
||||
site.each_site_file do |item|
|
||||
return item.url if item.relative_path == @relative_path
|
||||
# This takes care of the case for static files that have a leading /
|
||||
return item.url if item.relative_path == "/#{@relative_path}"
|
||||
end
|
||||
|
||||
raise ArgumentError, <<eos
|
||||
|
||||
@@ -14,7 +14,8 @@ module Jekyll
|
||||
"'#{name}' does not contain valid date and/or title."
|
||||
end
|
||||
|
||||
@name_regex = %r!^#{path}#{date}-#{slug}\.[^.]+!
|
||||
@name_regex = %r!^_posts/#{path}#{date}-#{slug}\.[^.]+|
|
||||
^#{path}_posts/?#{date}-#{slug}\.[^.]+!x
|
||||
end
|
||||
|
||||
def post_date
|
||||
@@ -23,7 +24,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
other.basename.match(@name_regex)
|
||||
other.relative_path.match(@name_regex)
|
||||
end
|
||||
|
||||
def deprecated_equality(other)
|
||||
|
||||
@@ -18,15 +18,19 @@ module Jekyll
|
||||
end
|
||||
|
||||
def includes_path
|
||||
path_for :includes
|
||||
path_for "_includes".freeze
|
||||
end
|
||||
|
||||
def layouts_path
|
||||
path_for :layouts
|
||||
path_for "_layouts".freeze
|
||||
end
|
||||
|
||||
def sass_path
|
||||
path_for :sass
|
||||
path_for "_sass".freeze
|
||||
end
|
||||
|
||||
def assets_path
|
||||
path_for "assets".freeze
|
||||
end
|
||||
|
||||
def configure_sass
|
||||
@@ -43,7 +47,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def realpath_for(folder)
|
||||
File.realpath(Jekyll.sanitized_path(root, "_#{folder}"))
|
||||
File.realpath(Jekyll.sanitized_path(root, folder.to_s))
|
||||
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
|
||||
nil
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Jekyll::ThemeBuilder
|
||||
SCAFFOLD_DIRECTORIES = %w(
|
||||
_layouts _includes _sass
|
||||
assets _layouts _includes _sass
|
||||
).freeze
|
||||
|
||||
attr_reader :name, :path, :code_of_conduct
|
||||
|
||||
@@ -6,10 +6,11 @@ module Jekyll
|
||||
autoload :Ansi, "jekyll/utils/ansi"
|
||||
|
||||
# Constants for use in #slugify
|
||||
SLUGIFY_MODES = %w(raw default pretty).freeze
|
||||
SLUGIFY_MODES = %w(raw default pretty ascii).freeze
|
||||
SLUGIFY_RAW_REGEXP = Regexp.new('\\s+').freeze
|
||||
SLUGIFY_DEFAULT_REGEXP = Regexp.new("[^[:alnum:]]+").freeze
|
||||
SLUGIFY_PRETTY_REGEXP = Regexp.new("[^[:alnum:]._~!$&'()+,;=@]+").freeze
|
||||
SLUGIFY_ASCII_REGEXP = Regexp.new("[^[A-Za-z0-9]]+").freeze
|
||||
|
||||
# Takes an indented string and removes the preceding spaces on each line
|
||||
|
||||
@@ -160,6 +161,9 @@ module Jekyll
|
||||
# When mode is "pretty", some non-alphabetic characters (._~!$&'()+,;=@)
|
||||
# are not replaced with hyphen.
|
||||
#
|
||||
# When mode is "ascii", some everything else except ASCII characters
|
||||
# a-z (lowercase), A-Z (uppercase) and 0-9 (numbers) are not replaced with hyphen.
|
||||
#
|
||||
# If cased is true, all uppercase letters in the result string are
|
||||
# replaced with their lowercase counterparts.
|
||||
#
|
||||
@@ -173,6 +177,9 @@ module Jekyll
|
||||
# slugify("The _config.yml file", "pretty", true)
|
||||
# # => "The-_config.yml file"
|
||||
#
|
||||
# slugify("The _config.yml file", "ascii")
|
||||
# # => "the-config.yml-file"
|
||||
#
|
||||
# Returns the slugified string.
|
||||
def slugify(string, mode: nil, cased: false)
|
||||
mode ||= "default"
|
||||
@@ -193,6 +200,11 @@ module Jekyll
|
||||
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
||||
# and is allowed in both extN and NTFS.
|
||||
SLUGIFY_PRETTY_REGEXP
|
||||
when "ascii"
|
||||
# For web servers not being able to handle Unicode, the safe
|
||||
# method is to ditch anything else but latin letters and numeric
|
||||
# digits.
|
||||
SLUGIFY_ASCII_REGEXP
|
||||
end
|
||||
|
||||
# Strip according to the mode
|
||||
|
||||
@@ -13,18 +13,55 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
# --
|
||||
# Allows you to detect "real" Windows, or what we would consider
|
||||
# "real" Windows. That is, that we can pass the basic test and the
|
||||
# /proc/version returns nothing to us.
|
||||
# --
|
||||
|
||||
def really_windows?
|
||||
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
|
||||
!proc_version
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def windows?
|
||||
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i || \
|
||||
proc_version =~ %r!microsoft!i
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def linux?
|
||||
RbConfig::CONFIG["host_os"] =~ %r!linux! && \
|
||||
proc_version !~ %r!microsoft!i
|
||||
end
|
||||
|
||||
# Provides windows?, linux?, osx?, unix? so that we can detect
|
||||
# platforms. This is mostly useful for `jekyll doctor` and for testing
|
||||
# where we kick off certain tests based on the platform.
|
||||
|
||||
{ :windows? => %r!mswin|mingw|cygwin!, :linux? => %r!linux!, \
|
||||
:osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
|
||||
{ :osx? => %r!darwin|mac os!, :unix? => %r!solaris|bsd! }.each do |k, v|
|
||||
define_method k do
|
||||
!!(
|
||||
RbConfig::CONFIG["host_os"] =~ v
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def proc_version
|
||||
@cached_proc_version ||= begin
|
||||
Pathutil.new(
|
||||
"/proc/version"
|
||||
).read
|
||||
rescue Errno::ENOENT
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Jekyll
|
||||
VERSION = "3.2.1".freeze
|
||||
VERSION = "3.3.0".freeze
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# feature for the data you need to update frequently.
|
||||
#
|
||||
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
||||
# 'jekyll serve'. If you change this file, please restart the server process.
|
||||
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
|
||||
|
||||
# Site settings
|
||||
# These are used to personalize your new site. If you look in the HTML files,
|
||||
@@ -20,7 +20,7 @@ description: > # this means to ignore newlines until "baseurl:"
|
||||
line in _config.yml. It will appear in your document head meta (for
|
||||
Google search results) and in your feed.xml site description.
|
||||
baseurl: "" # the subpath of your site, e.g. /blog
|
||||
url: "http://example.com" # the base hostname & protocol for your site
|
||||
url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
||||
twitter_username: jekyllrb
|
||||
github_username: jekyll
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
# Only the main Sass file needs front matter (the dashes are enough)
|
||||
---
|
||||
@charset "utf-8";
|
||||
|
||||
// Our variables
|
||||
$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
$base-font-size: 16px;
|
||||
$base-font-weight: 400;
|
||||
$small-font-size: $base-font-size * 0.875;
|
||||
$base-line-height: 1.5;
|
||||
|
||||
$spacing-unit: 30px;
|
||||
|
||||
$text-color: #111;
|
||||
$background-color: #fdfdfd;
|
||||
$brand-color: #2a7ae2;
|
||||
|
||||
$grey-color: #828282;
|
||||
$grey-color-light: lighten($grey-color, 40%);
|
||||
$grey-color-dark: darken($grey-color, 25%);
|
||||
|
||||
// Width of the content area
|
||||
$content-width: 800px;
|
||||
|
||||
$on-palm: 600px;
|
||||
$on-laptop: 800px;
|
||||
|
||||
// Minima also includes a mixin for defining media queries.
|
||||
// Use media queries like this:
|
||||
// @include media-query($on-palm) {
|
||||
// .wrapper {
|
||||
// padding-right: $spacing-unit / 2;
|
||||
// padding-left: $spacing-unit / 2;
|
||||
// }
|
||||
// }
|
||||
|
||||
// Import partials from the `minima` theme.
|
||||
@import "minima";
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
<div class="home">
|
||||
|
||||
<h1 class="page-heading">Posts</h1>
|
||||
|
||||
<ul class="post-list">
|
||||
{% for post in site.posts %}
|
||||
<li>
|
||||
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
|
||||
|
||||
<h2>
|
||||
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title | escape }}</a>
|
||||
</h2>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
|
||||
|
||||
</div>
|
||||
6
lib/site_template/index.md
Normal file
6
lib/site_template/index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# You don't need to edit this file, it's empty on purpose.
|
||||
# Edit theme's home layout instead if you wanna make some changes
|
||||
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
|
||||
layout: home
|
||||
---
|
||||
@@ -12,7 +12,7 @@ Add this line to your Jekyll site's Gemfile:
|
||||
gem <%= theme_name.inspect %>
|
||||
```
|
||||
|
||||
And add this line to your Jekyll site:
|
||||
And add this line to your Jekyll site's `_config.yml`:
|
||||
|
||||
```yaml
|
||||
theme: <%= theme_name %>
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
*.gem
|
||||
.bundle
|
||||
.sass-cache
|
||||
_site
|
||||
|
||||
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
||||
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
||||
spec.license = "MIT"
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(<%= theme_directories.join("|") %>|LICENSE|README)/i}) }
|
||||
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(<%= theme_directories.join("|") %>|LICENSE|README)}i) }
|
||||
|
||||
spec.add_development_dependency "jekyll", "~> <%= jekyll_version_with_minor %>"
|
||||
spec.add_development_dependency "bundler", "~> 1.12"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -22,7 +22,7 @@ url: https://jekyllrb.com
|
||||
twitter:
|
||||
username: jekyllrb
|
||||
|
||||
logo: img/logo-2x.png
|
||||
logo: /img/logo-2x.png
|
||||
|
||||
gems:
|
||||
- jekyll-feed
|
||||
|
||||
@@ -594,7 +594,7 @@ collections:
|
||||
# Handling Reading
|
||||
safe: false
|
||||
include: [".htaccess"]
|
||||
exclude: []
|
||||
exclude: ["node_modules", "vendor"]
|
||||
keep_files: [".git", ".svn"]
|
||||
encoding: "utf-8"
|
||||
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
|
||||
|
||||
@@ -94,7 +94,7 @@ Your `.travis.yml` file should look like this:
|
||||
```yaml
|
||||
language: ruby
|
||||
rvm:
|
||||
- 2.1
|
||||
- 2.2.5
|
||||
|
||||
before_script:
|
||||
- chmod +x ./script/cibuild # or do this locally and commit
|
||||
@@ -127,7 +127,7 @@ access to Bundler, RubyGems, and a Ruby runtime.
|
||||
|
||||
```yaml
|
||||
rvm:
|
||||
- 2.1
|
||||
- 2.2.5
|
||||
```
|
||||
|
||||
RVM is a popular Ruby Version Manager (like rbenv, chruby, etc). This
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ These are available out-of-the-box to be used in the front matter for a post.
|
||||
more categories that the post belongs to. When the site is generated
|
||||
the post will act as though it had been set with these categories
|
||||
normally. Categories (plural key) can be specified as a <a
|
||||
href="https://en.wikipedia.org/wiki/YAML#Lists">YAML list</a> or a
|
||||
href="https://en.wikipedia.org/wiki/YAML#Basic_components">YAML list</a> or a
|
||||
comma-separated string.
|
||||
|
||||
</p>
|
||||
@@ -170,7 +170,8 @@ These are available out-of-the-box to be used in the front matter for a post.
|
||||
<p>
|
||||
|
||||
Similar to categories, one or multiple tags can be added to a post.
|
||||
Also like categories, tags can be specified as a YAML list or a
|
||||
Also like categories, tags can be specified as a <a
|
||||
href="https://en.wikipedia.org/wiki/YAML#Basic_components">YAML list</a> or a
|
||||
comma-separated string.
|
||||
|
||||
</p>
|
||||
|
||||
@@ -5,6 +5,114 @@ permalink: "/docs/history/"
|
||||
note: This file is autogenerated. Edit /History.markdown instead.
|
||||
---
|
||||
|
||||
## 3.3.0 / 2016-10-06
|
||||
{: #v3-3-0}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v3-3-0}
|
||||
|
||||
- Colorize interpolated output in logger.info ([#5239]({{ site.repository }}/issues/5239))
|
||||
- Site template: exclude Gemfile and Gemfile.lock in site config ([#5293]({{ site.repository }}/issues/5293))
|
||||
- Fix [#5233]({{ site.repository }}/issues/5233): Increase our ability to detect Windows. ([#5235]({{ site.repository }}/issues/5235))
|
||||
- update gitignore template to ignore theme gems built by user ([#5326]({{ site.repository }}/issues/5326))
|
||||
- Adds ability to link to all files ([#5199]({{ site.repository }}/issues/5199))
|
||||
- Exclude vendor by default ([#5361]({{ site.repository }}/issues/5361))
|
||||
- Add ThemeAssetsReader which reads assets from a theme ([#5364]({{ site.repository }}/issues/5364))
|
||||
- Add bundle install to jekyll new command ([#5237]({{ site.repository }}/issues/5237))
|
||||
- Add absolute_url and relative_url filters. ([#5399]({{ site.repository }}/issues/5399))
|
||||
- Site template: remove `css/` from new site scaffolding ([#5402]({{ site.repository }}/issues/5402))
|
||||
- Site template: Move contents of the index.html page to the 'home' layout ([#5420]({{ site.repository }}/issues/5420))
|
||||
- Exclude node_modules by default ([#5210]({{ site.repository }}/issues/5210))
|
||||
- Run hooks in priority order. ([#5157]({{ site.repository }}/issues/5157))
|
||||
- Add `static_file.name` and `.basename` Liquid attributes ([#5264]({{ site.repository }}/issues/5264))
|
||||
- set site.url in dev environment to `http://localhost:4000` ([#5431]({{ site.repository }}/issues/5431))
|
||||
- Add support for indented link references on excerpt ([#5212]({{ site.repository }}/issues/5212))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-3-0}
|
||||
|
||||
- Use jekyll-feed to generate the default site's RSS feed ([#5196]({{ site.repository }}/issues/5196))
|
||||
- Site#configure_theme: do not set theme unless it's a string ([#5189]({{ site.repository }}/issues/5189))
|
||||
- Convertible: set self.output in #render_all_layouts and #do_layout ([#5337]({{ site.repository }}/issues/5337))
|
||||
- Only complain about `kramdown.coderay` if it is actually in the config ([#5380]({{ site.repository }}/issues/5380))
|
||||
- Clarify documentation in theme gem's README template ([#5376]({{ site.repository }}/issues/5376))
|
||||
- Allow underscore in highlighter language ([#5375]({{ site.repository }}/issues/5375))
|
||||
- Site template: set empty url in config file by default ([#5338]({{ site.repository }}/issues/5338))
|
||||
- Site template config: prepend 'jekyll serve' with 'bundle exec' ([#5430]({{ site.repository }}/issues/5430))
|
||||
- Don't call `File.utime` for StaticFiles if it's a symlink ([#5427]({{ site.repository }}/issues/5427))
|
||||
- Fix handling of non-ASCII characters in new `*_url` filters ([#5410]({{ site.repository }}/issues/5410))
|
||||
- Remove autoload of Draft which no longer exists. ([#5441]({{ site.repository }}/issues/5441))
|
||||
- Fix issue where Windows drive name is stripped from Jekyll.sanitized_path incorrectly ([#5256]({{ site.repository }}/issues/5256))
|
||||
- Fix bug where `post_url` tag matched incorrect post with subdirectory ([#4873]({{ site.repository }}/issues/4873))
|
||||
- Fix loading data from subdir with a period in name ([#5433]({{ site.repository }}/issues/5433))
|
||||
- Revert Commands::Serve#server_address signature change. ([#5456]({{ site.repository }}/issues/5456))
|
||||
|
||||
### Site Enhancements
|
||||
{: #site-enhancements-v3-3-0}
|
||||
|
||||
- Document `to_integer` and `inspect` filters ([#5185]({{ site.repository }}/issues/5185))
|
||||
- Fix path in the prompt ([#5194]({{ site.repository }}/issues/5194))
|
||||
- need subcommand build ([#5190]({{ site.repository }}/issues/5190))
|
||||
- Add the Jekyll Cloudinary plugin ([#5183]({{ site.repository }}/issues/5183))
|
||||
- Documentation : `new-theme` command ([#5205]({{ site.repository }}/issues/5205))
|
||||
- Document `link` Liquid tag ([#5182]({{ site.repository }}/issues/5182))
|
||||
- Remove mention of page for link tag in release post ([#5214]({{ site.repository }}/issues/5214))
|
||||
- fixed typo ([#5226]({{ site.repository }}/issues/5226))
|
||||
- Add missing comma ([#5222]({{ site.repository }}/issues/5222))
|
||||
- Maintain aspect ratio with `height: auto;` ([#5254]({{ site.repository }}/issues/5254))
|
||||
- Fix a link in deployment-methods.md ([#5244]({{ site.repository }}/issues/5244))
|
||||
- Documentation: improve highlight in `Creating a theme` ([#5249]({{ site.repository }}/issues/5249))
|
||||
- Bundler isn't installed by default ([#5258]({{ site.repository }}/issues/5258))
|
||||
- Update troubleshooting documentation to include fix for issue with vendored gems ([#5271]({{ site.repository }}/issues/5271))
|
||||
- Link `--lsi` option's description to Wikipedia docs on LSI ([#5274]({{ site.repository }}/issues/5274))
|
||||
- Document `--profile` option on the configuration page ([#5279]({{ site.repository }}/issues/5279))
|
||||
- Update homepage to sync with merge of [#5258]({{ site.repository }}/issues/5258) ([#5287]({{ site.repository }}/issues/5287))
|
||||
- Add post about Jekyll Admin initial release ([#5291]({{ site.repository }}/issues/5291))
|
||||
- Replace liquid highlight tag with backticks ([#5262]({{ site.repository }}/issues/5262))
|
||||
- Word update ([#5294]({{ site.repository }}/issues/5294))
|
||||
- Site documentation section links always point to https://jekyllrb.com ([#5281]({{ site.repository }}/issues/5281))
|
||||
- Missing `:site, :post_render` payload documentation on site ([#5280]({{ site.repository }}/issues/5280))
|
||||
- Site: exclude README.md and .gitignore ([#5304]({{ site.repository }}/issues/5304))
|
||||
- Add link to Staticman ([#5224]({{ site.repository }}/issues/5224))
|
||||
- Update url for OpenShift ([#5320]({{ site.repository }}/issues/5320))
|
||||
- [docs] add help for missing static_file e.g. on heroku ([#5334]({{ site.repository }}/issues/5334))
|
||||
- Add a line about updating theme-gems in the docs ([#5318]({{ site.repository }}/issues/5318))
|
||||
- Explain how to copy a theme's files ([#5335]({{ site.repository }}/issues/5335))
|
||||
- [docs] .md as default extension in examples ([#5316]({{ site.repository }}/issues/5316))
|
||||
- Fix small typo in docs ([#5347]({{ site.repository }}/issues/5347))
|
||||
- Add missing period to sentence in first paragraph. ([#5372]({{ site.repository }}/issues/5372))
|
||||
- added jekyll-spotify plugin ([#5369]({{ site.repository }}/issues/5369))
|
||||
- Add jekyll-menus to the list of plugins. ([#5397]({{ site.repository }}/issues/5397))
|
||||
- macOS and one grammar fix ([#5403]({{ site.repository }}/issues/5403))
|
||||
- Add documentation for `relative_url` and `absolute_url` ([#5405]({{ site.repository }}/issues/5405))
|
||||
- Bugfix on logo in JSON-LD ([#5421]({{ site.repository }}/issues/5421))
|
||||
- Fix Travis.ci documentation ([#5413]({{ site.repository }}/issues/5413))
|
||||
- [docs] Update documentation regarding `bundle install` after `jekyll new` ([#5428]({{ site.repository }}/issues/5428))
|
||||
- Replace classic box-sizing reset with inheritance reset ([#5411]({{ site.repository }}/issues/5411))
|
||||
- Update Wikipedia YAML list link ([#5452]({{ site.repository }}/issues/5452))
|
||||
- Add Jekyll 3.3 release post ([#5442]({{ site.repository }}/issues/5442))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v3-3-0}
|
||||
|
||||
- Update appveyor.yml and fix optional deps for Ruby x64 ([#5180]({{ site.repository }}/issues/5180))
|
||||
- Improve tests for Jekyll::PluginManager ([#5167]({{ site.repository }}/issues/5167))
|
||||
- Update Ruby versions in travis.yml ([#5221]({{ site.repository }}/issues/5221))
|
||||
- Avoid installing unecessary gems for site testing ([#5272]({{ site.repository }}/issues/5272))
|
||||
- Proposal: Affinity teams and their captains ([#5273]({{ site.repository }}/issues/5273))
|
||||
- Replace duplicate with postive local test in issue template ([#5286]({{ site.repository }}/issues/5286))
|
||||
- Update AppVeyor config. ([#5240]({{ site.repository }}/issues/5240))
|
||||
- Execute jekyll from clone instead of defined binary when running 'script/default-site' ([#5295]({{ site.repository }}/issues/5295))
|
||||
- rubocop: lib/jekyll/document.rb complexity fixes ([#5045]({{ site.repository }}/issues/5045))
|
||||
- Proxy a number of Convertible methods to Renderer ([#5308]({{ site.repository }}/issues/5308))
|
||||
- Run executable for Cucumber via Ruby instead of Shell ([#5383]({{ site.repository }}/issues/5383))
|
||||
- Appease Rubocop ([#5381]({{ site.repository }}/issues/5381))
|
||||
- remove features' directories on windows with proper access ([#5389]({{ site.repository }}/issues/5389))
|
||||
- `site_configuration.feature`: use UTC format in timezone ([#5416]({{ site.repository }}/issues/5416))
|
||||
- swallow bundle output from `jekyll new` while in CI ([#5408]({{ site.repository }}/issues/5408))
|
||||
- Add .editorconfig ([#5412]({{ site.repository }}/issues/5412))
|
||||
|
||||
|
||||
## 3.2.1 / 2016-08-02
|
||||
{: #v3-2-1}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ permalink: /docs/installation/
|
||||
Getting Jekyll installed and ready-to-go should only take a few minutes.
|
||||
If it ever becomes a pain, please [file an issue]({{ site.repository }}/issues/new)
|
||||
(or submit a pull request) describing the issue you
|
||||
encountered and how we might make the process easier
|
||||
encountered and how we might make the process easier.
|
||||
|
||||
### Requirements
|
||||
|
||||
@@ -17,7 +17,7 @@ requirements you’ll need to make sure your system has before you start.
|
||||
- [Ruby](https://www.ruby-lang.org/en/downloads/) (including development
|
||||
headers, v1.9.3 or above for Jekyll 2 and v2 or above for Jekyll 3)
|
||||
- [RubyGems](https://rubygems.org/pages/download)
|
||||
- Linux, Unix, or Mac OS X
|
||||
- Linux, Unix, or macOS
|
||||
- [NodeJS](https://nodejs.org/), or another JavaScript runtime (Jekyll 2 and
|
||||
earlier, for CoffeeScript support).
|
||||
- [Python 2.7](https://www.python.org/downloads/) (for Jekyll 2 and earlier)
|
||||
@@ -51,8 +51,8 @@ community can improve the experience for everyone.
|
||||
<h5>Installing Xcode Command-Line Tools</h5>
|
||||
<p>
|
||||
If you run into issues installing Jekyll's dependencies which make use of
|
||||
native extensions and are using Mac OS X, you will need to install Xcode
|
||||
and the Command-Line Tools it ships with. Download in
|
||||
native extensions and are using macOS, you will need to install Xcode
|
||||
and the Command-Line Tools it ships with. Download them in
|
||||
<code>Preferences → Downloads → Components</code>.
|
||||
</p>
|
||||
</div>
|
||||
@@ -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
|
||||
|
||||
@@ -910,6 +911,9 @@ LESS.js files during generation.
|
||||
- [Jekyll Autoprefixer](https://github.com/vwochnik/jekyll-autoprefixer): Autoprefixer integration for Jekyll
|
||||
- [Jekyll-breadcrumbs](https://github.com/git-no/jekyll-breadcrumbs): Creates breadcrumbs for Jekyll 3.x, includes features like SEO optimization, optional breadcrumb item translation and more.
|
||||
- [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
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ file. For example, the following are examples of valid post filenames:
|
||||
|
||||
```sh
|
||||
2011-12-31-new-years-eve-is-awesome.md
|
||||
2012-09-12-how-to-write-a-blog.textile
|
||||
2012-09-12-how-to-write-a-blog.md
|
||||
```
|
||||
|
||||
<div class="note">
|
||||
|
||||
@@ -10,11 +10,12 @@ For the impatient, here's how to get a boilerplate Jekyll site up and running.
|
||||
~ $ gem install jekyll bundler
|
||||
~ $ jekyll new myblog
|
||||
~ $ cd myblog
|
||||
~/myblog $ bundle install
|
||||
~/myblog $ bundle exec jekyll serve
|
||||
# => Now browse to http://localhost:4000
|
||||
```
|
||||
|
||||
The `jekyll new` command now automatically initiates `bundle install` and installs the dependencies required. To skip this, pass `--skip-bundle` option like so `jekyll new myblog --skip-bundle`.
|
||||
|
||||
If you wish to install jekyll into an existing directory, you can do so by running `jekyll new .` from within the directory instead of creating a new one. If the existing directory isn't empty, you'll also have to pass the `--force` option like so `jekyll new . --force`.
|
||||
|
||||
That's nothing, though. The real magic happens when you start creating blog
|
||||
|
||||
@@ -26,7 +26,7 @@ following metadata:
|
||||
<td><p><code>file.path</code></p></td>
|
||||
<td><p>
|
||||
|
||||
The relative path to the file.
|
||||
The relative path to the file, e.g <code>/assets/img/image.jpg</code>
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
@@ -34,7 +34,23 @@ following metadata:
|
||||
<td><p><code>file.modified_time</code></p></td>
|
||||
<td><p>
|
||||
|
||||
The `Time` the file was last modified.
|
||||
The `Time` the file was last modified, e.g <code>2016-04-01 16:35:26 +0200</code>
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><code>file.name</code></p></td>
|
||||
<td><p>
|
||||
|
||||
The string name of the file e.g. <code>image.jpg</code> for <code>image.jpg</code>
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><code>file.basename</code></p></td>
|
||||
<td><p>
|
||||
|
||||
The string basename of the file e.g. <code>image</code> for <code>image.jpg</code>
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
|
||||
@@ -18,8 +18,8 @@ A basic Jekyll site usually looks something like this:
|
||||
.
|
||||
├── _config.yml
|
||||
├── _drafts
|
||||
| ├── begin-with-the-crazy-ideas.textile
|
||||
| └── on-simplicity-in-technology.markdown
|
||||
| ├── begin-with-the-crazy-ideas.md
|
||||
| └── on-simplicity-in-technology.md
|
||||
├── _includes
|
||||
| ├── footer.html
|
||||
| └── header.html
|
||||
@@ -27,8 +27,8 @@ A basic Jekyll site usually looks something like this:
|
||||
| ├── default.html
|
||||
| └── post.html
|
||||
├── _posts
|
||||
| ├── 2007-10-29-why-every-programmer-should-play-nethack.textile
|
||||
| └── 2009-04-26-barcamp-boston-4-roundup.textile
|
||||
| ├── 2007-10-29-why-every-programmer-should-play-nethack.md
|
||||
| └── 2009-04-26-barcamp-boston-4-roundup.md
|
||||
├── _data
|
||||
| └── members.yml
|
||||
├── _site
|
||||
|
||||
@@ -21,6 +21,34 @@ common tasks easier.
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Relative URL</strong></p>
|
||||
<p>Prepend the <code>baseurl</code> value to the input. Useful if your site is hosted at a subpath rather than the root of the domain.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
<code class="filter">{% raw %}{{ "/assets/style.css" | relative_url }}{% endraw %}</code>
|
||||
</p>
|
||||
<p>
|
||||
<code class="output">/my-baseurl/assets/style.css</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Absolute URL</strong></p>
|
||||
<p>Prepend the <code>url</code> and <code>baseurl</code> value to the input.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
<code class="filter">{% raw %}{{ "/assets/style.css" | absolute_url }}{% endraw %}</code>
|
||||
</p>
|
||||
<p>
|
||||
<code class="output">http://example.com/my-baseurl/assets/style.css</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Date to XML Schema</strong></p>
|
||||
@@ -263,7 +291,7 @@ common tasks easier.
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
<code class="filter">{% raw %}{{ "a \n b" | normalize_whitepace }}{% endraw %}</code>
|
||||
<code class="filter">{% raw %}{{ "a \n b" | normalize_whitespace }}{% endraw %}</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -482,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.
|
||||
|
||||
@@ -492,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 %}
|
||||
```
|
||||
|
||||
@@ -501,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
|
||||
|
||||
@@ -27,6 +27,7 @@ Jekyll themes set default layouts, includes, and stylesheets, that can be overri
|
||||
|
||||
Jekyll will look first to your site's content, before looking to the theme's defaults, for any requested file in the following folders:
|
||||
|
||||
* `/assets`
|
||||
* `/_layouts`
|
||||
* `/_includes`
|
||||
* `/_sass`
|
||||
@@ -34,6 +35,10 @@ Jekyll will look first to your site's content, before looking to the theme's def
|
||||
Refer to your selected theme's documentation and source repository for more information on what files you can override.
|
||||
{: .note .info}
|
||||
|
||||
To locate theme's files on your computer, run `bundle show` followed by
|
||||
the name of the theme's gem, e.g. `bundle show minima` for default Jekyll's
|
||||
theme. Then copy the files you want to override, from the returned path to your root folder.
|
||||
|
||||
## Creating a theme
|
||||
|
||||
Jekyll themes are distributed as Ruby gems. Don't worry, Jekyll will help you scaffold a new theme with the `new-theme` command. Just run `jekyll new-theme` with the theme name as an argument:
|
||||
@@ -64,6 +69,12 @@ Theme layouts and includes work just like they work in any Jekyll site. Place la
|
||||
|
||||
For example, if your theme has a `/_layouts/page.html` file, and a page has `layout: page` in its YAML front matter, Jekyll will first look to the site's `_layouts` folder for a the `page` layout, and if none exists, will use your theme's `page` layout.
|
||||
|
||||
### Assets
|
||||
|
||||
Any file in `/assets` will be copied over to the user's site upon build unless they have a file with the same relative path. You may ship any kind of asset here: SCSS, an image, a webfont, etc. These files behave just like pages and static files in Jekyll: if the file has [YAML front matter]({{ site.baseurl }}/docs/frontmatter/) at the top, then it will be rendered. If it does not have YAML front matter, it will simply be copied over into the resulting site. This allows theme creators to ship a default `/assets/styles.scss` file which their layouts can depend on as `/assets/styles.css`.
|
||||
|
||||
All files in `/assets` will be output into the compiled site in the `/assets` folder just as you'd expect from using Jekyll on your sites.
|
||||
|
||||
### Stylesheets
|
||||
|
||||
Your theme's stylesheets should be placed in your theme's `/_sass` folder, again, just as you would when authoring a Jekyll site. Your theme's styles can be included in the user's stylesheet using the `@import` directive.
|
||||
@@ -94,3 +105,6 @@ Themes are published via [RubyGems.org](https://rubygems.org). You'll need a Rub
|
||||
2. Next, push your packaged theme up to the RubyGems service, by running the following command, again replacing `my-awesome-jekyll-theme` with the name of your theme:
|
||||
|
||||
gem push my-awesome-jekyll-theme-*.gem
|
||||
|
||||
3. To release a new version of your theme, simply update the version number in the gemspec file, ( `my-awesome-jekyll-theme.gemspec` in this example ), and then repeat Steps 1 & 2 above.
|
||||
We recommend that you follow [Semantic Versioning](http://semver.org/) while bumping your theme-version.
|
||||
|
||||
@@ -13,6 +13,7 @@ that might be of help. If the problem you’re experiencing isn’t covered belo
|
||||
- [Base-URL Problems](#base-url-problems)
|
||||
- [Configuration problems](#configuration-problems)
|
||||
- [Markup Problems](#markup-problems)
|
||||
- [Production Problems](#production-problems)
|
||||
|
||||
## Installation Problems
|
||||
|
||||
@@ -56,14 +57,14 @@ sudo emerge -av dev-ruby/rubygems
|
||||
On Windows, you may need to install [RubyInstaller
|
||||
DevKit](https://wiki.github.com/oneclick/rubyinstaller/development-kit).
|
||||
|
||||
On Mac OS X, you may need to update RubyGems (using `sudo` only if necessary):
|
||||
On macOS, you may need to update RubyGems (using `sudo` only if necessary):
|
||||
|
||||
```sh
|
||||
sudo gem update --system
|
||||
```
|
||||
|
||||
If you still have issues, you can download and install new Command Line
|
||||
Tools (such as `gcc`) using the command
|
||||
Tools (such as `gcc`) using the following command:
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
@@ -76,7 +77,7 @@ which may allow you to install native gems using this command (again using
|
||||
sudo gem install jekyll
|
||||
```
|
||||
|
||||
Note that upgrading Mac OS X does not automatically upgrade Xcode itself
|
||||
Note that upgrading macOS does not automatically upgrade Xcode itself
|
||||
(that can be done separately via the App Store), and having an out-of-date
|
||||
Xcode.app can interfere with the command line tools downloaded above. If
|
||||
you run into this issue, upgrade Xcode and install the upgraded Command
|
||||
@@ -209,6 +210,13 @@ strange errors where references don't exist or a tag hasn't been closed. If you
|
||||
run into these errors, try setting `excerpt_separator: ""` in your
|
||||
`_config.yml`, or set it to some nonsense string.
|
||||
|
||||
## Production Problems
|
||||
|
||||
If you run into an issue that a static file can't be found in your
|
||||
production environment during build since v3.2.0 you should set your
|
||||
[environment to `production`](../configuration/#specifying-a-jekyll-environment-at-build-time).
|
||||
The issue is caused by trying to copy a non-existing symlink.
|
||||
|
||||
<div class="note">
|
||||
<h5>Please report issues you encounter!</h5>
|
||||
<p>
|
||||
|
||||
110
site/_posts/2016-10-06-jekyll-3-3-is-here.md
Normal file
110
site/_posts/2016-10-06-jekyll-3-3-is-here.md
Normal file
@@ -0,0 +1,110 @@
|
||||
---
|
||||
layout: news_item
|
||||
title: 'Jekyll 3.3 is here with better theme support, new URL filters, and tons more'
|
||||
date: 2016-10-06 11:10:38 -0700
|
||||
author: parkr
|
||||
version: 3.3.0
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
There are tons of great new quality-of-life features you can use in 3.3.
|
||||
Three key things you might want to try:
|
||||
|
||||
### 1. Themes can now ship static & dynamic assets in an `/assets` directory
|
||||
|
||||
In Jekyll 3.2, we shipped the ability to use a theme that was packaged as a
|
||||
[gem](http://guides.rubygems.org/). 3.2 included support for includes,
|
||||
layouts, and sass partials. In 3.3, we're adding assets to that list.
|
||||
|
||||
In an effort to make theme management a bit easier, any files you put into
|
||||
`/assets` in your theme will be read in as though they were part of the
|
||||
user's site. This means you can ship SCSS and CoffeeScript, images and
|
||||
webfonts, and so on -- anything you'd consider a part of the
|
||||
*presentation*. Same rules apply here as in a Jekyll site: if it has YAML
|
||||
front matter, it will be converted and rendered. No YAML front matter, and
|
||||
it will simply be copied over like a static asset.
|
||||
|
||||
Note that if a user has a file of the same path, the theme content will not
|
||||
be included in the site, i.e. a user's `/assets/main.scss` will be read and
|
||||
processed if present instead of a theme's `/assets/main.scss`.
|
||||
|
||||
See our [documentation on the subject]({{ "/docs/themes/#assets" | relative_url }})
|
||||
for more info.
|
||||
|
||||
### 2. `relative_url` and `absolute_url` filters
|
||||
|
||||
Want a clean way to prepend the `baseurl` or `url` in your config? These
|
||||
new filters have you covered. When working locally, if you set your
|
||||
`baseurl` to match your deployment environment, say `baseurl: "/myproject"`,
|
||||
then `relative_url` will ensure that this baseurl is prepended to anything
|
||||
you pass it:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% raw %}
|
||||
{{ "/docs/assets/" | relative_url }} => /myproject/docs/assets
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
By default, `baseurl` is set to `""` and therefore yields (never set to
|
||||
`"/"`):
|
||||
|
||||
{% highlight liquid %}
|
||||
{% raw %}
|
||||
{{ "/docs/assets/" | relative_url }} => /docs/assets
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
A result of `relative_url` will safely always produce a URL which is
|
||||
relative to the domain root. A similar principle applies to `absolute_url`.
|
||||
It prepends your `baseurl` and `url` values, making absolute URL's all the
|
||||
easier to make:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% raw %}
|
||||
{{ "/docs/assets/" | absolute_url }} => http://jekyllrb.com/myproject/docs/assets
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
### 3. `site.url` is set by the development server
|
||||
|
||||
When you run `jekyll serve` locally, it starts a web server, usually at
|
||||
`http://localhost:4000`, that you use to preview your site during
|
||||
development. If you are using the new `absolute_url` filter, or using
|
||||
`site.url` anywhere, you have probably had to create a development config
|
||||
which resets the `url` value to point to `http://localhost:4000`.
|
||||
|
||||
No longer! When you run `jekyll serve`, Jekyll will build your site with
|
||||
the value of the `host`, `port`, and SSL-related options. This defaults to
|
||||
`url: http://localhost:4000`. When you are developing locally, `site.url`
|
||||
will yield `http://localhost:4000`.
|
||||
|
||||
This happens by default when running Jekyll locally. It will not be set if
|
||||
you set `JEKYLL_ENV=production` and run `jekyll serve`. If `JEKYLL_ENV` is
|
||||
any value except `development` (its default value), Jekyll will not
|
||||
overwrite the value of `url` in your config. And again, this only applies
|
||||
to serving, not to building.
|
||||
|
||||
## A *lot* more!
|
||||
|
||||
There are dozens of bug fixes and minor improvements to make your Jekyll
|
||||
experience better than ever. With every Jekyll release, we strive to bring
|
||||
greater stability and reliability to your everyday development workflow.
|
||||
|
||||
As always, thanks to our many contributors who contributed countless hours
|
||||
of their free time to making this release happen:
|
||||
|
||||
Anatoliy Yastreb, Anthony Gaudino, Antonio, Ashwin Maroli, Ben Balter,
|
||||
Charles Horn, Chris Finazzo, Daniel Chapman, David Zhang, Eduardo
|
||||
Bouças, Edward Thomson, Eloy Espinaco, Florian Thomas, Frank Taillandier,
|
||||
Gerardo, Heng Kwokfu, Heng, K. (Stephen), Jeff Kolesky, Jonathan Thornton,
|
||||
Jordon Bedwell, Jussi Kinnula, Júnior Messias, Kyle O'Brien, Manmeet Gill,
|
||||
Mark H. Wilkinson, Marko Locher, Mertcan GÖKGÖZ, Michal Švácha, Mike
|
||||
Kasberg, Nadjib Amar, Nicolas Hoizey, Nicolas Porcel, Parker Moore, Pat
|
||||
Hawks, Patrick Marsceill, Stephen Checkoway, Stuart Kent, XhmikosR, Zlatan
|
||||
Vasović, mertkahyaoglu, shingo-nakanishi, and vohedge.
|
||||
|
||||
[Full release notes]({{ "/docs/history/#v3-3-0" | relative_url }}) are available
|
||||
for your perusal. If you notice any issues, please don't hesitate to file a
|
||||
bug report.
|
||||
|
||||
Happy Jekylling!
|
||||
@@ -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}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
/* Base */
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
font: 300 21px Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
|
||||
@@ -57,11 +57,6 @@ overview: true
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">cd my-awesome-site</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path">~/my-awesome-site</span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">bundle install</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path">~/my-awesome-site</span>
|
||||
<span class="prompt">$</span>
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.2.1
|
||||
3.3.0
|
||||
|
||||
3
test/fixtures/test-theme/_sass/test-theme-red.scss
vendored
Normal file
3
test/fixtures/test-theme/_sass/test-theme-red.scss
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.sample {
|
||||
color: red;
|
||||
}
|
||||
3
test/fixtures/test-theme/assets/application.coffee
vendored
Normal file
3
test/fixtures/test-theme/assets/application.coffee
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
alert "From your theme."
|
||||
1
test/fixtures/test-theme/assets/img/another-logo.png
vendored
Symbolic link
1
test/fixtures/test-theme/assets/img/another-logo.png
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
logo.png
|
||||
BIN
test/fixtures/test-theme/assets/img/logo.png
vendored
Normal file
BIN
test/fixtures/test-theme/assets/img/logo.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
3
test/fixtures/test-theme/assets/style.scss
vendored
Normal file
3
test/fixtures/test-theme/assets/style.scss
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
@import "test-theme-{{ site.theme-color | default: "red" }}";
|
||||
@@ -120,12 +120,9 @@ class JekyllUnitTest < Minitest::Test
|
||||
"destination" => dest_dir,
|
||||
"incremental" => false
|
||||
}))
|
||||
build_configs({
|
||||
Configuration.from(full_overrides.merge({
|
||||
"source" => source_dir
|
||||
}, full_overrides)
|
||||
.fix_common_issues
|
||||
.backwards_compatibilize
|
||||
.add_default_collections
|
||||
}))
|
||||
end
|
||||
|
||||
def clear_dest
|
||||
|
||||
6
test/source/_data/categories.01/dairy.yaml
Normal file
6
test/source/_data/categories.01/dairy.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: Dairy
|
||||
products:
|
||||
- name: cheese
|
||||
price: 5.5
|
||||
- name: milk
|
||||
price: 2.75
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
---
|
||||
|
||||
This is the first paragraph. It [has][link_0] [lots][link_1] [of][link_2]
|
||||
[links][link_3].
|
||||
|
||||
This is the second paragraph. It has sample code that should not be extracted:
|
||||
|
||||
[fakelink]: www.invalid.com
|
||||
|
||||
And here are the real links:
|
||||
|
||||
[link_0]: www.example.com/0
|
||||
[link_1]: www.example.com/1
|
||||
[link_2]: www.example.com/2
|
||||
[link_3]: www.example.com/3
|
||||
3
test/source/assets/application.coffee
Normal file
3
test/source/assets/application.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
---
|
||||
alert "From your site."
|
||||
7
test/source/info.md
Normal file
7
test/source/info.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: Information
|
||||
---
|
||||
|
||||
# Information
|
||||
|
||||
Very important information is here
|
||||
@@ -19,6 +19,12 @@ class TestCommandsServe < JekyllUnitTest
|
||||
p
|
||||
)
|
||||
end
|
||||
Jekyll.sites.clear
|
||||
allow(SafeYAML).to receive(:load_file).and_return({})
|
||||
allow(Jekyll::Commands::Build).to receive(:build).and_return("")
|
||||
end
|
||||
teardown do
|
||||
Jekyll.sites.clear
|
||||
end
|
||||
|
||||
should "label itself" do
|
||||
@@ -79,16 +85,53 @@ class TestCommandsServe < JekyllUnitTest
|
||||
custom_options = {
|
||||
"config" => %w(_config.yml _development.yml),
|
||||
"serving" => true,
|
||||
"watch" => false # for not having guard output when running the tests
|
||||
"watch" => false, # for not having guard output when running the tests
|
||||
"url" => "http://localhost:4000"
|
||||
}
|
||||
allow(SafeYAML).to receive(:load_file).and_return({})
|
||||
allow(Jekyll::Commands::Build).to receive(:build).and_return("")
|
||||
|
||||
expect(Jekyll::Commands::Serve).to receive(:process).with(custom_options)
|
||||
@merc.execute(:serve, { "config" => %w(_config.yml _development.yml),
|
||||
"watch" => false })
|
||||
end
|
||||
|
||||
context "in development environment" do
|
||||
setup do
|
||||
expect(Jekyll).to receive(:env).and_return("development")
|
||||
expect(Jekyll::Commands::Serve).to receive(:start_up_webrick)
|
||||
end
|
||||
should "set the site url by default to `http://localhost:4000`" do
|
||||
@merc.execute(:serve, { "watch" => false, "url" => "https://jekyllrb.com/" })
|
||||
|
||||
assert_equal 1, Jekyll.sites.count
|
||||
assert_equal "http://localhost:4000", Jekyll.sites.first.config["url"]
|
||||
end
|
||||
|
||||
should "take `host`, `port` and `ssl` into consideration if set" do
|
||||
@merc.execute(:serve, {
|
||||
"watch" => false,
|
||||
"host" => "example.com",
|
||||
"port" => "9999",
|
||||
"url" => "https://jekyllrb.com/",
|
||||
"ssl_cert" => "foo",
|
||||
"ssl_key" => "bar"
|
||||
})
|
||||
|
||||
assert_equal 1, Jekyll.sites.count
|
||||
assert_equal "https://example.com:9999", Jekyll.sites.first.config["url"]
|
||||
end
|
||||
end
|
||||
|
||||
context "not in development environment" do
|
||||
should "not update the site url" do
|
||||
expect(Jekyll).to receive(:env).and_return("production")
|
||||
expect(Jekyll::Commands::Serve).to receive(:start_up_webrick)
|
||||
@merc.execute(:serve, { "watch" => false, "url" => "https://jekyllrb.com/" })
|
||||
|
||||
assert_equal 1, Jekyll.sites.count
|
||||
assert_equal "https://jekyllrb.com/", Jekyll.sites.first.config["url"]
|
||||
end
|
||||
end
|
||||
|
||||
context "verbose" do
|
||||
should "debug when verbose" do
|
||||
assert_equal custom_opts({ "verbose" => true })[:Logger].level, 5
|
||||
|
||||
@@ -48,6 +48,12 @@ class TestConfiguration < JekyllUnitTest
|
||||
end
|
||||
end
|
||||
|
||||
context "the defaults" do
|
||||
should "exclude node_modules" do
|
||||
assert_includes Configuration.from({})["exclude"], "node_modules"
|
||||
end
|
||||
end
|
||||
|
||||
context "#add_default_collections" do
|
||||
should "no-op if collections is nil" do
|
||||
result = Configuration[{ "collections" => nil }].add_default_collections
|
||||
|
||||
@@ -119,6 +119,32 @@ class TestExcerpt < JekyllUnitTest
|
||||
assert @extracted_excerpt.content.include?("http://www.jekyllrb.com/")
|
||||
end
|
||||
end
|
||||
|
||||
context "with indented link references" do
|
||||
setup do
|
||||
@post = setup_post("2016-08-16-indented-link-references.markdown")
|
||||
@excerpt = @post.excerpt
|
||||
end
|
||||
|
||||
should "contain all refs at the bottom of the page" do
|
||||
(0..3).each do |i|
|
||||
assert_match "[link_#{i}]: www.example.com/#{i}", @excerpt.content
|
||||
end
|
||||
end
|
||||
|
||||
should "ignore indented code" do
|
||||
refute_match "[fakelink]:", @excerpt.content
|
||||
end
|
||||
|
||||
should "render links properly" do
|
||||
@rendered_post = @post.dup
|
||||
do_render(@rendered_post)
|
||||
output = @rendered_post.data["excerpt"].output
|
||||
(0..3).each do |i|
|
||||
assert_includes output, "<a href=\"www.example.com/#{i}\">"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -8,23 +8,28 @@ class TestFilters < JekyllUnitTest
|
||||
attr_accessor :site, :context
|
||||
|
||||
def initialize(opts = {})
|
||||
@site = Jekyll::Site.new(
|
||||
Jekyll.configuration(opts.merge("skip_config_files" => true))
|
||||
)
|
||||
@site = Jekyll::Site.new(opts.merge("skip_config_files" => true))
|
||||
@context = Liquid::Context.new({}, {}, { :site => @site })
|
||||
end
|
||||
end
|
||||
|
||||
def make_filter_mock(opts = {})
|
||||
JekyllFilter.new(site_configuration(opts)).tap do |f|
|
||||
tz = f.site.config["timezone"]
|
||||
Jekyll.set_timezone(tz) if tz
|
||||
end
|
||||
end
|
||||
|
||||
class SelectDummy
|
||||
def select; end
|
||||
end
|
||||
|
||||
context "filters" do
|
||||
setup do
|
||||
@filter = JekyllFilter.new({
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"timezone" => "UTC"
|
||||
@filter = make_filter_mock({
|
||||
"timezone" => "UTC",
|
||||
"url" => "http://example.com",
|
||||
"baseurl" => "/base"
|
||||
})
|
||||
@sample_time = Time.utc(2013, 3, 27, 11, 22, 33)
|
||||
@sample_date = Date.parse("2013-03-27")
|
||||
@@ -52,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(
|
||||
@@ -65,7 +84,7 @@ class TestFilters < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "escapes special characters when configured to do so" do
|
||||
kramdown = JekyllFilter.new({ :kramdown => { :entity_output => :symbolic } })
|
||||
kramdown = make_filter_mock({ :kramdown => { :entity_output => :symbolic } })
|
||||
assert_equal(
|
||||
"“This filter’s test…”",
|
||||
kramdown.smartify(%q{"This filter's test..."})
|
||||
@@ -307,6 +326,113 @@ class TestFilters < JekyllUnitTest
|
||||
assert_equal "my%20things", @filter.uri_escape("my things")
|
||||
end
|
||||
|
||||
context "absolute_url filter" do
|
||||
should "produce an absolute URL from a page URL" do
|
||||
page_url = "/about/my_favorite_page/"
|
||||
assert_equal "http://example.com/base#{page_url}", @filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "ensure the leading slash" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
assert_equal "http://example.com/base/#{page_url}", @filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "ensure the leading slash for the baseurl" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
filter = make_filter_mock({
|
||||
"url" => "http://example.com",
|
||||
"baseurl" => "base"
|
||||
})
|
||||
assert_equal "http://example.com/base/#{page_url}", filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "be ok with a blank but present 'url'" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
filter = make_filter_mock({
|
||||
"url" => "",
|
||||
"baseurl" => "base"
|
||||
})
|
||||
assert_equal "/base/#{page_url}", filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "be ok with a nil 'url'" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
filter = make_filter_mock({
|
||||
"url" => nil,
|
||||
"baseurl" => "base"
|
||||
})
|
||||
assert_equal "/base/#{page_url}", filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "be ok with a nil 'baseurl'" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
filter = make_filter_mock({
|
||||
"url" => "http://example.com",
|
||||
"baseurl" => nil
|
||||
})
|
||||
assert_equal "http://example.com/#{page_url}", filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "not prepend a forward slash if input is empty" do
|
||||
page_url = ""
|
||||
filter = make_filter_mock({
|
||||
"url" => "http://example.com",
|
||||
"baseurl" => "/base"
|
||||
})
|
||||
assert_equal "http://example.com/base", filter.absolute_url(page_url)
|
||||
end
|
||||
|
||||
should "normalize international URLs" do
|
||||
page_url = ""
|
||||
filter = make_filter_mock({
|
||||
"url" => "http://ümlaut.example.org/",
|
||||
"baseurl" => nil
|
||||
})
|
||||
assert_equal "http://xn--mlaut-jva.example.org/", filter.absolute_url(page_url)
|
||||
end
|
||||
end
|
||||
|
||||
context "relative_url filter" do
|
||||
should "produce a relative URL from a page URL" do
|
||||
page_url = "/about/my_favorite_page/"
|
||||
assert_equal "/base#{page_url}", @filter.relative_url(page_url)
|
||||
end
|
||||
|
||||
should "ensure the leading slash between baseurl and input" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
assert_equal "/base/#{page_url}", @filter.relative_url(page_url)
|
||||
end
|
||||
|
||||
should "ensure the leading slash for the baseurl" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
filter = make_filter_mock({ "baseurl" => "base" })
|
||||
assert_equal "/base/#{page_url}", filter.relative_url(page_url)
|
||||
end
|
||||
|
||||
should "normalize international URLs" do
|
||||
page_url = "错误.html"
|
||||
assert_equal "/base/%E9%94%99%E8%AF%AF.html", @filter.relative_url(page_url)
|
||||
end
|
||||
|
||||
should "be ok with a nil 'baseurl'" do
|
||||
page_url = "about/my_favorite_page/"
|
||||
filter = make_filter_mock({
|
||||
"url" => "http://example.com",
|
||||
"baseurl" => nil
|
||||
})
|
||||
assert_equal "/#{page_url}", filter.relative_url(page_url)
|
||||
end
|
||||
|
||||
should "not prepend a forward slash if input is empty" do
|
||||
page_url = ""
|
||||
filter = make_filter_mock({
|
||||
"url" => "http://example.com",
|
||||
"baseurl" => "/base"
|
||||
})
|
||||
assert_equal "/base", filter.relative_url(page_url)
|
||||
end
|
||||
end
|
||||
|
||||
context "jsonify filter" do
|
||||
should "convert hash to json" do
|
||||
assert_equal "{\"age\":18}", @filter.jsonify({ :age => 18 })
|
||||
@@ -475,7 +601,7 @@ class TestFilters < JekyllUnitTest
|
||||
g["items"].is_a?(Array),
|
||||
"The list of grouped items for '' is not an Array."
|
||||
)
|
||||
assert_equal 13, g["items"].size
|
||||
assert_equal 15, g["items"].size
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,7 @@ class TestGeneratedSite < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "ensure post count is as expected" do
|
||||
assert_equal 49, @site.posts.size
|
||||
assert_equal 50, @site.posts.size
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
|
||||
@@ -40,9 +40,12 @@ class TestNewCommand < JekyllUnitTest
|
||||
|
||||
should "display a success message" do
|
||||
Jekyll::Commands::New.process(@args)
|
||||
output = Jekyll.logger.messages.last
|
||||
output = Jekyll.logger.messages[-3]
|
||||
output_last = Jekyll.logger.messages.last
|
||||
success_message = "New jekyll site installed in #{@full_path.cyan}."
|
||||
bundle_message = "Running bundle install in #{@full_path.cyan}..."
|
||||
assert_includes output, success_message
|
||||
assert_includes output_last, bundle_message
|
||||
end
|
||||
|
||||
should "copy the static files in site template to the new directory" do
|
||||
@@ -85,7 +88,10 @@ class TestNewCommand < JekyllUnitTest
|
||||
should "create blank project" do
|
||||
blank_contents = %w(/_drafts /_layouts /_posts /index.html)
|
||||
capture_stdout { Jekyll::Commands::New.process(@args, "--blank") }
|
||||
output = Jekyll.logger.messages.last
|
||||
bundle_message = "Running bundle install in #{@full_path.cyan}..."
|
||||
assert_same_elements blank_contents, dir_contents(@full_path)
|
||||
refute_includes output, bundle_message
|
||||
end
|
||||
|
||||
should "force created folder" do
|
||||
@@ -93,6 +99,13 @@ class TestNewCommand < JekyllUnitTest
|
||||
output = capture_stdout { Jekyll::Commands::New.process(@args, "--force") }
|
||||
assert_match(%r!New jekyll site installed in!, output)
|
||||
end
|
||||
|
||||
should "skip bundle install when opted to" do
|
||||
capture_stdout { Jekyll::Commands::New.process(@args, "--skip-bundle") }
|
||||
output = Jekyll.logger.messages.last
|
||||
bundle_message = "Bundle install skipped."
|
||||
assert_includes output, bundle_message
|
||||
end
|
||||
end
|
||||
|
||||
context "when multiple args are given" do
|
||||
|
||||
@@ -28,4 +28,37 @@ class TestPathSanitization < JekyllUnitTest
|
||||
assert_equal source_dir("files", "hi.txt"),
|
||||
Jekyll.sanitized_path(source_dir, "f./../../../../../../files/hi.txt")
|
||||
end
|
||||
|
||||
if Jekyll::Utils::Platforms.really_windows?
|
||||
context "on Windows with absolute path" do
|
||||
setup do
|
||||
@base_path = "D:/demo"
|
||||
@file_path = "D:/demo/_site"
|
||||
allow(Dir).to receive(:pwd).and_return("D:/")
|
||||
end
|
||||
|
||||
should "strip just the clean path drive name" do
|
||||
assert_equal "D:/demo/_site",
|
||||
Jekyll.sanitized_path(@base_path, @file_path)
|
||||
end
|
||||
end
|
||||
|
||||
context "on Windows with file path has matching prefix" do
|
||||
setup do
|
||||
@base_path = "D:/site"
|
||||
@file_path = "D:/sitemap.xml"
|
||||
allow(Dir).to receive(:pwd).and_return("D:/")
|
||||
end
|
||||
|
||||
should "not strip base path" do
|
||||
assert_equal "D:/site/sitemap.xml",
|
||||
Jekyll.sanitized_path(@base_path, @file_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
should "not strip base path if file path has matching prefix" do
|
||||
assert_equal "/site/sitemap.xml",
|
||||
Jekyll.sanitized_path("/site", "sitemap.xml")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,8 +13,8 @@ class TestRelatedPosts < JekyllUnitTest
|
||||
last_post = @site.posts.last
|
||||
related_posts = Jekyll::RelatedPosts.new(last_post).build
|
||||
|
||||
last_10_recent_posts = (@site.posts.docs.reverse - [last_post]).first(10)
|
||||
assert_equal last_10_recent_posts, related_posts
|
||||
last_ten_recent_posts = (@site.posts.docs.reverse - [last_post]).first(10)
|
||||
assert_equal last_ten_recent_posts, related_posts
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ class TestSite < JekyllUnitTest
|
||||
%#\ +.md
|
||||
.htaccess
|
||||
about.html
|
||||
application.coffee
|
||||
bar.html
|
||||
coffeescript.coffee
|
||||
contacts.html
|
||||
@@ -191,6 +192,7 @@ class TestSite < JekyllUnitTest
|
||||
humans.txt
|
||||
index.html
|
||||
index.html
|
||||
info.md
|
||||
main.scss
|
||||
main.scss
|
||||
properties.html
|
||||
@@ -436,6 +438,21 @@ class TestSite < JekyllUnitTest
|
||||
)
|
||||
end
|
||||
|
||||
should "auto load yaml files in subdirectory with a period in the name" do
|
||||
site = Site.new(site_configuration)
|
||||
site.process
|
||||
|
||||
file_content = SafeYAML.load_file(File.join(
|
||||
source_dir, "_data", "categories.01", "dairy.yaml"
|
||||
))
|
||||
|
||||
assert_equal site.data["categories01"]["dairy"], file_content
|
||||
assert_equal(
|
||||
site.site_payload["site"]["data"]["categories01"]["dairy"],
|
||||
file_content
|
||||
)
|
||||
end
|
||||
|
||||
should "load symlink files in unsafe mode" do
|
||||
site = Site.new(site_configuration("safe" => false))
|
||||
site.process
|
||||
|
||||
@@ -112,6 +112,14 @@ class TestStaticFile < JekyllUnitTest
|
||||
assert_equal Time.new.to_i, @static_file.mtime
|
||||
end
|
||||
|
||||
should "only set modified time if not a symlink" do
|
||||
expect(File).to receive(:symlink?).and_return(true)
|
||||
expect(File).not_to receive(:utime)
|
||||
@static_file.write(dest_dir)
|
||||
|
||||
allow(File).to receive(:symlink?).and_call_original
|
||||
end
|
||||
|
||||
should "known if the source path is modified, when it is" do
|
||||
sleep 1
|
||||
modify_dummy_file(@filename)
|
||||
@@ -134,6 +142,8 @@ class TestStaticFile < JekyllUnitTest
|
||||
|
||||
should "be able to convert to liquid" do
|
||||
expected = {
|
||||
"basename" => "static_file",
|
||||
"name" => "static_file.txt",
|
||||
"extname" => ".txt",
|
||||
"modified_time" => @static_file.modified_time,
|
||||
"path" => "/static_file.txt"
|
||||
|
||||
@@ -12,6 +12,7 @@ class TestTags < JekyllUnitTest
|
||||
|
||||
site.posts.docs.concat(PostReader.new(site).read_posts("")) if override["read_posts"]
|
||||
CollectionReader.new(site).read if override["read_collections"]
|
||||
site.read if override["read_all"]
|
||||
|
||||
info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
|
||||
@converter = site.converters.find { |c| c.class == converter_class }
|
||||
@@ -58,6 +59,7 @@ CONTENT
|
||||
assert_match r, "xml+cheetah"
|
||||
assert_match r, "x.y"
|
||||
assert_match r, "coffee-script"
|
||||
assert_match r, "shell_session"
|
||||
|
||||
refute_match r, "blah^"
|
||||
|
||||
@@ -587,6 +589,40 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with nested post linking and path not used in `post_url`" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
---
|
||||
title: Deprecated Post linking
|
||||
---
|
||||
|
||||
- 1 {% post_url 2008-11-21-nested %}
|
||||
CONTENT
|
||||
create_post(content, {
|
||||
"permalink" => "pretty",
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_posts" => true
|
||||
})
|
||||
end
|
||||
|
||||
should "not cause an error" do
|
||||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the url to the \"nested\" post from 2008-11-21" do
|
||||
assert_match %r!1\s/2008/11/21/nested/!, @result
|
||||
end
|
||||
|
||||
should "throw a deprecation warning" do
|
||||
deprecation_warning = " Deprecation: A call to "\
|
||||
"'{{ post_url 2008-11-21-nested }}' did not match a post using the new matching "\
|
||||
"method of checking name (path-date-slug) equality. Please make sure that you "\
|
||||
"change this tag to match the post's name exactly."
|
||||
assert_includes Jekyll.logger.messages, deprecation_warning
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with invalid post name linking" do
|
||||
should "cause an error" do
|
||||
content = <<CONTENT
|
||||
@@ -627,6 +663,41 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with linking to a page" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
---
|
||||
title: linking
|
||||
---
|
||||
|
||||
{% link contacts.html %}
|
||||
{% link info.md %}
|
||||
{% link /css/screen.css %}
|
||||
CONTENT
|
||||
create_post(content, {
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_all" => true
|
||||
})
|
||||
end
|
||||
|
||||
should "not cause an error" do
|
||||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the \"contacts\" item" do
|
||||
assert_match(%r!/contacts\.html!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the \"info\" item" do
|
||||
assert_match(%r!/info\.html!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the \"screen.css\" item" do
|
||||
assert_match(%r!/css/screen\.css!, @result)
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with linking" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
|
||||
@@ -34,16 +34,16 @@ class TestTheme < JekyllUnitTest
|
||||
end
|
||||
|
||||
context "path generation" do
|
||||
[:layouts, :includes, :sass].each do |folder|
|
||||
[:assets, :_layouts, :_includes, :_sass].each do |folder|
|
||||
should "know the #{folder} path" do
|
||||
expected = File.expand_path("_#{folder}", @expected_root)
|
||||
assert_equal expected, @theme.public_send("#{folder}_path")
|
||||
expected = File.expand_path(folder.to_s, @expected_root)
|
||||
assert_equal expected, @theme.public_send("#{folder.to_s.tr("_", "")}_path")
|
||||
end
|
||||
end
|
||||
|
||||
should "generate folder paths" do
|
||||
expected = File.expand_path("./_sass", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :sass)
|
||||
assert_equal expected, @theme.send(:path_for, :_sass)
|
||||
end
|
||||
|
||||
should "not allow paths outside of the theme root" do
|
||||
@@ -56,7 +56,7 @@ class TestTheme < JekyllUnitTest
|
||||
|
||||
should "return the resolved path when a symlink & resolved path exists" do
|
||||
expected = File.expand_path("./_layouts", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :symlink)
|
||||
assert_equal expected, @theme.send(:path_for, :_symlink)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
71
test/test_theme_assets_reader.rb
Normal file
71
test/test_theme_assets_reader.rb
Normal file
@@ -0,0 +1,71 @@
|
||||
require "helper"
|
||||
|
||||
class TestThemeAssetsReader < JekyllUnitTest
|
||||
def setup
|
||||
@site = fixture_site(
|
||||
"theme" => "test-theme",
|
||||
"theme-color" => "black"
|
||||
)
|
||||
assert @site.theme
|
||||
end
|
||||
|
||||
def assert_file_with_relative_path(haystack, relative_path)
|
||||
assert haystack.any? { |f|
|
||||
f.relative_path == relative_path
|
||||
}, "Site should read in the #{relative_path} file, " \
|
||||
"but it was not found in #{haystack.inspect}"
|
||||
end
|
||||
|
||||
def refute_file_with_relative_path(haystack, relative_path)
|
||||
refute haystack.any? { |f|
|
||||
f.relative_path == relative_path
|
||||
}, "Site should not have read in the #{relative_path} file, " \
|
||||
"but it was found in #{haystack.inspect}"
|
||||
end
|
||||
|
||||
context "with a valid theme" do
|
||||
should "read all assets" do
|
||||
@site.reset
|
||||
ThemeAssetsReader.new(@site).read
|
||||
assert_file_with_relative_path @site.static_files, "assets/img/logo.png"
|
||||
assert_file_with_relative_path @site.pages, "assets/style.scss"
|
||||
end
|
||||
|
||||
should "convert pages" do
|
||||
@site.process
|
||||
|
||||
file = @site.pages.find { |f| f.relative_path == "assets/style.scss" }
|
||||
refute_nil file
|
||||
assert_equal @site.in_dest_dir("assets/style.css"), file.destination(@site.dest)
|
||||
assert_includes file.output, ".sample {\n color: black; }"
|
||||
end
|
||||
|
||||
should "not overwrite site content with the same relative path" do
|
||||
@site.reset
|
||||
@site.read
|
||||
|
||||
file = @site.pages.find { |f| f.relative_path == "assets/application.coffee" }
|
||||
refute_nil file
|
||||
assert_includes file.content, "alert \"From your site.\""
|
||||
end
|
||||
end
|
||||
|
||||
context "with a valid theme without an assets dir" do
|
||||
should "not read any assets" do
|
||||
site = fixture_site("theme" => "test-theme")
|
||||
allow(site.theme).to receive(:assets_path).and_return(nil)
|
||||
ThemeAssetsReader.new(site).read
|
||||
refute_file_with_relative_path site.static_files, "assets/img/logo.png"
|
||||
refute_file_with_relative_path site.pages, "assets/style.scss"
|
||||
end
|
||||
end
|
||||
|
||||
context "with no theme" do
|
||||
should "not read any assets" do
|
||||
site = fixture_site("theme" => nil)
|
||||
ThemeAssetsReader.new(site).read
|
||||
refute_file_with_relative_path site.static_files, "assets/img/logo.png"
|
||||
refute_file_with_relative_path site.pages, "assets/style.scss"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -198,6 +198,13 @@ class TestUtils < JekyllUnitTest
|
||||
)
|
||||
end
|
||||
|
||||
should "replace everything else but ASCII characters" do
|
||||
assert_equal "the-config-yml-file",
|
||||
Utils.slugify("The _config.yml file?", :mode => "ascii")
|
||||
assert_equal "f-rtive-glance",
|
||||
Utils.slugify("fürtive glance!!!!", :mode => "ascii")
|
||||
end
|
||||
|
||||
should "only replace whitespace if mode is raw" do
|
||||
assert_equal(
|
||||
"the-_config.yml-file?",
|
||||
|
||||
Reference in New Issue
Block a user