Compare commits

..

4 Commits

Author SHA1 Message Date
Pat Hawks
b0c591a3f2 Add Inline Markdown converter 2016-10-27 20:30:32 -05:00
David Stosik
167af4552b Avoid modifying existing test's behavior in my PR 2016-10-24 01:03:53 +09:00
David Stosik
3cc4bef2e6 Fix Rubocop errors 2016-10-24 00:39:09 +09:00
David Stosik
4785f6f71f Provide an "inline" mode to markdownify filter 2016-10-24 00:01:09 +09:00
295 changed files with 2407 additions and 3442 deletions

View File

@@ -23,7 +23,7 @@ exclude_paths:
- features/**/*
- script/**/*
- docs/**/*
- site/**/*
- spec/**/*
- test/**/*
- vendor/**/*

View File

@@ -62,33 +62,13 @@ We want the Jekyll documentation to be the best it can be. We've open-sourced ou
### How to submit changes
You can find the documentation for jekyllrb.com in the [docs](https://github.com/jekyll/jekyll/tree/master/docs) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change.
You can find the documentation for jekyllrb.com in the [site](https://github.com/jekyll/jekyll/tree/master/site) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change.
One gotcha, all pull requests should be directed at the `master` branch (the default branch).
### Updating FontAwesome iconset for jekyllrb.com
We use a custom version of FontAwesome which contains just the icons we use.
If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator:
1. Go to <https://icomoon.io/app/>.
2. Click `Import Icons` on the top-horizontal-bar and upload the existing `<jekyll>/docs/icomoon-selection.json`.
3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome'.
4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library).
5. Click `Generate Font` on the bottom-horizontal-bar.
6. Inspect the included icons and proceed by clicking `Download`.
7. Extract the font files and adapt the CSS to the paths we use in Jekyll:
- Copy the entire `fonts` directory over and overwrite existing ones at `<jekyll>/docs/`.
- Copy the contents of `selection.json` and overwrite existing content inside `<jekyll>/docs/icomoon-selection.json`.
- Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the
`<jekyll>/docs/_sass/_font-awesome.scss` sass partial.
- Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so:
`('../fonts/Fontawesome.woff?9h6hxj')`.
### Adding plugins
If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type.
If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type.
## Code Contributions
@@ -100,7 +80,7 @@ Any time you propose a code change, you should also include updates to the docum
#### Documentation
If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `docs/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated.
If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `site/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated.
#### Tests

View File

@@ -22,8 +22,6 @@ Metrics/BlockLength:
Exclude:
- test/**/*.rb
- lib/jekyll/configuration.rb
- rake/*.rake
- jekyll.gemspec
Metrics/ClassLength:
Exclude:
- !ruby/regexp /features\/.*.rb$/
@@ -34,8 +32,6 @@ Metrics/CyclomaticComplexity:
Metrics/LineLength:
Exclude:
- !ruby/regexp /features\/.*.rb/
- Rakefile
- rake/*.rake
Max: 90
Severity: warning
Metrics/MethodLength:
@@ -43,19 +39,13 @@ Metrics/MethodLength:
Max: 20
Severity: error
Metrics/ModuleLength:
Exclude:
- lib/jekyll/filters.rb
Max: 240
Metrics/ParameterLists:
Max: 4
Metrics/PerceivedComplexity:
Max: 8
Security/MarshalLoad:
Exclude:
- !ruby/regexp /test\/.*.rb$/
- lib/jekyll/regenerator.rb
Security/YAMLLoad:
Exclude:
- !ruby/regexp /features\/.*.rb/
- !ruby/regexp /test\/.*.rb$/
Style/Alias:
Enabled: false
Style/AlignArray:
@@ -139,7 +129,5 @@ Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/UnneededCapitalW:
Enabled: false

View File

@@ -5,10 +5,10 @@ language: ruby
sudo: false
rvm:
- &ruby1 2.3.3
- &ruby2 2.2.6
- &ruby1 2.3.1
- &ruby2 2.2.5
- &ruby3 2.1.9
- &jruby jruby-9.1.7.0
- &jruby jruby-9.1.2.0
matrix:
include:
@@ -28,7 +28,6 @@ branches:
only:
- master
- themes
- 3.4-stable*
notifications:
slack:
@@ -46,6 +45,3 @@ addons:
DA4vsRURfABU0fIhwYkQuZqEcA3d8TL36BZcGEshG6MQ2AmnYsmFiTcxqV5bmlElHEqQuT\
5SUFXLafgZPBnL0qDwujQcHukID41sE=\
"
# regular test configuration
after_success:
- bundle exec codeclimate-test-reporter

65
Gemfile
View File

@@ -1,10 +1,10 @@
source "https://rubygems.org"
gemspec :name => "jekyll"
gem "rake", "~> 12.0"
gem "rake", "~> 11.0"
# Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this.
gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < "2.2.2"
gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < '2.2.2'
group :development do
gem "launchy", "~> 2.3"
@@ -18,15 +18,15 @@ end
#
group :test do
gem "codeclimate-test-reporter", "~> 1.0.5"
gem "rubocop", "~> 0.44.1"
gem "cucumber", "~> 2.1"
gem "jekyll_test_plugin"
gem "jekyll_test_plugin_malicious"
gem "codeclimate-test-reporter"
gem "rspec-mocks"
gem "nokogiri"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 0.47"
gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
end
@@ -34,66 +34,63 @@ end
#
group :test_legacy do
if RUBY_PLATFORM =~ %r!cygwin! || RUBY_VERSION.start_with?("2.2")
gem "test-unit"
if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2")
gem 'test-unit'
end
gem "minitest"
gem "minitest-profile"
gem "minitest-reporters"
gem "redgreen"
gem "shoulda"
gem "simplecov"
gem "minitest-reporters"
gem "minitest-profile"
gem "minitest"
gem "shoulda"
end
#
group :benchmark do
if ENV["BENCHMARK"]
gem "benchmark-ips"
gem "rbtrace"
gem "ruby-prof"
gem "benchmark-ips"
gem "stackprof"
gem "rbtrace"
end
end
#
group :jekyll_optional_dependencies do
gem "coderay", "~> 1.1.0"
gem "jekyll-coffeescript"
gem "jekyll-docs", :path => "../docs" if Dir.exist?("../docs") && ENV["JEKYLL_VERSION"]
gem "jekyll-feed"
gem "jekyll-gist"
gem "jekyll-paginate"
gem "jekyll-redirect-from"
gem "kramdown", "~> 1.9"
gem "mime-types", "~> 3.0"
gem "rdoc", "~> 5.0"
gem "toml", "~> 0.1.0"
gem "coderay", "~> 1.1.0"
gem "jekyll-docs", :path => '../docs' if Dir.exist?('../docs') && ENV['JEKYLL_VERSION']
gem "jekyll-gist"
gem "jekyll-feed"
gem "jekyll-coffeescript"
gem "jekyll-redirect-from"
gem "jekyll-paginate"
gem "mime-types", "~> 3.0"
gem "kramdown", "~> 1.9"
gem "rdoc", "~> 4.2"
platform :ruby, :mswin, :mingw, :x64_mingw do
gem "classifier-reborn", "~> 2.1.0"
gem "liquid-c", "~> 3.0"
gem "pygments.rb", "~> 0.6.0"
gem "rdiscount", "~> 2.0"
gem "pygments.rb", "~> 0.6.0"
gem "redcarpet", "~> 3.2", ">= 3.2.3"
gem "classifier-reborn", "~> 2.0"
gem "liquid-c", "~> 3.0"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", :platforms => [:mingw, :mswin, :x64_mingw, :jruby]
end
#
group :site do
if ENV["PROOF"]
gem "html-proofer", "~> 3.4"
gem "html-proofer", "~> 2.0"
end
gem "jemoji", "0.5.1"
gem "jekyll-sitemap"
gem "jekyll-seo-tag"
gem "jekyll-avatar"
gem "jekyll-mentions"
gem "jekyll-seo-tag"
gem "jekyll-sitemap"
gem "jemoji"
end

View File

@@ -1,146 +1,8 @@
## 3.4.5 / 2017-06-30
* Backport #6185 for v3.4.x: Always normalize the result of the `relative_url` filter (#6186)
## 3.4.4 / 2016-06-17
* Backport #6137 for v3.4.x: Default `baseurl` to `nil` instead of empty string (#6146)
## 3.4.3 / 2017-03-21
* Backport #5957 for v3.4.x: Allow colons in `uri_escape` filter (#5968)
## 3.4.2 / 2017-03-09
* Backport #5871 for v3.4.x: Convert StaticFile liquid representation to
a Drop & add front matter defaults support to StaticFiles (#5940)
## 3.4.1 / 2017-03-02
* Backport #5920 for v3.4.x: Allow abbreviated post dates (#5924)
## 3.4.0 / 2016-01-27
### Minor Enhancements
* Add connector param to `array_to_sentence_string` filter (#5597)
* Adds `group_by_exp` filter (#5513)
* Use Addressable instead of URI to decode (#5726)
* throw IncludeTagError if error occurs in included file (#5767)
* Write Jekyll::Utils::Exec.run for running shell commands. (#5640)
* Use the current year for the LICENSE of theme (#5712)
* Update License (#5713)
### Bug Fixes
* Escaped regular expressions when using `post_url`. (#5605)
* fix date parsing in file names to be stricter (#5609)
* Add a module to re-define `ENV["TZ"]` in Windows (#5612)
* Use each instead of map to actually return nothing (#5668)
* include: fix 'no implicit conversion of nil to String' (#5750)
* Don't include the theme's includes_path if it is nil. (#5780)
* test double slash when input = '/' (#5542)
* use logger.info for related posts (#5822)
## HEAD
### Site Enhancements
* Use only the used Font Awesome icons. (#5530)
* Switch to `https` when possible. (#5611)
* Update `_font-awesome.scss` to move .woff file before .ttf (#5614)
* Update documentation on updating FontAwesome Iconset (#5655)
* [site] Use defaults for docs and news-items (#5744)
* Sort gems in `docs/_config.yml` (#5746)
* Add missing class (#5791)
* Improve template docs (#5694)
### Development Fixes
* clean unit-test names in `test/test_tags.rb` (#5608)
* Add cucumber feature to test for bonafide theme gems (#5384)
* Use `assert_nil` instead of `assert_equal nil` (#5652)
* Rubocop -a on lib/jekyll (#5666)
* Bump to rake 12.0 (#5670)
* Rubocop Gemfile (#5671)
* update Classifier-Reborn to 2.1.0 (#5711)
* Rubocop: fix Rakefile and gemspec (#5745)
* Use `assert_nil` (#5725)
* Sort gems in `jekyll.gemspec` (#5746)
* Rubocop: Require consistent comma in multiline literals (#5761)
* Bump rubocop (#5765)
* New rubocop security checks (#5768)
* test/helper: fix flaky plugin path test by removing calls to Dir.chdir without a block (#5779)
* Use latest jemoji gem (#5782)
* Bump htmlproofer (#5781)
* Bump rubies we test against (#5784)
* Bump rdoc to v5.0 (#5797)
* Bump codeclimate-test-reporter to v1.0.5 (#5798)
### Documentation
* Improve quickstart docs (#5689)
* Add Jekyll-Post to list of plugins (#5705)
* Add jekyll-numbered-headings (#5688)
* Docs: move permalinks from documents into config (#5544)
* Improve collections docs (#5691)
* Fix #5730: add gcc and make to the list of requirements (#5731)
* Remove instructions to install Jekyll 2 on Windows (#5582)
* Fix example URL inconsistency (#5592)
* Replace backticks within HTML blocks with HTML tags (#5435)
* Add jekyll-migrate-permalink (#5600)
* Fix bad config YAML in collections example (#5587)
* Bring documentation on 'Directory Structure' up-to-date (#5573)
* Fixed typo (#5632)
* use backticks for Gemfile for consistency since in the next sentence … (#5641)
* Update Core team list in the README file (#5643)
* Improve Permalinks documentation. (#5653)
* Fix typo in Variables doc page (#5657)
* Fix a couple of typos in the docs (#5658)
* Update windows.md (#5683)
* Improve permalinks docs (#5693)
* Document --unpublished build option (#5720)
* Improve pages docs (#5692)
* Added new includes.md topic to docs (#5696)
* Replace a dead link with a web-archived one (#5738)
* Remove duplicate paragraph. (#5740)
* Addition of a sample "typical post" (#5473)
* Fix a minor grammatical mistake on themes' document ### -dev (#5748)
* Correct comments in data_reader.rb (#5621)
* Add jekyll-pre-commit to plugins list (#5752)
* Update quickstart.md (#5758)
* Correct minor typo (#5764)
* Fix a markdown link to look properly on the web (#5769)
* [docs] Info about the help command usage (#5312)
* Add missing merge labels for jekyllbot (#5753)
* Fix broken links in documentation (#5736)
* Docs: add `match_regex` and `replace_regex` filters (#5799)
* Got that diaper money? (#5810)
* Sort content by popularity using Google Analytics (#5812)
* Rework CI doc to include multiple providers. (#5815)
* Improve theme docs (#5690)
* Add mention of classifier-reborn for LSI (#5811)
* Added note about --blank flag (#5802)
* Fixed inaccuracy in "Built-in permalink styles" docs (#5819)
## 3.3.1 / 2016-11-14
### Minor Enhancements
* Collapse `gsub` for performance (#5494)
* URL: warn if key doesn't exist in url drop (#5524)
### Bug Fixes
* Fix typo in `theme_template` README (#5472)
* Do not swallow all exceptions on render (#5495)
* Site template: fixed `_config.yml` comment typo (#5511)
* `jekyll new-theme` should specify Jekyll as a runtime dependency for the theme (#5457)
* Be much more specific about ignoring specific vendored directories. (#5564)
* Only warn about auto-regeneration bug on Bash On Windows. (#5464)
* Allow permalink template to have underscores (#5572)
### Site Enhancements
* Documentation: `link` Liquid tag (#5449)
* 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)
@@ -148,32 +10,21 @@
* Add jekyll-include-absolute-plugin to list of third-party plugins (#5492)
* Remove jekyll-hook from deployment methods (#5502)
* Update deployment-methods.md (#5504)
* Ubuntu users should install ruby2.3-dev (#5512)
* Remove Glynn as deployment option (#5519)
* Fix broken forum link (#5466)
* Move documentation to docs folder (#5459)
* Fix broken links in CONTRIBUTING (#5533)
* Update documentation on jekyllrb.com (#5540)
* Fix HTML rendering (#5536)
* Remove outdated deployment information (#5557)
* no more invalid US-ASCII on lines 30 and 97 (#5520)
* Add permalinks to docs in '/maintaining/' (#5532)
* Add jekyll-pinboard to list of third-party plugins (#5514)
* Fix formatting in 2-to-3.md (#5507)
* Add two plugins to the plugins page (#5493)
* Use site.baseurl before link and post_url tags (#5559)
* Fix link to jekyll-pinboard plugin (#5570)
* mention `docs` folder as a way to deploy on GitHub Pages (#5571)
### 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)
* include a hashbang for all benchmark scripts & make them executable (#5505)
* Update source in script/proof (#5538)
* Collections.feature: conditional steps to have it pass on Windows (#5546)
* Fix tests to get script/test to pass on Windows (#5526)
### Minor Enhancements
* Collapse `gsub` (#5494)
## 3.3.0 / 2016-10-06

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2008-2017 Tom Preston-Werner and Jekyll contributors
Copyright (c) 2008-2016 Tom Preston-Werner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -43,7 +43,8 @@ conduct.
Please adhere to this code of conduct in any interactions you have in the
Jekyll community. It is strictly enforced on all official Jekyll
repositories, websites, and resources. If you encounter someone violating
these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), [@mattr-](https://github.com/mattr-), or [@alfredxing](https://github.com/alfredxing)) know and we will address it as soon as possible.
these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), or [@mattr-](https://github.com/mattr-)) know
and we will address it as soon as possible.
## Diving In

View File

@@ -1,13 +1,13 @@
require "rubygems"
require "rake"
require "rdoc"
require "date"
require "yaml"
require 'rubygems'
require 'rake'
require 'rdoc'
require 'date'
require 'yaml'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
require "jekyll/version"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
require 'jekyll/version'
Dir.glob("rake/**.rake").each { |f| import f }
Dir.glob('rake/**.rake').each { |f| import f }
#############################################################################
#
@@ -27,30 +27,26 @@ def docs_name
"#{name}-docs"
end
def docs_folder
"docs"
end
def gemspec_file
"#{name}.gemspec"
end
def gem_file
"#{name}-#{Gem::Version.new(version)}.gem"
"#{name}-#{Gem::Version.new(version).to_s}.gem"
end
def normalize_bullets(markdown)
markdown.gsub(%r!\n\s{2}\*{1}!, "\n-")
markdown.gsub(/\n\s{2}\*{1}/, "\n-")
end
def linkify_prs(markdown)
markdown.gsub(%r!#(\d+)!) do |word|
markdown.gsub(/#(\d+)/) do |word|
"[#{word}]({{ site.repository }}/issues/#{word.delete("#")})"
end
end
def linkify_users(markdown)
markdown.gsub(%r!(@\w+)!) do |username|
markdown.gsub(/(@\w+)/) do |username|
"[#{username}](https://github.com/#{username.delete("@")})"
end
end
@@ -60,13 +56,13 @@ def linkify(markdown)
end
def liquid_escape(markdown)
markdown.gsub(%r!(`{[{%].+[}%]}`)!, "{% raw %}\\1{% endraw %}")
markdown.gsub(/(`{[{%].+[}%]}`)/, "{% raw %}\\1{% endraw %}")
end
def custom_release_header_anchors(markdown)
header_regexp = %r!^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}!
section_regexp = %r!^### \w+ \w+$!
markdown.split(%r!^##\s!).map do |release_notes|
header_regexp = /^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}/
section_regexp = /^### \w+ \w+$/
markdown.split(/^##\s/).map do |release_notes|
_, major, minor, patch = *release_notes.match(header_regexp)
release_notes
.gsub(header_regexp, "\\0\n{: #v\\1-\\2-\\3}")
@@ -75,11 +71,11 @@ def custom_release_header_anchors(markdown)
end
def sluffigy(header)
header.delete("#").strip.downcase.gsub(%r!\s+!, "-")
header.gsub(/#/, '').strip.downcase.gsub(/\s+/, '-')
end
def remove_head_from_history(markdown)
index = markdown =~ %r!^##\s+\d+\.\d+\.\d+!
index = markdown =~ /^##\s+\d+\.\d+\.\d+/
markdown[index..-1]
end
@@ -88,28 +84,25 @@ def converted_history(markdown)
custom_release_header_anchors(
liquid_escape(
linkify(
normalize_bullets(markdown)
)
)
)
)
normalize_bullets(markdown)))))
end
def siteify_file(file, overrides_front_matter = {})
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exist?(file)
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file)
title = begin
File.read(file).match(%r!\A# (.*)$!)[1]
File.read(file).match(/\A# (.*)$/)[1]
rescue
File.basename(file, ".*").downcase.capitalize
end
slug = File.basename(file, ".markdown").downcase
front_matter = {
"title" => title,
"layout" => "docs",
"permalink" => "/docs/#{slug}/",
"note" => "This file is autogenerated. Edit /#{file} instead."
}.merge(overrides_front_matter)
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
File.write("#{docs_folder}/_docs/#{slug}.md", contents)
File.write("site/_docs/#{slug}.md", contents)
end
def content_for(file)
@@ -118,7 +111,7 @@ def content_for(file)
when "History.markdown"
converted_history(contents)
else
contents.gsub(%r!\A# .*\n\n?!, "")
contents.gsub(/\A# .*\n\n?/, "")
end
end
@@ -131,23 +124,23 @@ end
multitask :default => [:test, :features]
task :spec => :test
require "rake/testtask"
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << "lib" << "test"
test.pattern = "test/**/test_*.rb"
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
require "rdoc/task"
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = "rdoc"
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
rdoc.rdoc_files.include("README*")
rdoc.rdoc_files.include("lib/**/*.rb")
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
begin
require "cucumber/rake/task"
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.profile = "travis"
end
@@ -155,9 +148,9 @@ begin
t.profile = "html_report"
end
rescue LoadError
desc "Cucumber rake task not available"
desc 'Cucumber rake task not available'
task :features do
abort "Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin"
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end

1
benchmark/capture-assign.rb Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require "liquid"
require "benchmark/ips"

1
benchmark/end-with-vs-regexp Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
Benchmark.ips do |x|

0
benchmark/file-dir-ensure-trailing-slash Executable file → Normal file
View File

1
benchmark/flat-map Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
enum = (0..50).to_a

1
benchmark/hash-fetch Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
h = {:bar => 'uco'}

0
benchmark/jekyll-sanitize-path Executable file → Normal file
View File

1
benchmark/proc-call-vs-yield Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
def fast

0
benchmark/regexp-vs-include.rb Executable file → Normal file
View File

1
benchmark/sequential-assignment Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
Benchmark.ips do |x|

3
benchmark/string-concat Executable file → Normal file
View File

@@ -1,7 +1,6 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
url = "https://jekyllrb.com"
url = "http://jekyllrb.com"
Benchmark.ips do |x|
x.report('+=') { url += '/' }

1
benchmark/string-replacement Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
def str

1
benchmark/symbol-to-proc Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
Benchmark.ips do |x|

View File

@@ -1,92 +0,0 @@
---
title: "CircleCI"
---
Building, testing, and deploying your Jekyll-generated website can quickly be done with [CircleCI][0], a continuous integration & delivery tool. CircleCI supports [GitHub][1] and [Bitbucket][2], and you can get started for free using an open-source or private repository.
[0]: https://circleci.com/
[1]: https://github.com/
[2]: https://bitbucket.org/
## 1. Follow Your Project on CircleCI
To start building your project on CircleCI, all you need to do is 'follow' your project from CircleCI's website:
1. Visit the 'Add Projects' page: <https://circleci.com/add-projects>
1. From the GitHub or Bitbucket tab on the left, choose a user or organization.
1. Find your project in the list and click 'Build project' on the right.
1. The first build will start on its own. You can start telling CircleCI how to build your project by creating a [circle.yml][3] file in the root of your repository.
[3]: https://circleci.com/docs/configuration/
## 2. Dependencies
The easiest way to manage dependencies for a Jekyll project (with or without CircleCI) is via a [Gemfile][4]. You'd want to have Jekyll, any Jekyll plugins, [HTML Proofer](#html-proofer), and any other gems that you are using in the `Gemfile`. Don't forget to version `Gemfile.lock` as well. Here's an example `Gemfile`:
[4]: http://bundler.io/gemfile.html
```yaml
source 'https://rubygems.org'
ruby '2.4.0'
gem 'jekyll'
gem 'html-proofer'
```
CircleCI detects when `Gemfile` is present is will automatically run `bundle install` for you in the `dependencies` phase.
## 3. Testing
The most basic test that can be run is simply seeing if `jekyll build` actually works. This is a blocker, a dependency if you will, for other tests you might run on the generate site. So we'll run Jekyll, via Bundler, in the `dependencies` phase.
```
dependencies:
post:
- bundle exec jekyll build
```
### HTML Proofer
With your site built, it's useful to run tests to check for valid HTML, broken links, etc. There's a few tools out there but [HTML Proofer][5] is popular amongst Jekyll users. We'll run it in the `test` phase with a few preferred flags. Check out the `html-proofer` [README][6] for all available flags, or run `htmlproofer --help` locally.
[5]: https://github.com/gjtorikian/html-proofer
[6]: https://github.com/gjtorikian/html-proofer/blob/master/README.md#configuration
```yaml
test:
post:
- bundle exec htmlproofer ./_site --check-html --disable-external
```
## Complete Example circle.yml File
When you put it all together, here's an example of what that `circle.yml` file could look like:
```
machine:
environment:
NOKOGIRI_USE_SYSTEM_LIBRARIES: true # speeds up installation of html-proofer
dependencies:
post:
- bundle exec jekyll build
test:
post:
- bundle exec htmlproofer ./_site --allow-hash-href --check-favicon --check-html --disable-external
deployment:
prod:
branch: master
commands:
- rsync -va --delete ./_site username@my-website:/var/html
```
## Questions?
This entire guide is open-source. Go ahead and [edit it][7] if you have a fix or [ask for help][8] if you run into trouble and need some help. CircleCI also has an [online community][9] for help.
[7]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/circleci.md
[8]: https://jekyllrb.com/help/
[9]: https://discuss.circleci.com

View File

@@ -1,9 +0,0 @@
---
title: Continuous Integration
permalink: /docs/continuous-integration/
---
Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:
* [Travis CI](travis-ci)
* [CircleCI](circleci)

View File

@@ -1,167 +0,0 @@
---
title: Includes
permalink: /docs/includes/
---
The `include` tag allows you to include the content from another file stored in the `_includes` folder:
```liquid
{% raw %}{% include footer.html %}{% endraw %}
```
Jekyll will look for the referenced file (in this case, `footer.html`) in the `_includes` directory at the root of your source directory and insert its contents.
### Including files relative to another file
You can choose to include file fragments relative to the current file by using the `include_relative` tag:
```liquid
{% raw %}{% include_relative somedir/footer.html %}{% endraw %}
```
You won't need to place your included content within the `_includes` directory. Instead,
the inclusion is specifically relative to the file where the tag is being used. For example,
if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file
must be within the `_posts` directory or one of its subdirectories.
Note that you cannot use the `../` syntax to specify an include location that refers to a higher-level directory.
All the other capabilities of the `include` tag are available to the `include_relative` tag,
such as variables.
### Using variables names for the include file
The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's front matter like this:
```yaml
---
title: My page
my_variable: footer_company_a.html
---
```
You could then reference that variable in your include:
```liquid
{% raw %}{% include {{ page.my_variable }} %}{% endraw %}
```
In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory.
### Passing parameters to includes
You can also pass parameters to an include. For example, suppose you have a file called `note.html` in your `_includes` folder that contains this formatting:
```liquid
{% raw %}<div markdown="span" class="alert alert-info" role="alert">
<i class="fa fa-info-circle"></i> <b>Note:</b>
{{ include.content }}
</div>{% endraw %}
```
The `{% raw %}{{ include.content }}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this:
```liquid
{% raw %}{% include note.html content="This is my sample note." %} {% endraw %}
```
The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter.
Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content.
For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you might want to populate with an include:
```html
<figure>
<a href="http://jekyllrb.com">
<img src="logo.png" style="max-width: 200px;"
alt="Jekyll logo" />
<figcaption>This is the Jekyll logo</figcaption>
</figure>
```
You could templatize this content in your include and make each value available as a parameter, like this:
```liquid
{% raw %}<figure>
<a href="{{ include.url }}">
<img src="{{ include.file }}" style="max-width: {{ include.max-width }};"
alt="{{ include.alt }}"/>
<figcaption>{{ include.caption }}</figcaption>
</figure>{% endraw %}
```
This include contains 5 parameters:
* `url`
* `max-width`
* `file`
* `alt`
* `caption`
Here's an example that passes all the parameters to this include (the include file is named `image.html`):
```liquid
{% raw %}{% include image.html url="http://jekyllrb.com"
max-width="200px" file="logo.png" alt="Jekyll logo"
caption="This is the Jekyll logo." %} {% endraw %}
```
The result is the original HTML code shown earlier.
To safeguard situations where users don't supply a value for the parameter, you can use [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default).
Overall, you can create includes that act as templates for a variety of uses &mdash; inserting audio or video clips, alerts, special formatting, and more. However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.)
### Passing parameter variables to includes
Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.)
The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %}
If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable:
```liquid
{% raw %}{% capture download_note %}The latest version of
{{ site.product_name }} is now available.{% endcapture %}{% endraw %}
```
Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable):
```liquid
{% raw %}{% include note.html content=download_note %}{% endraw %}
```
### Passing references to YAML files as parameter values
Instead of passing string variables to the include, you can pass a reference to a YAML data file stored in the `_data` folder.
Here's an example. In the `_data` folder, suppose you have a YAML file called `profiles.yml`. Its content looks like this:
```yaml
- name: John Doe
login_age: old
image: johndoe.jpg
- name: Jane Doe
login_age: new
image: janedoe.jpg
```
In the `_includes` folder, assume you have a file called `spotlight.html` with this code:
```liquid
{% raw %}{% for person in {{ include.participants }} %}
{% if person.login_age == "new" %}
{{ person.name }}
{% endif %}
{% endfor %}{% endraw %}
```
Now when you insert the `spotlight.html` include file, you can submit the YAML file as a parameter:
```
{% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %}
```
In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include file, and the Liquid logic processes. The result will be `Jane Doe`.

View File

@@ -1,20 +0,0 @@
---
title: Maintaining Jekyll
permalink: /docs/maintaining/
---
**This guide is for Jekyll contributors and maintainers.** These special people contribute to one or more of Jekyll's repositories or help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
Hello! This is where we document various processes for maintaining Jekyll. Being a maintainer for any Jekyll project is a big responsibility, so we put together some helpful documentation for various tasks you might do as a maintainer.
1. [Affinity teams & their captains](affinity-team-captain/)
2. [Triaging and issue](triaging-an-issue/)
3. [Reviewing a pull request](reviewing-a-pull-request/)
4. [Merging a pull request](merging-a-pull-request/)
5. [Avoiding burnout](avoiding-burnout/)
6. [Special Labels](special-labels/)
Interested in becoming a maintainer? Here is some documentation for **contributors**:
1. [Becoming a maintainer](becoming-a-maintainer/)

View File

@@ -1,74 +0,0 @@
---
title: Creating pages
permalink: /docs/pages/
---
In addition to [writing posts](../posts/), you might also want to add static pages (content that isn't date-based) to your Jekyll site. By taking advantage of the way Jekyll copies files and directories, this is easy to do.
## Homepage
Just about every web server configuration you come across will look for an HTML
file called `index.html` (by convention) in the site's root folder and display
that as the homepage. Unless the web server youre using is configured to look
for some different filename as the default, this file will turn into the
homepage of your Jekyll-generated site.
<div class="note">
<h5>ProTip™: Use layouts on your homepage</h5>
<p>
Any HTML file on your site can use layouts and/or includes, even the
homepage. Common content, like headers and footers, make excellent
candidates for extraction into a layout.
</p>
</div>
## Where additional pages live
Where you put HTML or [Markdown](https://daringfireball.net/projects/markdown/)
files for pages depends on how you want the pages to work. There are two main ways of creating pages:
- Place named HTML or [Markdown](https://daringfireball.net/projects/markdown/)
files for each page in your site's root folder.
- Place pages inside folders and subfolders named whatever you want.
Both methods work fine (and can be used in conjunction with each other),
with the only real difference being the resulting URLs. By default, pages retain the same folder structure in `_site` as they do in the source directory.
### Named HTML files
The simplest way of adding a page is just to add an HTML file in the root
directory with a suitable name for the page you want to create. For a site with
a homepage, an about page, and a contact page, heres what the root directory
and associated URLs might look like:
```sh
.
|-- _config.yml
|-- _includes/
|-- _layouts/
|-- _posts/
|-- _site/
|-- about.html # => http://example.com/about.html
|-- index.html # => http://example.com/
|-- other.md # => http://example.com/other.html
└── contact.html # => http://example.com/contact.html
```
If you have a lot of pages, you can organize those pages into subfolders. The same subfolders that are used to group your pages in our project's source will exist in the `_site` folder when your site builds.
## Flattening pages from subfolders into the root directory
If you have pages organized into subfolders in your source folder and want to flatten them in the root folder on build, you must add the [permalink]({% link _docs/permalinks.md %}) property directly in your page's front matter like this:
```
---
title: My page
permalink: mypageurl.html
---
```
### Named folders containing index HTML files
If you don't want file extensions (`.html`) to appear in your page URLs (file extensions are the default), you can choose a [permalink style](../permalinks/#builtinpermalinkstyles) that has a trailing slash instead of a file extension.
Note if you want to view your site offline *without the Jekyll preview server*, your browser will need the file extension to display the page, and all assets will need to be relative links that function without the server baseurl.

View File

@@ -1,367 +0,0 @@
---
title: Permalinks
permalink: /docs/permalinks/
---
Permalinks refer to the URLs (excluding the domain name or directory folder) for your pages, posts, or collections.
Jekyll supports a flexible way to build permalinks, allowing you to leverage various template variables or choose built-in permalink styles (such as `date`) that automatically use a template-variable pattern.
You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title.html`. Each of the colon-prefixed keywords is a template variable.
## Where to configure permalinks
You can configure your site's permalinks through the [Configuration]({% link _docs/configuration.md %}) file or in the [Front Matter]({% link _docs/frontmatter.md %}) for each post, page, or collection.
Setting permalink styles in your configuration file applies the setting globally in your project. You configure permalinks in your `_config.yml` file like this:
```yaml
permalink: /:categories/:year/:month/:day/:title.html
```
If you don't specify any permalink setting, Jekyll uses the above pattern as the default.
The permalink can also be set using a built-in permalink style:
```yaml
permalink: date
```
`date` is the same as `:categories/:year/:month/:day/:title.html`, the default. See [Built-in Permalink Styles](#builtinpermalinkstyles) below for more options.
Setting the permalink in your post, page, or collection's front matter overrides any global settings. Here's an example:
```yaml
---
title: My page title
permalink: /mypageurl/
---
```
Even if your configuration file specifies the `date` style, the URL for this page would be `http://somedomain.com/mypageurl/`.
When you use permalinks that omit the `.html` file extension (called "pretty URLs") Jekyll builds the file as index.html placed inside a folder with the page's name. For example:
```
├── mypageurl
│   └── index.html
```
With a URL such as `/mypageurl/`, servers automatically load the index.html file inside the folder, so users can simply navigate to `http://somedomain.com/mypageurl/` to get to `mypageurl/index.html`.
## Template variables for permalinks {#template-variables}
The following table lists the template variables available for permalinks. You can use these variables in the `permalink` property in your config file.
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>year</code></p>
</td>
<td>
<p>Year from the post's filename</p>
</td>
</tr>
<tr>
<td>
<p><code>month</code></p>
</td>
<td>
<p>Month from the post's filename</p>
</td>
</tr>
<tr>
<td>
<p><code>i_month</code></p>
</td>
<td>
<p>Month from the post's filename without leading zeros.</p>
</td>
</tr>
<tr>
<td>
<p><code>day</code></p>
</td>
<td>
<p>Day from the post's filename</p>
</td>
</tr>
<tr>
<td>
<p><code>i_day</code></p>
</td>
<td>
<p>Day from the post's filename without leading zeros.</p>
</td>
</tr>
<tr>
<td>
<p><code>short_year</code></p>
</td>
<td>
<p>Year from the post's filename without the century.</p>
</td>
</tr>
<tr>
<td>
<p><code>hour</code></p>
</td>
<td>
<p>
Hour of the day, 24-hour clock, zero-padded from the post's <code>date</code> front matter. (00..23)
</p>
</td>
</tr>
<tr>
<td>
<p><code>minute</code></p>
</td>
<td>
<p>
Minute of the hour from the post's <code>date</code> front matter. (00..59)
</p>
</td>
</tr>
<tr>
<td>
<p><code>second</code></p>
</td>
<td>
<p>
Second of the minute from the post's <code>date</code> front matter. (00..59)
</p>
</td>
</tr>
<tr>
<td>
<p><code>title</code></p>
</td>
<td>
<p>
Title from the documents filename. May be overridden via
the documents <code>slug</code> YAML front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>slug</code></p>
</td>
<td>
<p>
Slugified title from the documents filename (any character
except numbers and letters is replaced as hyphen). May be
overridden via the documents <code>slug</code> YAML front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>categories</code></p>
</td>
<td>
<p>
The specified categories for this post. If a post has multiple
categories, Jekyll will create a hierarchy (e.g. <code>/category1/category2</code>).
Also Jekyll automatically parses out double slashes in the URLs,
so if no categories are present, it will ignore this.
</p>
</td>
</tr>
</tbody>
</table>
</div>
Note that all template variables relating to time or categories are available to posts only.
## Built-in permalink styles {#builtinpermalinkstyles}
Although you can specify a custom permalink pattern using [template variables](#template-variables), Jekyll also provides the following built-in styles for convenience.
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Permalink Style</th>
<th>URL Template</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>date</code></p>
</td>
<td>
<p><code>/:categories/:year/:month/:day/:title.html</code></p>
</td>
</tr>
<tr>
<td>
<p><code>pretty</code></p>
</td>
<td>
<p><code>/:categories/:year/:month/:day/:title/</code></p>
</td>
</tr>
<tr>
<td>
<p><code>ordinal</code></p>
</td>
<td>
<p><code>/:categories/:year/:y_day/:title.html</code></p>
</td>
</tr>
<tr>
<td>
<p><code>none</code></p>
</td>
<td>
<p><code>/:categories/:title.html</code></p>
</td>
</tr>
</tbody>
</table>
</div>
Rather than typing `permalink: /:categories/:year/:month/:day/:title/`, you can just type `permalink: pretty`.
<div class="note info">
<h5>Specifying permalinks through the YAML Front Matter</h5>
<p>Built-in permalink styles are not recognized in YAML Front Matter. As a result, <code>permalink: pretty</code> will not work.</p>
</div>
## Permalink style examples with posts {#permalink-style-examples}
Here are a few examples to clarify how permalink styles get applied with posts.
Given a post named: `/2009-04-29-slap-chop.md`
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>URL Template</th>
<th>Resulting Permalink URL</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>None specified, or <code>permalink: date</code></p>
</td>
<td>
<p><code>/2009/04/29/slap-chop.html</code></p>
</td>
</tr>
<tr>
<td>
<p><code>pretty</code></p>
</td>
<td>
<p><code>/2009/04/29/slap-chop/</code></p>
</td>
</tr>
<tr>
<td>
<p><code>/:month-:day-:year/:title.html</code></p>
</td>
<td>
<p><code>/04-29-2009/slap-chop.html</code></p>
</td>
</tr>
<tr>
<td>
<p><code>/blog/:year/:month/:day/:title/</code></p>
</td>
<td>
<p><code>/blog/2009/04/29/slap-chop/</code></p>
</td>
</tr>
<tr>
<td>
<p><code>/:year/:month/:title</code></p>
<p>See <a href="#extensionless-permalinks">Extensionless permalinks with no trailing slashes</a> for details.</p>
</td>
<td>
<p><code>/2009/04/slap-chop</code></p>
</td>
</tr>
</tbody>
</table>
</div>
## Permalink settings for pages and collections {#pages-and-collections}
The permalink setting in your configuration file specifies the permalink style used for posts, pages, and collections. However, because pages and collections don't have time or categories, these aspects of the permalink style are ignored with pages and collections.
For example:
* A permalink style of `/:categories/:year/:month/:day/:title.html` for posts becomes `/:title.html` for pages and collections.
* A permalink style of `pretty` (or `/:categories/:year/:month/:day/:title/`), which omits the file extension and contains a trailing slash, will update page and collection permalinks to also omit the file extension and contain a trailing slash: `/:title/`.
* A permalink style of `date`, which contains a trailing file extension, will update page permalinks to also contain a trailing file extension: `/:title.html`. But no time or category information will be included.
## Permalinks and default paths
The path to the post or page in the built site differs for posts, pages, and collections:
### Posts
The subfolders into which you may have organized your posts inside the `_posts` directory will not be part of the permalink.
If you use a permalink style that omits the `.html` file extension, each post is rendered as an `index.html` file inside a folder with the post's name (for example, `categoryname/2016/12/01/mypostname/index.html`).
### Pages
Unlike posts, pages by default mimic the source directory structure exactly. (The only exception is if your page has a `permalink` declared its front matter &mdash; in that case, the structure honors the permalink setting instead of the source folder structure.)
As with posts, if you use a permalink style that omits the `.html` file extension, each page is rendered as an `index.html` file inserted inside a folder with the page's name (for example, `mypage/index.html`).
### Collections
By default, collections follow a similar structure in the `_site` folder as pages, except that the path is prefaced by the collection name. For example: `collectionname/mypage.html`. For permalink settings that omit the file extension, the path would be `collection_name/mypage/index.html`.
Collections have their own way of setting permalinks. Additionally, collections have unique template variables available available (such as `path` and `output_ext`). See the [Configuring permalinks for collections](../collections/#permalinks) in Collections for more information.
## Flattening pages in \_site on build
If you want to flatten your pages (pull them out of subfolders) in the `_site` directory when your site builds (similar to posts), add the `permalink` property to the front matter of each page, with no path specified:
```
---
title: My page
permalink: mypageurl.html
---
```
## Extensionless permalinks with no trailing slashes {#extensionless-permalinks}
Jekyll supports permalinks that contain neither a trailing slash nor a file extension, but this requires additional support from the web server to properly serve. When using these types of permalinks, output files written to disk will still have the proper file extension (typically `.html`), so the web server must be able to map requests without file extensions to these files.
Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server handle these requests properly without any additional work.
### Apache
The Apache web server has extensive support for content negotiation and can handle extensionless URLs by setting the [multiviews](https://httpd.apache.org/docs/current/content-negotiation.html#multiviews) option in your `httpd.conf` or `.htaccess` file:
{% highlight apache %}
Options +MultiViews
{% endhighlight %}
### Nginx
The [try_files](http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files) directive allows you to specify a list of files to search for to process a request. The following configuration will instruct nginx to search for a file with an `.html` extension if an exact match for the requested URI is not found.
{% highlight nginx %}
try_files $uri $uri.html $uri/ =404;
{% endhighlight %}
## Linking without regard to permalink styles
You can create links in your topics to other posts, pages, or collection items in a way that is valid no matter what permalink configuration you choose. By using the `link` tag, if you change your permalinks, your links won't break. See [Linking to pages](../templates#link) in Templates for more details.

View File

@@ -1,51 +0,0 @@
---
title: Quick-start guide
permalink: /docs/quickstart/
---
If you already have a full [Ruby](https://www.ruby-lang.org/en/downloads/) development environment with all headers and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following:
```sh
# Install Jekyll and Bundler gems through RubyGems
~ $ gem install jekyll bundler
# Create a new Jekyll site at ./myblog
~ $ jekyll new myblog
# Change into your new directory
~ $ cd myblog
# Build the site on the preview server
~/myblog $ bundle exec jekyll serve
# Now browse to http://localhost:4000
```
If you encounter any unexpected errors during the above, please refer to the already-mentioned [requirements](/docs/installation/#requirements/) page, as you might be missing development headers or other prerequisites.
## About Bundler
`gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time &mdash; not every time you create a new Jekyll project. Here are some additional details:
* `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires.
* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your site. If your site doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`.
* When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts.
## Options for creating a new site with Jekyll
`jekyll new <PATH>` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details:
* To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`.
* `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.)
* By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view.
* We recommend setting up Jekyll with a gem-based theme but if you want to start with a blank slate, use `jekyll new myblog --blank`
* To learn about other parameters you can include with `jekyll new`, type `jekyll new --help`.
When in doubt, use the <code>help</code> command to remind you of all available options and usage, it also works with the <code>new</code>, <code>build</code> and <code>serve</code> subcommands, e.g. <code>jekyll help new</code> or <code>jekyll help build</code>.
{: .note .info }
## Next steps
Building a Jekyll site with the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available.

View File

@@ -1,238 +0,0 @@
---
title: Themes
permalink: /docs/themes/
---
Jekyll has an extensive theme system that allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes package up layouts, includes, and stylesheets in a way that can be overridden by your site's content.
## Understanding gem-based themes
When you [create a new Jekyll site](/docs/quickstart) (by running the `jekyll new <PATH>` command), Jekyll installs a site that uses a gem-based theme called [Minima](https://github.com/jekyll/minima).
With gem-based themes, some of the site's directories (such as the `assets`, `_layouts`, `_includes`, and `_sass` directories) are stored in the theme's gem, hidden from your immediate view. Yet all of the necessary directories will be read and processed during Jekyll's build process.
In the case of Minima, you see only the following files in your Jekyll site directory:
```
├── Gemfile
├── Gemfile.lock
├── _config.yml
├── _posts
│ └── 2016-12-04-welcome-to-jekyll.markdown
├── about.md
└── index.md
```
The `Gemfile` and `Gemfile.lock` files are used by Bundler to keep track of the required gems and gem versions you need to build your Jekyll site.
Gem-based themes make it easy for theme developers to make updates available to anyone who has the theme gem. When there's an update, theme developers push the update to RubyGems.
If you have the theme gem, you can (if you desire) run `bundle update` to update all gems in your project. Or you can run `bundle update <THEME>`, replacing `<THEME>` with the theme name, such as `minima`, to just update the theme gem. Any new files or updates the theme developer has made (such as to stylesheets or includes) will be pulled into your project automatically.
The goal of gem-based themes is to allow you to get all the benefits of a robust, continually updated theme without having all the theme's files getting in your way and over-complicating what might be your primary focus: creating content.
## Overriding theme defaults
Jekyll themes set default layouts, includes, and stylesheets. However, you can override any of the theme defaults with your own site content.
For example, if your selected theme has a `page` layout, you can override the theme's layout by creating your own `page` layout in the `_layouts` directory (that is, `_layouts/page.html`).
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`
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:
1. Run `bundle show` followed by the name of the theme's gem, e.g., `bundle show minima` for default Jekyll's theme.
This returns the location of the gem-based theme files. For example, Minima theme's files are located in `/usr/local/lib/ruby/gems/2.3.0/gems/minima-2.1.0` on macOS.
2. Open the theme's directory in Finder or Explorer:
```shell
# On MacOS
open $(bundle show minima)
# On Windows
explorer /usr/local/lib/ruby/gems/2.3.0/gems/minima-2.1.0
```
A Finder or Explorer window opens showing the theme's files and directories. The Minima theme gem contains these files:
```
├── LICENSE.txt
├── README.md
├── _includes
│   ├── disqus_comments.html
│   ├── footer.html
│   ├── google-analytics.html
│   ├── head.html
│   ├── header.html
│   ├── icon-github.html
│   ├── icon-github.svg
│   ├── icon-twitter.html
│   └── icon-twitter.svg
├── _layouts
│   ├── default.html
│   ├── home.html
│   ├── page.html
│   └── post.html
├── _sass
│   ├── minima
│   │   ├── _base.scss
│   │   ├── _layout.scss
│   │   └── _syntax-highlighting.scss
│   └── minima.scss
└── assets
└── main.scss
```
With a clear understanding of the theme's files, you can now override any theme file by creating a similarly named file in your Jekyll site directory.
Let's say you want to override Minima's footer. In your Jekyll site, create an `_includes` folder and add a file in it called `footer.html`. Jekyll will now use your site's `footer.html` file instead of the `footer.html` file from the Minima theme gem.
## Converting gem-based themes to regular themes
Suppose you want to get rid of the gem-based theme and convert it to a regular theme, where all files are present in your Jekyll site directory, with nothing stored in the theme gem.
To do this, copy the files from the theme gem's directory into your Jekyll site directory. (For example, copy them to `/myblog` if you created your Jekyll site at `/myblog`. See the previous section for details.)
Then remove references to the theme gem in `Gemfile` and configuration. For example, to remove `minima`:
- Open `Gemfile` and remove `gem "minima", "~> 2.0"`.
- Open `_config.yml` and remove `theme: minima`.
Now `bundle update` will no longer get updates for the theme gem.
## Installing a gem-based theme {#installing-a-theme}
The `jekyll new <PATH>` command isn't the only way to create a new Jekyll site with a gem-based theme. You can also find gem-based themes online and incorporate them into your Jekyll project.
For example, search for [jekyll theme on RubyGems](https://rubygems.org/search?utf8=%E2%9C%93&query=jekyll-theme) to find other gem-based themes. (Note that not all themes are using `jekyll-theme` as a convention in the theme name.)
To install a gem-based theme:
1. Add the theme to your site's `Gemfile`:
```sh
gem "jekyll-theme-awesome"
```
2. Install the theme:
```sh
bundle install
```
3. Add the following to your site's `_config.yml` to activate the theme:
```sh
theme: jekyll-theme-awesome
```
4. Build your site:
```sh
bundle exec jekyll serve
```
You can have multiple themes listed in your site's `Gemfile`, but only one theme can be selected in your site's `_config.yml`. {: .note .info }
If you're publishing your Jekyll site on [GitHub Pages](https://pages.github.com/), note that GitHub Pages supports only some gem-based themes. See [Supported Themes](https://pages.github.com/themes/) in GitHub's documentation to see which themes are supported.
## Creating a gem-based theme
If you're a Jekyll theme developer (rather than just a consumer of themes), you can package up your theme in RubyGems and allow users to install it through Bundler.
If you're unfamiliar with creating Ruby gems, don't worry. Jekyll will help you scaffold a new theme with the `new-theme` command. Run `jekyll new-theme` with the theme name as an argument.
Here is an example:
```sh
jekyll new-theme jekyll-theme-awesome
create /path/to/jekyll-theme-awesome/_layouts
create /path/to/jekyll-theme-awesome/_includes
create /path/to/jekyll-theme-awesome/_sass
create /path/to/jekyll-theme-awesome/_layouts/page.html
create /path/to/jekyll-theme-awesome/_layouts/post.html
create /path/to/jekyll-theme-awesome/_layouts/default.html
create /path/to/jekyll-theme-awesome/Gemfile
create /path/to/jekyll-theme-awesome/jekyll-theme-awesome.gemspec
create /path/to/jekyll-theme-awesome/README.md
create /path/to/jekyll-theme-awesome/LICENSE.txt
initialize /path/to/jekyll-theme-awesome/.git
create /path/to/jekyll-theme-awesome/.gitignore
Your new Jekyll theme, jekyll-theme-awesome, is ready for you in /path/to/jekyll-theme-awesome!
For help getting started, read /path/to/jekyll-theme-awesome/README.md.
```
Add your template files in the corresponding folders. Then complete the `.gemspec` and the README files according to your needs.
### Layouts and includes
Theme layouts and includes work just like they work in any Jekyll site. Place layouts in your theme's `/_layouts` folder, and place includes in your themes `/_includes` folder.
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 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 can ship any kind of asset here: SCSS, an image, a webfont, etc. These files behave like pages and static files in Jekyll:
- If the file has [YAML front matter](../docs/frontmatter/) at the top, it will be rendered.
- If the file 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.
```
_sass
├── jekyll-theme-awesome.scss
```
Your theme's styles can be included in the user's stylesheet using the `@import` directive.
```css
{% raw %}@import "{{ site.theme }}";{% endraw %}
```
### Documenting your theme
Your theme should include a `/README.md` file, which explains how site authors can install and use your theme. What layouts are included? What includes? Do they need to add anything special to their site's configuration file?
### Adding a screenshot
Themes are visual. Show users what your theme looks like by including a screenshot as `/screenshot.png` within your theme's repository where it can be retrieved programatically. You can also include this screenshot within your theme's documentation.
### Previewing your theme
To preview your theme as you're authoring it, it may be helpful to add dummy content in, for example, `/index.html` and `/page.html` files. This will allow you to use the `jekyll build` and `jekyll serve` commands to preview your theme, just as you'd preview a Jekyll site.
If you do preview your theme locally, be sure to add `/_site` to your theme's `.gitignore` file to prevent the compiled site from also being included when you distribute your theme. {: .info .note}
### Publishing your theme
Themes are published via [RubyGems.org](https://rubygems.org). You will need a RubyGems account, which you can [create for free](https://rubygems.org/sign_up).
1. First, package your theme, by running the following command, replacing `jekyll-theme-awesome` with the name of your theme:
```sh
gem build jekyll-theme-awesome.gemspec
```
2. Next, push your packaged theme up to the RubyGems service, by running the following command, again replacing `jekyll-theme-awesome` with the name of your theme:
```sh
gem push jekyll-theme-awesome-*.gem
```
3. To release a new version of your theme, update the version number in the gemspec file, ( `jekyll-theme-awesome.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.

View File

@@ -1,18 +0,0 @@
---
title: 'Jekyll 3.3.1 Released'
date: 2016-11-14 14:29:59 -0800
author: parkr
version: 3.3.1
categories: [release]
---
Hello! We have a bugfix release of Jekyll hot off the presses for you. Key
fixes to call out:
1. Only warn about auto-regeneration issues on Windows instead of disabling
2. Exclude very specific `vendor/` subdirectories instead of all of `vendor/`
3. Allow permalink templates to have plaintext underscores
..and lots more! Check out the [full history for more](/docs/history/#v3-3-1).
Happy Jekylling!

View File

@@ -1,42 +0,0 @@
---
title: 'Jekyll turns 3.4.0'
date: 2017-01-18 14:19:13 -0500
author: parkr
version: 3.4.0
categories: [release]
---
Hey there! We have a quick update of Jekyll for you to enjoy this January.
Packed full of bug fixes as usual, thanks to the tireless efforts of our
exceptional Jekyll community. Three changes to call out:
1. If you're a big fan of [`where_by_exp`](/docs/filters/), you'll be an
even bigger fan of [`group_by_exp`](/docs/filters/).
2. Using a custom timezone in Jekyll on Windows? Yeah, sorry that hasn't ever worked
properly. We made it possible to accurately [set the timezone using IANA
timezone codes](https://jekyllrb.com/docs/windows/#timezone-management).
3. Documentation has been improved, notably on themes, includes and permalinks.
And [lots and lots more!](/docs/history/#v3-4-0)
This update was made possible by the dedicated efforts of our excellent
contributors: Ajay Karwal, Alexey Rogachev, Ashwin Maroli,
BlueberryFoxtrot, Chase, Chayoung You, Dean Attali, Dmitrii Evdokimov, Don
Denton, Eldritch Cheese, Fabrice Laporte, Florian Thomas, Frank
Taillandier, Hugo, Ivan Dmitrievsky, Joel Meyer-Hamme, Josh Habdas, Kenton
Hansen, Kevin Wojniak, Kurt Anderson, Longwelwind, Max Chadwick, Nicolas
Hoizey, Nursen, Parker Moore, Pat Hawks, Purplecarrot, Ricardo N Feliciano,
Rob Crocombe, Roger Ogden, Skylar Challand, Thiago Arrais, Tim Banks, Tom
Johnson, Tunghsiao Liu, XhmikosR, Zlatan Vasović, alexmalik, brainscript,
kimbaudi, muratayusuke, penny, and yoostk.
As always, if you encounter bugs, please do [search the issues]({{ site.repository }}/issues)
and [file an issue]({{ site.repository }}/issues/new) if you aren't able to
find a resolution. We also have [our Jekyll Talk
forum](https://talk.jekyllrb.com) for those of you with general questions
about how to accomplish certain tasks with Jekyll.
We have some exciting updates in store for v3.5, and we're hard at work on
those already.
Happy Jekylling!

View File

@@ -1,24 +0,0 @@
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/FontAwesome.eot?9h6hxj');
src: url('../fonts/FontAwesome.eot?9h6hxj#iefix') format('embedded-opentype'),
url('../fonts/FontAwesome.woff?9h6hxj') format('woff'),
url('../fonts/FontAwesome.ttf?9h6hxj') format('truetype'),
url('../fonts/FontAwesome.svg?9h6hxj#FontAwesome') format('svg');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fa-link:before {
content: "\f0c1";
}
.fa-pencil:before {
content: "\f040";
}

View File

@@ -1,9 +1,6 @@
---
title: Affinity Team Captains
---
# Affinity Team Captains
**This guide is for affinity team captains.** These special people are **team maintainers** of one of our [affinity teams][] and help triage and evaluate the issues and contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
## Affinity teams & their captains

View File

@@ -1,9 +1,6 @@
---
title: "Avoiding Burnout"
---
# Maintainers: Avoiding Burnout
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
# 1. Use Jekyll
@@ -27,4 +24,4 @@ Jekyll gets a lot of feature requests, non-reproducible bug reports, usage quest
Thanks to https://gist.github.com/ryanflorence/124070e7c4b3839d4573 which influenced this document.
Thanks to [Homebrew's "Avoiding Burnout" document](https://github.com/Homebrew/brew/blob/master/docs/Maintainers-Avoiding-Burnout.md) for providing a perfect base for this document.
Thanks to [Homebrew's "Avoiding Burnout" document](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Maintainers-Avoiding-Burnout.md) for providing a perfect base for this document.

View File

@@ -1,9 +1,6 @@
---
title: "Becoming a Maintainer"
---
# Contributors: Becoming a Maintainer
**This guide is for contributors.** These special people have contributed to one or more of Jekyll's repositories, but do not yet have write access to any. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
So you want to become a maintainer of a Jekyll project? We'd love to have you! Here are some things we like to see from community members before we promote them to maintainers.
@@ -13,7 +10,7 @@ You want to maintain Jekyll? Use it often. Do weird things with it. Do normal th
## 2. Help Triage Issues
Watch the repository you're interested in. Join [an Affinity Team](https://teams.jekyllrb.com) and receive mentions regarding a particular interest area of the project. When you receive a notification for an issue that has not been triaged by a maintainer, dive in. Can you reproduce the issue? Can you determine the fix? [More tips on Triaging an Issue in our maintainer guide](../triaging-an-issue). Every maintainer loves an issue that is resolved before they get to it. :smiley:
Watch the repository you're interested in. Join [an Affinity Team](https://teams.jekyllrb.com) and receive mentions regarding a particular interest area of the project. When you receive a notification for an issue that has not been triaged by a maintainer, dive in. Can you reproduce the issue? Can you determine the fix? [More tips on Triaging an Issue in our maintainer guide](triaging-an-issue.md). Every maintainer loves an issue that is resolved before they get to it. :smiley:
## 3. Write Documentation
@@ -25,7 +22,7 @@ As a maintainer, you will be reviewing pull requests which update code. You shou
## 5. Review Pull Requests
Start by reviewing one pull request a week. Leave detailed comments and [follow our guide for reviewing pull requests](../reviewing-a-pull-request).
Start by reviewing one pull request a week. Leave detailed comments and [follow our guide for reviewing pull requests](reviewing-a-pull-request.md).
## 6. Ask!
@@ -35,4 +32,4 @@ We would love to expand the team and look forward to many more community members
# Helping Out Elsewhere
In addition to maintainers of our core and plugin code, the Jekyll team is comprised of moderators for our forums. These helpful community members take a look at the topics posted to [https://talk.jekyllrb.com](https://talk.jekyllrb.com) and ensure they are properly categorized and are acceptable under our Code of Conduct. If you would like to be a moderator, email one of the maintainers with links to where you have answered questions and a request to be added as a moderator. More help is always welcome.
In addition to maintainers of our core and plugin code, the Jekyll team is comprised of moderators for our forums. These helpful community members take a look at the topics posted to https://help.jekyllrb.com and ensure they are properly categorized and are acceptable under our Code of Conduct. If you would like to be a moderator, email one of the maintainers with links to where you have answered questions and a request to be added as a moderator. More help is always welcome.

Binary file not shown.

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="FontAwesome" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xf040;" glyph-name="pencil" horiz-adv-x="866" d="M207.429 73.143l52 52-134.286 134.286-52-52v-61.143h73.143v-73.143h61.143zM506.286 603.428c0 7.429-5.143 12.571-12.571 12.571-3.429 0-6.857-1.143-9.714-4l-309.714-309.714c-2.857-2.857-4-6.286-4-9.714 0-7.429 5.143-12.571 12.571-12.571 3.429 0 6.857 1.143 9.714 4l309.714 309.714c2.857 2.857 4 6.286 4 9.714zM475.429 713.143l237.714-237.714-475.429-475.429h-237.714v237.714zM865.714 658.286c0-19.429-8-38.286-21.143-51.429l-94.857-94.857-237.714 237.714 94.857 94.286c13.143 13.714 32 21.714 51.429 21.714s38.286-8 52-21.714l134.286-133.714c13.143-13.714 21.143-32.571 21.143-52z" />
<glyph unicode="&#xf0c1;" glyph-name="chain, link" horiz-adv-x="951" d="M832 256c0 14.857-5.714 28.571-16 38.857l-118.857 118.857c-10.286 10.286-24.571 16-38.857 16-16.571 0-29.714-6.286-41.143-18.286 18.857-18.857 41.143-34.857 41.143-64 0-30.286-24.571-54.857-54.857-54.857-29.143 0-45.143 22.286-64 41.143-12-11.429-18.857-24.571-18.857-41.714 0-14.286 5.714-28.571 16-38.857l117.714-118.286c10.286-10.286 24.571-15.429 38.857-15.429s28.571 5.143 38.857 14.857l84 83.429c10.286 10.286 16 24 16 38.286zM430.286 658.857c0 14.286-5.714 28.571-16 38.857l-117.714 118.286c-10.286 10.286-24.571 16-38.857 16s-28.571-5.714-38.857-15.429l-84-83.429c-10.286-10.286-16-24-16-38.286 0-14.857 5.714-28.571 16-38.857l118.857-118.857c10.286-10.286 24.571-15.429 38.857-15.429 16.571 0 29.714 5.714 41.143 17.714-18.857 18.857-41.143 34.857-41.143 64 0 30.286 24.571 54.857 54.857 54.857 29.143 0 45.143-22.286 64-41.143 12 11.429 18.857 24.571 18.857 41.714zM941.714 256c0-43.429-17.714-85.714-48.571-116l-84-83.429c-30.857-30.857-72.571-47.429-116-47.429-44 0-85.714 17.143-116.571 48.571l-117.714 118.286c-30.857 30.857-47.429 72.571-47.429 116 0 45.143 18.286 88 50.286 119.429l-50.286 50.286c-31.429-32-73.714-50.286-118.857-50.286-43.429 0-85.714 17.143-116.571 48l-118.857 118.857c-31.429 31.429-48 72.571-48 116.571 0 43.429 17.714 85.714 48.571 116l84 83.429c30.857 30.857 72.571 47.429 116 47.429 44 0 85.714-17.143 116.571-48.571l117.714-118.286c30.857-30.857 47.429-72.571 47.429-116 0-45.143-18.286-88-50.286-119.429l50.286-50.286c31.429 32 73.714 50.286 118.857 50.286 43.429 0 85.714-17.143 116.571-48l118.857-118.857c31.429-31.429 48-72.571 48-116.571z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -1,96 +0,0 @@
{
"IcoMoonType": "selection",
"icons": [
{
"icon": {
"paths": [
"M207.429 877.714l52-52-134.286-134.286-52 52v61.143h73.143v73.143h61.143zM506.286 347.429c0-7.429-5.143-12.571-12.571-12.571-3.429 0-6.857 1.143-9.714 4l-309.714 309.714c-2.857 2.857-4 6.286-4 9.714 0 7.429 5.143 12.571 12.571 12.571 3.429 0 6.857-1.143 9.714-4l309.714-309.714c2.857-2.857 4-6.286 4-9.714zM475.429 237.714l237.714 237.714-475.429 475.429h-237.714v-237.714zM865.714 292.571c0 19.429-8 38.286-21.143 51.429l-94.857 94.857-237.714-237.714 94.857-94.286c13.143-13.714 32-21.714 51.429-21.714s38.286 8 52 21.714l134.286 133.714c13.143 13.714 21.143 32.571 21.143 52z"
],
"width": 865.7188571428571,
"attrs": [],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"pencil"
],
"defaultCode": 61504,
"grid": 14
},
"attrs": [],
"properties": {
"name": "pencil",
"id": 64,
"order": 3,
"prevSize": 28,
"code": 61504
},
"setIdx": 0,
"setId": 0,
"iconIdx": 64
},
{
"icon": {
"paths": [
"M832 694.857c0-14.857-5.714-28.571-16-38.857l-118.857-118.857c-10.286-10.286-24.571-16-38.857-16-16.571 0-29.714 6.286-41.143 18.286 18.857 18.857 41.143 34.857 41.143 64 0 30.286-24.571 54.857-54.857 54.857-29.143 0-45.143-22.286-64-41.143-12 11.429-18.857 24.571-18.857 41.714 0 14.286 5.714 28.571 16 38.857l117.714 118.286c10.286 10.286 24.571 15.429 38.857 15.429s28.571-5.143 38.857-14.857l84-83.429c10.286-10.286 16-24 16-38.286zM430.286 292c0-14.286-5.714-28.571-16-38.857l-117.714-118.286c-10.286-10.286-24.571-16-38.857-16s-28.571 5.714-38.857 15.429l-84 83.429c-10.286 10.286-16 24-16 38.286 0 14.857 5.714 28.571 16 38.857l118.857 118.857c10.286 10.286 24.571 15.429 38.857 15.429 16.571 0 29.714-5.714 41.143-17.714-18.857-18.857-41.143-34.857-41.143-64 0-30.286 24.571-54.857 54.857-54.857 29.143 0 45.143 22.286 64 41.143 12-11.429 18.857-24.571 18.857-41.714zM941.714 694.857c0 43.429-17.714 85.714-48.571 116l-84 83.429c-30.857 30.857-72.571 47.429-116 47.429-44 0-85.714-17.143-116.571-48.571l-117.714-118.286c-30.857-30.857-47.429-72.571-47.429-116 0-45.143 18.286-88 50.286-119.429l-50.286-50.286c-31.429 32-73.714 50.286-118.857 50.286-43.429 0-85.714-17.143-116.571-48l-118.857-118.857c-31.429-31.429-48-72.571-48-116.571 0-43.429 17.714-85.714 48.571-116l84-83.429c30.857-30.857 72.571-47.429 116-47.429 44 0 85.714 17.143 116.571 48.571l117.714 118.286c30.857 30.857 47.429 72.571 47.429 116 0 45.143-18.286 88-50.286 119.429l50.286 50.286c31.429-32 73.714-50.286 118.857-50.286 43.429 0 85.714 17.143 116.571 48l118.857 118.857c31.429 31.429 48 72.571 48 116.571z"
],
"width": 950.8571428571428,
"attrs": [],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"chain",
"link"
],
"defaultCode": 61633,
"grid": 14
},
"attrs": [],
"properties": {
"name": "chain, link",
"id": 170,
"order": 2,
"prevSize": 28,
"code": 61633
},
"setIdx": 0,
"setId": 0,
"iconIdx": 170
}
],
"height": 1024,
"metadata": {
"name": "FontAwesome"
},
"preferences": {
"showGlyphs": true,
"showCodes": true,
"showQuickUse": true,
"showQuickUse2": true,
"showSVGs": true,
"fontPref": {
"prefix": "fa-",
"metadata": {
"fontFamily": "FontAwesome",
"majorVersion": 1,
"minorVersion": 0
},
"metrics": {
"emSize": 1024,
"baseline": 6.25,
"whitespace": 50
},
"embed": false,
"showSelector": true,
"selector": "class",
"classSelector": ".fa"
},
"imagePref": {
"prefix": "icon-",
"png": true,
"useClassSelector": true,
"color": 0,
"bgColor": 16777215
},
"historySize": 100
}
}

View File

@@ -1 +0,0 @@
3.4.3

View File

@@ -1,15 +1,12 @@
---
title: "Merging a Pull Request"
---
# Maintainers: Merging a Pull Request
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
## Code Review
All pull requests should be subject to code review. Code review is a [foundational value](https://blog.fullstory.com/what-we-learned-from-google-code-reviews-arent-just-for-catching-bugs-b125a13aa292) of good engineering teams. Besides providing validation of correctness, it promotes a sense of community and gives other maintainers understanding of all parts of the code base. In short, code review is crucial to a healthy open source project.
**Read our guide for [Reviewing a pull request](../reviewing-a-pull-request) before merging.** Notably, the change must have tests if for code, and at least two maintainers must give it an OK.
**Read our guide for [Reviewing a pull request](reviewing-a-pull-request.md) before merging.** Notably, the change must have tests if for code, and at least two maintainers must give it an OK.
## Merging
@@ -37,10 +34,8 @@ The categories match the H3's in the history/changelog file, and they are:
1. Major Enhancements (`+major`) major updates or breaking changes to the code which necessitate a major version bump (v3 ~> v4)
2. Minor Enhancements (`+minor`) minor updates (feature, enhancement) which necessitate a minor version bump (v3.1 ~> v3.2)
3. Bug Fixes (`+bug`) corrections to code which do not change or add functionality, which necessitate a patch version bump (v3.1.0 ~> v3.1.1)
4. Documentation (`+doc`) - changes to the documentation found in `docs/_docs/`
5. Site Enhancements (`+site`) changes to the source of [https://jekyllrb.com](https://jekyllrb.com) found in `docs/`
6. Development Fixes (`+dev`) changes which do not affect user-facing functionality or documentation, such as test fixes or bumping internal dependencies
7. Forward Ports (`+port`) — bug fixes applied to a previous version of Jekyll pulled onto `master`, e.g. cherry-picked commits from `3-1-stable` to `master`
4. Site Enhancements (`+site`) changes to the source of https://jekyllrb.com, found in `site/`
5. Development Fixes (`+dev`) changes which do not affect user-facing functionality or documentation, such as test fixes or bumping internal dependencies
Once @jekyllbot has merged the pull request, you should see three things:

View File

@@ -1,23 +1,13 @@
# Jekyll docs site
# Maintaining Jekyll
This directory contains the code for the Jekyll docs site, [jekyllrb.com](https://jekyllrb.com/).
Hello! This is where we document various processes for maintaining Jekyll. Being a maintainer for any Jekyll project is a big responsibility, so we put together some helpful documentation for various tasks you might do as a maintainer.
## Contributing
1. [Triaging and issue](triaging-an-issue.md)
2. [Reviewing a pull request](reviewing-a-pull-request.md)
3. [Merging a pull request](merging-a-pull-request.md)
4. [Avoiding burnout](avoiding-burnout.md)
5. [Special Labels](special-labels.md)
For information about contributing, see the [Contributing page](https://jekyllrb.com/docs/contributing/).
Interested in becoming a maintainer? Here is some documentation for **contributors**:
## Running locally
You can preview your contributions before opening a pull request by running from within the directory:
1. `bundle install --without test test_legacy benchmark`
2. `bundle exec rake site:preview`
It's just a jekyll site, afterall! :wink:
## Updating Font Awesome
1. Go to <https://icomoon.io/app/>
2. Choose Import Icons and load `icomoon-selection.json`
3. Choose Generate Font → Download
4. Copy the font files and adapt the CSS to the paths we use in Jekyll
1. [Becoming a maintainer](becoming-a-maintainer.md)

View File

@@ -1,13 +1,10 @@
---
title: "Reviewing a Pull Request"
---
# Maintainers: Reviewing a Pull Request
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
## Respond Kindly
Above all else, please review a pull request kindly. Our community can only be strong if we make it a welcoming and inclusive environment. To further promote this, the Jekyll community is governed by a [Code of Conduct](/docs/conduct/) by which all community members must abide.
Above all else, please review a pull request kindly. Our community can only be strong if we make it a welcoming and inclusive environment. To further promote this, the Jekyll community is governed by a [Code of Conduct](../CONDUCT.markdown) by which all community members must abide.
Use emoji liberally :heart: :tada: :sparkles: :confetti_ball: and feel free to be emotive!! Contributions keep this project moving forward and we're always happy to receive them, even if the pull request isn't ultimately merged.
@@ -44,3 +41,4 @@ A pull request may be merged once two maintainers have reviewed the pull request
## Think Security
We owe it to our users to ensure that using a theme from the community or building someone else's site doesn't come with built-in security vulnerabilities. Things like where files may be read from and written to are important to keep secure. Jekyll is also the basis for hosted services such as [GitHub Pages](https://pages.github.com), which cannot upgrade when security issues are introduced.

View File

@@ -1,9 +1,6 @@
---
title: "Special Labels"
---
# Maintainers: Special Labels
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
We use a series of "special labels" on GitHub.com to automate handling of some parts of the pull request and issue process. @jekyllbot may automatically apply or remove certain labels based on actions taken by users or maintainers. Below are the labels and how they work:
@@ -17,4 +14,4 @@ These labels are used to indicate that the Git state of a pull request must chan
## `stale`
This label is automatically added and removed by @jekyllbot based on activity on an issue or pull request. The rules for this label are laid out in [Triaging an Issue: Staleness and automatic closure](../triaging-an-issue/#staleness-and-automatic-closure).
This label is automatically added and removed by @jekyllbot based on activity on an issue or pull request. The rules for this label are laid out in [Triaging an Issue: Staleness and automatic closure](triaging-an-issue.md#staleness-and-automatic-closure).

View File

@@ -1,9 +1,6 @@
---
title: "Triaging an Issue"
---
# Maintainers: Triaging an Issue
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
Before evaluating an issue, it is important to identify if it is a feature
request or a bug. For the Jekyll project the following definitions are used

View File

@@ -77,8 +77,7 @@ Feature: Collections
When I run jekyll build
Then I should get a zero exit status
Then the _site directory should exist
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" unless Windows
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/yaml_with_dots.md" in "_site/index.html" if on Windows
And I should see "Collections: _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
Scenario: Collections specified as an hash
Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
@@ -91,8 +90,7 @@ Feature: Collections
When I run jekyll build
Then I should get a zero exit status
Then the _site directory should exist
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" unless Windows
And I should see "Collections: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/yaml_with_dots.md" in "_site/index.html" if on Windows
And I should see "Collections: _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
Scenario: All the documents
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
@@ -105,11 +103,10 @@ Feature: Collections
When I run jekyll build
Then I should get a zero exit status
Then the _site directory should exist
And I should see "All documents: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" unless Windows
And I should see "All documents: _methods/3940394-21-9393050-fifif1323-test.md _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/yaml_with_dots.md" in "_site/index.html" if on Windows
And I should see "All documents: _methods/collection/entries _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
Scenario: Documents have an output attribute, which is the converted HTML
Given I have an "index.html" page that contains "Second document's output: {{ site.documents[2].output }}"
Given I have an "index.html" page that contains "Second document's output: {{ site.documents[1].output }}"
And I have fixture collections
And I have a "_config.yml" file with content:
"""
@@ -145,8 +142,7 @@ Feature: Collections
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "2. of 9: <p>Page without title.</p>" in "_site/index.html" unless Windows
And I should see "2. of 8: <p>Page without title.</p>" in "_site/index.html" if on Windows
And I should see "2. of 8: <p>Page without title.</p>" in "_site/index.html"
Scenario: Sort by relative_path
Given I have an "index.html" page that contains "Collections: {% assign methods = site.methods | sort: 'relative_path' %}{{ methods | map:"title" | join: ", " }}"
@@ -159,8 +155,7 @@ Feature: Collections
When I run jekyll build
Then I should get a zero exit status
Then the _site directory should exist
And I should see "Collections: this is a test!, Collection#entries, Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, Initialize, Site#generate, YAML with Dots" in "_site/index.html" unless Windows
And I should see "Collections: this is a test!, Collection#entries, Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, Initialize, YAML with Dots" in "_site/index.html" if on Windows
And I should see "Collections: Collection#entries, Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, Initialize, Site#generate," in "_site/index.html"
Scenario: Rendered collection with date/dateless filename
Given I have an "index.html" page that contains "Collections: {% for method in site.thanksgiving %}{{ method.title }} {% endfor %}"

View File

@@ -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:

View File

@@ -12,15 +12,6 @@ Feature: Rendering
Then I should get a non-zero exit-status
And I should see "Liquid Exception" in the build output
Scenario: When receiving bad Liquid in included file
Given I have a _includes directory
And I have a "_includes/invalid.html" file that contains "{% INVALID %}"
And I have a "index.html" page with layout "simple" that contains "{% include invalid.html %}"
And I have a simple layout that contains "{{ content }}"
When I run jekyll build
Then I should get a non-zero exit-status
And I should see "Liquid Exception.*Unknown tag 'INVALID' in.*_includes/invalid\.html" in the build output
Scenario: Render Liquid and place in layout
Given I have a "index.html" page with layout "simple" that contains "Hi there, Jekyll {{ jekyll.environment }}!"
And I have a simple layout that contains "{{ content }}Ahoy, indeed!"

View File

@@ -64,28 +64,28 @@ Feature: Site configuration
And the "_site/README" file should not exist
Scenario: Use RDiscount for markup
Given I have an "index.markdown" page that contains "[Google](https://www.google.com)"
Given I have an "index.markdown" page that contains "[Google](http://google.com)"
And I have a configuration file with "markdown" set to "rdiscount"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<a href=\"https://www.google.com\">Google</a>" in "_site/index.html"
And I should see "<a href=\"http://google.com\">Google</a>" in "_site/index.html"
Scenario: Use Kramdown for markup
Given I have an "index.markdown" page that contains "[Google](https://www.google.com)"
Given I have an "index.markdown" page that contains "[Google](http://google.com)"
And I have a configuration file with "markdown" set to "kramdown"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<a href=\"https://www.google.com\">Google</a>" in "_site/index.html"
And I should see "<a href=\"http://google.com\">Google</a>" in "_site/index.html"
Scenario: Use Redcarpet for markup
Given I have an "index.markdown" page that contains "[Google](https://www.google.com)"
Given I have an "index.markdown" page that contains "[Google](http://google.com)"
And I have a configuration file with "markdown" set to "redcarpet"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<a href=\"https://www.google.com\">Google</a>" in "_site/index.html"
And I should see "<a href=\"http://google.com\">Google</a>" in "_site/index.html"
Scenario: Highlight code with pygments
Given I have an "index.html" page that contains "{% highlight ruby %} puts 'Hello world!' {% endhighlight %}"
@@ -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 |
@@ -172,10 +172,8 @@ Feature: Site configuration
Then I should get a zero exit status
And the _site directory should exist
And I should see "Page Layout: 2" in "_site/index.html"
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html" unless Windows
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T22:22:00-05:00" in "_site/2013/04/09/entry1.html" if on Windows
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html" unless Windows
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T02:14:00-05:00" in "_site/2013/04/10/entry2.html" if on Windows
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html"
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html"
Scenario: Generate proper dates with explicitly set timezone (different than posts' time)
Given I have a _layouts directory
@@ -183,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 |

View File

@@ -156,32 +156,6 @@ end
#
When(%r!^I run gem(.*)$!) do |args|
run_rubygem(args)
if args.include?("--verbose") || ENV["DEBUG"]
$stderr.puts "\n#{jekyll_run_output}\n"
end
end
#
When(%r!^I run git add .$!) do
run_in_shell("git", "add", ".", "--verbose")
end
#
When(%r!^I decide to build the theme gem$!) do
Dir.chdir(Paths.theme_gem_dir)
gemspec = "my-cool-theme.gemspec"
File.write(gemspec, File.read(gemspec).sub("TODO: ", ""))
File.new("_includes/blank.html", "w")
File.new("_sass/blank.scss", "w")
File.new("assets/blank.scss", "w")
end
#
When(%r!^I change "(.*)" to contain "(.*)"$!) do |file, text|
File.open(file, "a") do |f|
f.write(text)
@@ -205,7 +179,6 @@ Then(%r!^the (.*) directory should +(not )?exist$!) do |dir, negative|
end
#
Then(%r!^I should (not )?see "(.*)" in "(.*)"$!) do |negative, text, file|
step %(the "#{file}" file should exist)
regexp = Regexp.new(text, Regexp::MULTILINE)
@@ -218,34 +191,6 @@ end
#
Then(%r!^I should (not )?see "(.*)" in "(.*)" if on Windows$!) do |negative, text, file|
step %(the "#{file}" file should exist)
regexp = Regexp.new(text, Regexp::MULTILINE)
if negative.nil? || negative.empty?
if Jekyll::Utils::Platforms.really_windows?
expect(file_contents(file)).to match regexp
else
expect(file_contents(file)).not_to match regexp
end
end
end
#
Then(%r!^I should (not )?see "(.*)" in "(.*)" unless Windows$!) do |negative, text, file|
step %(the "#{file}" file should exist)
regexp = Regexp.new(text, Regexp::MULTILINE)
if negative.nil? || negative.empty?
if Jekyll::Utils::Platforms.really_windows?
expect(file_contents(file)).not_to match regexp
else
expect(file_contents(file)).to match regexp
end
end
end
#
Then(%r!^I should see exactly "(.*)" in "(.*)"$!) do |text, file|
step %(the "#{file}" file should exist)
expect(file_contents(file).strip).to eq text
@@ -291,27 +236,6 @@ end
#
Then(%r!^I should get an updated git index$!) do
index = %w(
.gitignore
Gemfile
LICENSE.txt
README.md
_includes/blank.html
_layouts/default.html
_layouts/page.html
_layouts/post.html
_sass/blank.scss
assets/blank.scss
my-cool-theme.gemspec
)
index.each do |file|
expect(jekyll_run_output).to match file
end
end
#
Then(%r!^I should get a zero exit(?:\-| )status$!) do
step %(I should see "EXIT STATUS: 0" in the build output)
end

View File

@@ -16,7 +16,7 @@ module Jekyll
:pending => "\u203D".yellow,
:undefined => "\u2718".red,
:passed => "\u2714".green,
:skipped => "\u203D".blue,
:skipped => "\u203D".blue
}.freeze
#

View File

@@ -1,5 +1,6 @@
require "fileutils"
require "jekyll"
require "jekyll/utils"
require "open3"
require "time"
require "safe_yaml/load"
@@ -7,8 +8,6 @@ class Paths
SOURCE_DIR = Pathname.new(File.expand_path("../..", __dir__))
def self.test_dir; source_dir.join("tmp", "jekyll"); end
def self.theme_gem_dir; source_dir.join("tmp", "jekyll", "my-cool-theme"); end
def self.output_file; test_dir.join("jekyll_output.txt"); end
def self.status_file; test_dir.join("jekyll_status.txt"); end
@@ -89,12 +88,6 @@ end
#
def run_rubygem(args)
run_in_shell("gem", *args.strip.split(" "))
end
#
def run_jekyll(args)
args = args.strip.split(" ") # Shellwords?
process = run_in_shell("ruby", Paths.jekyll_bin.to_s, *args, "--trace")
@@ -102,18 +95,26 @@ def run_jekyll(args)
end
#
def run_in_shell(*args)
p, output = Jekyll::Utils::Exec.run(*args)
File.write(Paths.status_file, p.exitstatus)
# rubocop:disable Metrics/AbcSize
def run_in_shell(*args)
i, o, e, p = Open3.popen3(*args)
out = o.read.strip
err = e.read.strip
[i, o, e].each(&:close)
File.write(Paths.status_file, p.value.exitstatus)
File.open(Paths.output_file, "wb") do |f|
f.puts "$ " << args.join(" ")
f.puts output
f.puts "EXIT STATUS: #{p.exitstatus}"
f.puts out
f.puts err
f.puts "EXIT STATUS: #{p.value.exitstatus}"
end
p
p.value
end
# rubocop:enable Metrics/AbcSize
#
@@ -133,7 +134,7 @@ def location(folder, direction)
end
[before || ".",
after || ".",]
after || "."]
end
#
@@ -151,7 +152,7 @@ def seconds_agnostic_datetime(datetime = Time.now)
[
Regexp.escape(date),
"#{time}:\\d{2}",
Regexp.escape(zone),
Regexp.escape(zone)
] \
.join("\\ ")
end

View File

@@ -1,31 +0,0 @@
Feature: Building Theme Gems
As a hacker who likes to share my expertise
I want to be able to make a bonafide rubygem off my theme
In order to share my awesome style skillz with other Jekyllites
Scenario: Generating a new Jekyll Theme
When I run jekyll new-theme my-cool-theme
Then I should get a zero exit status
And the my-cool-theme directory should exist
Scenario: Checking if a bonafide Theme gem will be built from generated scaffolding
When I run jekyll new-theme my-cool-theme
Then the my-cool-theme directory should exist
When I decide to build the theme gem
Then the "_includes/blank.html" file should exist
Then the "_sass/blank.scss" file should exist
Then the "assets/blank.scss" file should exist
When I run git add .
Then I should get an updated git index
When I run gem build my-cool-theme.gemspec
Then the "./my-cool-theme-0.1.0.gem" file should exist
When I run gem unpack my-cool-theme-0.1.0.gem
Then the my-cool-theme-0.1.0 directory should exist
And the "my-cool-theme-0.1.0/_layouts/default.html" file should exist
And the "my-cool-theme-0.1.0/_includes/blank.html" file should exist
And the "my-cool-theme-0.1.0/_sass/blank.scss" file should exist
And the "my-cool-theme-0.1.0/assets/blank.scss" file should exist
And the my-cool-theme-0.1.0/.git directory should not exist
And the "my-cool-theme-0.1.0/.gitignore" file should not exist
And the "my-cool-theme-0.1.0/Gemfile" file should not exist
And the "my-cool-theme-0.1.0/my-cool-theme.gemspec" file should not exist

View File

@@ -1,42 +1,42 @@
# coding: utf-8
lib = File.expand_path("../lib", __FILE__)
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "jekyll/version"
require 'jekyll/version'
Gem::Specification.new do |s|
s.specification_version = 2 if s.respond_to? :specification_version=
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.rubygems_version = "2.2.2"
s.required_ruby_version = ">= 2.0.0"
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
s.rubygems_version = '2.2.2'
s.required_ruby_version = '>= 2.0.0'
s.name = "jekyll"
s.name = 'jekyll'
s.version = Jekyll::VERSION
s.license = "MIT"
s.license = 'MIT'
s.summary = "A simple, blog aware, static site generator."
s.description = "Jekyll is a simple, blog aware, static site generator."
s.summary = 'A simple, blog aware, static site generator.'
s.description = 'Jekyll is a simple, blog aware, static site generator.'
s.authors = ["Tom Preston-Werner"]
s.email = "tom@mojombo.com"
s.homepage = "https://github.com/jekyll/jekyll"
s.authors = ['Tom Preston-Werner']
s.email = 'tom@mojombo.com'
s.homepage = 'https://github.com/jekyll/jekyll'
all_files = `git ls-files -z`.split("\x0")
s.files = all_files.grep(%r!^(exe|lib)/|^.rubocop.yml$!)
s.executables = all_files.grep(%r!^exe/!) { |f| File.basename(f) }
s.files = all_files.grep(%r{^(exe|lib)/|^.rubocop.yml$})
s.executables = all_files.grep(%r{^exe/}) { |f| File.basename(f) }
s.bindir = "exe"
s.require_paths = ["lib"]
s.require_paths = ['lib']
s.rdoc_options = ["--charset=UTF-8"]
s.extra_rdoc_files = %w(README.markdown LICENSE)
s.rdoc_options = ['--charset=UTF-8']
s.extra_rdoc_files = %w[README.markdown LICENSE]
s.add_runtime_dependency("addressable", "~> 2.4")
s.add_runtime_dependency("colorator", "~> 1.0")
s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0")
s.add_runtime_dependency("jekyll-watch", "~> 1.1")
s.add_runtime_dependency("kramdown", "~> 1.3")
s.add_runtime_dependency("liquid", "~> 3.0")
s.add_runtime_dependency("mercenary", "~> 0.3.3")
s.add_runtime_dependency("pathutil", "~> 0.9")
s.add_runtime_dependency("rouge", "~> 1.7")
s.add_runtime_dependency("safe_yaml", "~> 1.0")
s.add_runtime_dependency('liquid', '~> 3.0')
s.add_runtime_dependency('kramdown', '~> 1.3')
s.add_runtime_dependency('mercenary', '~> 0.3.3')
s.add_runtime_dependency('safe_yaml', '~> 1.0')
s.add_runtime_dependency('colorator', '~> 1.0')
s.add_runtime_dependency('rouge', '~> 1.7')
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

View File

@@ -119,11 +119,7 @@ module Jekyll
# Returns nothing
# rubocop:disable Style/AccessorMethodName
def set_timezone(timezone)
ENV["TZ"] = if Utils::Platforms.really_windows?
Utils::WinTZ.calculate(timezone)
else
timezone
end
ENV["TZ"] = timezone
end
# rubocop:enable Style/AccessorMethodName

View File

@@ -32,8 +32,8 @@ module Jekyll
# Override of method_missing to check in @data for the key.
def method_missing(method, *args, &blck)
if docs.respond_to?(method.to_sym)
Jekyll.logger.warn "Deprecation:",
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
Jekyll.logger.warn "Deprecation:", "#{label}.#{method} should be changed to" \
"#{label}.docs.#{method}."
Jekyll.logger.warn "", "Called by #{caller.first}."
docs.public_send(method.to_sym, *args, &blck)
else
@@ -197,7 +197,6 @@ module Jekyll
end
private
def read_document(full_path)
doc = Jekyll::Document.new(full_path, :site => site, :collection => self)
doc.read
@@ -209,20 +208,14 @@ module Jekyll
end
private
def read_static_file(file_path, full_path)
relative_dir = Jekyll.sanitized_path(
relative_directory,
File.dirname(file_path)
).chomp("/.")
files << StaticFile.new(
site,
site.source,
relative_dir,
File.basename(full_path),
self
)
files << StaticFile.new(site, site.source, relative_dir,
File.basename(full_path), self)
end
end
end

View File

@@ -71,27 +71,23 @@ module Jekyll
#
# Returns nothing.
def watch(site, options)
# Warn Windows users that they might need to upgrade.
if Utils::Platforms.bash_on_windows?
Jekyll.logger.warn "",
"Auto-regeneration may not work on some Windows versions."
Jekyll.logger.warn "",
"Please see: https://github.com/Microsoft/BashOnWindows/issues/216"
Jekyll.logger.warn "",
"If it does not work, please upgrade Bash on Windows or "\
"run Jekyll with --no-watch."
end
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"
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
)
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

View File

@@ -35,7 +35,7 @@ module Jekyll
fsnotify_buggy?(site),
!deprecated_relative_permalinks(site),
!conflicting_urls(site),
!urls_only_differ_by_case(site),
!urls_only_differ_by_case(site)
].all?
end

View File

@@ -84,10 +84,6 @@ gem "minima", "~> 2.0"
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
RUBY
end
@@ -125,23 +121,23 @@ RUBY
# 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
Jekyll.logger.info "New jekyll site installed in #{path.cyan}."
Jekyll.logger.info "Bundle install skipped." if options["skip-bundle"]
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
process, output = Jekyll::Utils::Exec.run("bundle", "install")
output.to_s.each_line do |line|
Jekyll.logger.info("Bundler:".green, line.strip) unless line.to_s.empty?
if ENV["CI"]
system("bundle", "install", "--quiet")
else
system("bundle", "install")
end
raise SystemExit unless process.success?
end
end
end

View File

@@ -10,9 +10,9 @@ module Jekyll
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
"port" => ["-P", "--port [PORT]", "Port to listen on"],
"show_dir_listing" => ["--show-dir-listing",
"Show a directory listing instead of loading your index file.",],
"Show a directory listing instead of loading your index file."],
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
"Skips the initial site build which occurs before the server is started.",],
"Skips the initial site build which occurs before the server is started."]
}.freeze
#
@@ -88,7 +88,7 @@ module Jekyll
index.rhtml
index.cgi
index.xml
),
)
}
opts[:DirectoryIndex] = [] if opts[:JekyllOptions]["show_dir_listing"]
@@ -103,7 +103,7 @@ module Jekyll
private
def start_up_webrick(opts, destination)
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
server.mount(opts["baseurl"].to_s, Servlet, destination, file_handler_opts)
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
@@ -116,8 +116,8 @@ module Jekyll
WEBrick::Config::FileHandler.merge({
:FancyIndexing => true,
:NondisclosureName => [
".ht*", "~*",
],
".ht*", "~*"
]
})
end
@@ -139,7 +139,7 @@ module Jekyll
:prefix => ssl_enabled ? "https" : "http",
:address => address,
:port => port,
:baseurl => baseurl ? "#{baseurl}/" : "",
:baseurl => baseurl ? "#{baseurl}/" : ""
})
end

View File

@@ -6,7 +6,7 @@ module Jekyll
class Servlet < WEBrick::HTTPServlet::FileHandler
DEFAULTS = {
"Cache-Control" => "private, max-age=0, proxy-revalidate, " \
"no-store, no-cache, must-revalidate",
"no-store, no-cache, must-revalidate"
}.freeze
def initialize(server, root, callbacks)

View File

@@ -17,9 +17,7 @@ module Jekyll
# Handling Reading
"safe" => false,
"include" => [".htaccess"],
"exclude" => %w(
node_modules vendor/bundle/ vendor/cache/ vendor/gems/ vendor/ruby/
),
"exclude" => %w(node_modules vendor),
"keep_files" => [".git", ".svn"],
"encoding" => "utf-8",
"markdown_ext" => "markdown,mkdown,mkdn,mkd,md",
@@ -45,7 +43,7 @@ module Jekyll
"detach" => false, # default to not detaching the server
"port" => "4000",
"host" => "127.0.0.1",
"baseurl" => nil, # this mounts at /, i.e. no subdirectory
"baseurl" => "",
"show_dir_listing" => false,
# Output Configuration
@@ -58,15 +56,15 @@ module Jekyll
"defaults" => [],
"liquid" => {
"error_mode" => "warn",
"error_mode" => "warn"
},
"rdiscount" => {
"extensions" => [],
"extensions" => []
},
"redcarpet" => {
"extensions" => [],
"extensions" => []
},
"kramdown" => {
@@ -76,8 +74,8 @@ module Jekyll
"smart_quotes" => "lsquo,rsquo,ldquo,rdquo",
"input" => "GFM",
"hard_wrap" => false,
"footnote_nr" => 1,
},
"footnote_nr" => 1
}
}.map { |k, v| [k, v.freeze] }].freeze
class << self

View 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

View File

@@ -11,7 +11,7 @@ module Jekyll
"line_numbers" => "inline",
"line_number_start" => 1,
"tab_width" => 4,
"wrap" => "div",
"wrap" => "div"
}.freeze
def initialize(config)

View File

@@ -21,7 +21,7 @@ class Jekyll::Converters::Markdown::RedcarpetParser
code,
{
:lexer => lang,
:options => { :encoding => "utf-8" },
:options => { :encoding => "utf-8" }
}
),
lang

View File

@@ -9,7 +9,7 @@ module Jekyll
YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m
DATELESS_FILENAME_MATCHER = %r!^(?:.+/)*(.*)(\.[^.]+)$!
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-(.*)(\.[^.]+)$!
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$!
# Create a new Document.
#
@@ -196,7 +196,7 @@ module Jekyll
@url = URL.new({
:template => url_template,
:placeholders => url_placeholders,
:permalink => permalink,
:permalink => permalink
}).to_s
end
@@ -469,14 +469,14 @@ module Jekyll
"category",
"categories"
)
).map(&:to_s).flatten.uniq,
).map(&:to_s).flatten.uniq
})
end
private
def populate_tags
merge_data!({
"tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten,
"tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten
})
end

View File

@@ -20,7 +20,7 @@ module Jekyll
def to_h
@to_h ||= {
"version" => version,
"environment" => environment,
"environment" => environment
}
end

View File

@@ -1,11 +0,0 @@
module Jekyll
module Drops
class StaticFileDrop < Drop
extend Forwardable
def_delegators :@obj, :name, :extname, :modified_time, :basename
def_delegator :@obj, :relative_path, :path
def_delegator :@obj, :data, :fallback_data
def_delegator :@obj, :type, :collection
end
end
end

View File

@@ -78,11 +78,6 @@ module Jekyll
def y_day
@obj.date.strftime("%j")
end
private
def fallback_data
{}
end
end
end
end

View File

@@ -2,7 +2,7 @@ module Jekyll
class EntryFilter
attr_reader :site
SPECIAL_LEADING_CHARACTERS = [
".", "_", "#", "~",
".", "_", "#", "~"
].freeze
def initialize(site, base_directory = nil)
@@ -36,7 +36,8 @@ module Jekyll
end
def included?(entry)
glob_include?(site.include, entry)
glob_include?(site.include,
entry)
end
def special?(entry)
@@ -49,14 +50,14 @@ module Jekyll
end
def excluded?(entry)
glob_include?(site.exclude, relative_to_source(entry)).tap do |excluded|
if excluded
Jekyll.logger.debug(
"EntryFilter:",
"excluded #{relative_to_source(entry)}"
)
end
excluded = glob_include?(site.exclude, relative_to_source(entry))
if excluded
Jekyll.logger.debug(
"EntryFilter:",
"excluded #{relative_to_source(entry)}"
)
end
excluded
end
# --

View File

@@ -30,7 +30,8 @@ module Jekyll
@data
end
def trigger_hooks(*); end
def trigger_hooks(*)
end
# 'Path' of the excerpt.
#

View File

@@ -48,7 +48,7 @@ In order to use Jekyll as currently configured, you'll need to install this gem.
The full error message from Ruby is: '#{e.message}'
If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
MSG
raise Jekyll::Errors::MissingDependencyException, name
end

View File

@@ -1,4 +1,4 @@
require "addressable/uri"
require "uri"
require "json"
require "date"
require "liquid"
@@ -8,16 +8,18 @@ require_all "jekyll/filters"
module Jekyll
module Filters
include URLFilters
include GroupingFilters
# 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
@@ -152,7 +154,7 @@ module Jekyll
#
# Returns the escaped String.
def uri_escape(input)
Addressable::URI.normalize_component(input)
URI.escape(input)
end
# Replace any whitespace in the input string with a single space
@@ -177,7 +179,6 @@ module Jekyll
# word "and" for the last one.
#
# array - The Array of Strings to join.
# connector - Word used to connect the last 2 items in the array
#
# Examples
#
@@ -185,7 +186,8 @@ module Jekyll
# # => "apples, oranges, and grapes"
#
# Returns the formatted String.
def array_to_sentence_string(array, connector = "and")
def array_to_sentence_string(array)
connector = "and"
case array.length
when 0
""
@@ -207,6 +209,29 @@ module Jekyll
as_liquid(input).to_json
end
# Group an array of items by a property
#
# input - the inputted Enumerable
# property - the property
#
# Returns an array of Hashes, each looking something like this:
# {"name" => "larry"
# "items" => [...] } # all the items where `property` == "larry"
def group_by(input, property)
if groupable?(input)
input.group_by { |item| item_property(item, property).to_s }
.each_with_object([]) do |item, array|
array << {
"name" => item.first,
"items" => item.last,
"size" => item.last.size
}
end
else
input
end
end
# Filter an array of objects
#
# input - the object array
@@ -360,6 +385,11 @@ module Jekyll
end.localtime
end
private
def groupable?(element)
element.respond_to?(:group_by)
end
private
def item_property(item, property)
if item.respond_to?(:to_liquid)
@@ -410,7 +440,6 @@ module Jekyll
condition
end
end
end

View File

@@ -1,63 +0,0 @@
module Jekyll
module Filters
module GroupingFilters
# Group an array of items by a property
#
# input - the inputted Enumerable
# property - the property
#
# Returns an array of Hashes, each looking something like this:
# {"name" => "larry"
# "items" => [...] } # all the items where `property` == "larry"
def group_by(input, property)
if groupable?(input)
groups = input.group_by { |item| item_property(item, property).to_s }
grouped_array(groups)
else
input
end
end
# Group an array of items by an expression
#
# input - the object array
# variable - the variable to assign each item to in the expression
# expression -a Liquid comparison expression passed in as a string
#
# Returns the filtered array of objects
def group_by_exp(input, variable, expression)
return input unless groupable?(input)
parsed_expr = parse_expression(expression)
@context.stack do
groups = input.group_by do |item|
@context[variable] = item
parsed_expr.render(@context)
end
grouped_array(groups)
end
end
private
def parse_expression(str)
Liquid::Variable.new(str, {})
end
private
def groupable?(element)
element.respond_to?(:group_by)
end
private
def grouped_array(groups)
groups.each_with_object([]) do |item, array|
array << {
"name" => item.first,
"items" => item.last,
"size" => item.last.size,
}
end
end
end
end
end

View File

@@ -23,9 +23,9 @@ module Jekyll
def relative_url(input)
return if input.nil?
site = @context.registers[:site]
parts = [site.config["baseurl"], input]
return ensure_leading_slash(input.to_s) if site.config["baseurl"].nil?
Addressable::URI.parse(
parts.compact.map { |part| ensure_leading_slash(part.to_s) }.join
ensure_leading_slash(site.config["baseurl"]) + ensure_leading_slash(input.to_s)
).normalize.to_s
end

View File

@@ -6,7 +6,7 @@ module Jekyll
PRIORITY_MAP = {
:low => 10,
:normal => 20,
:high => 30,
:high => 30
}.freeze
# initial empty hooks
@@ -17,26 +17,26 @@ module Jekyll
:post_read => [],
:pre_render => [],
:post_render => [],
:post_write => [],
:post_write => []
},
:pages => {
:post_init => [],
:pre_render => [],
:post_render => [],
:post_write => [],
:post_write => []
},
:posts => {
:post_init => [],
:pre_render => [],
:post_render => [],
:post_write => [],
:post_write => []
},
:documents => {
:post_init => [],
:pre_render => [],
:post_render => [],
:post_write => [],
},
:post_write => []
}
}
# map of all hooks and their priorities
@@ -64,7 +64,7 @@ module Jekyll
:post_init => [],
:pre_render => [],
:post_render => [],
:post_write => [],
:post_write => []
}
unless @registry[owner][event]

View File

@@ -6,7 +6,7 @@ module Jekyll
:debug => ::Logger::DEBUG,
:info => ::Logger::INFO,
:warn => ::Logger::WARN,
:error => ::Logger::ERROR,
:error => ::Logger::ERROR
}.freeze
# Public: Create a new instance of a log writer

View File

@@ -58,7 +58,7 @@ module Jekyll
# The generated directory into which the page will be placed
# upon generation. This is derived from the permalink or, if
# permalink is absent, will be '/'
# permalink is absent, we be '/'
#
# Returns the String destination directory.
def dir
@@ -98,7 +98,7 @@ module Jekyll
@url ||= URL.new({
:template => template,
:placeholders => url_placeholders,
:permalink => permalink,
:permalink => permalink
}).to_s
end
@@ -108,7 +108,7 @@ module Jekyll
{
:path => @dir,
:basename => basename,
:output_ext => output_ext,
:output_ext => output_ext
}
end

View File

@@ -5,7 +5,7 @@ module Jekyll
:highest => 100,
:lowest => -100,
:normal => 0,
:high => 10,
:high => 10
}.freeze
#

View File

@@ -71,7 +71,7 @@ module Jekyll
#
# Returns nothing.
def retrieve_dirs(_base, dir, dot_dirs)
dot_dirs.each do |file|
dot_dirs.map do |file|
dir_path = site.in_source_dir(dir, file)
rel_path = File.join(dir, file)
unless @site.dest.sub(%r!/$!, "") == dir_path

View File

@@ -7,20 +7,20 @@ module Jekyll
@entry_filter = EntryFilter.new(site)
end
# Read all the files in <dir> and adds them to @content
# Read all the files in <source>/<dir>/_drafts and create a new Draft
# object with each one.
#
# dir - The String relative path of the directory to read.
#
# Returns @content, a Hash of the .yaml, .yml,
# .json, and .csv files in the base directory
# Returns nothing.
def read(dir)
base = site.in_source_dir(dir)
read_data_to(base, @content)
@content
end
# Read and parse all .yaml, .yml, .json, and .csv
# files under <dir> and add them to the <data> variable.
# Read and parse all yaml files under <dir> and add them to the
# <data> variable.
#
# dir - The string absolute path of the directory to read.
# data - The variable to which data will be added.
@@ -54,7 +54,7 @@ module Jekyll
when ".csv"
CSV.read(path, {
:headers => true,
:encoding => site.config["encoding"],
:encoding => site.config["encoding"]
}).map(&:to_hash)
else
SafeYAML.load_file(path)

View File

@@ -57,7 +57,7 @@ module Jekyll
path = @site.in_source_dir(File.join(dir, magic_dir, entry))
Document.new(path, {
:site => @site,
:collection => @site.posts,
:collection => @site.posts
})
end.reject(&:nil?)
end

View File

@@ -40,7 +40,7 @@ module Jekyll
metadata[path] = {
"mtime" => File.mtime(path),
"deps" => [],
"deps" => []
}
cache[path] = true
end

View File

@@ -26,15 +26,15 @@ module Jekyll
def build_index
self.class.lsi ||= begin
lsi = ClassifierReborn::LSI.new(:auto_rebuild => false)
Jekyll.logger.info("Populating LSI...")
display("Populating LSI...")
site.posts.docs.each do |x|
lsi.add_item(x)
end
Jekyll.logger.info("Rebuilding index...")
display("Rebuilding index...")
lsi.build_index
Jekyll.logger.info("")
display("")
lsi
end
end
@@ -46,5 +46,11 @@ module Jekyll
def most_recent_posts
@most_recent_posts ||= (site.posts.docs.reverse - [post]).first(10)
end
def display(output)
$stdout.print("\n")
$stdout.print(Jekyll.logger.formatted_topic(output))
$stdout.flush
end
end
end

View File

@@ -302,7 +302,7 @@ module Jekyll
Jekyll.logger.abort_with "Since v3.0, permalinks for pages" \
" in subfolders must be relative to the" \
" site source directory, not the parent" \
" directory. Check https://jekyllrb.com/docs/upgrading/"\
" directory. Check http://jekyllrb.com/docs/upgrading/"\
" for more info."
end
end
@@ -435,7 +435,7 @@ module Jekyll
private
def configure_include_paths
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
@includes_load_paths << theme.includes_path if theme && theme.includes_path
@includes_load_paths << theme.includes_path if self.theme
end
private

View File

@@ -28,10 +28,6 @@ module Jekyll
@collection = collection
@relative_path = File.join(*[@dir, @name].compact)
@extname = File.extname(@name)
data.default_proc = proc do |_, key|
site.frontmatter_defaults.find(relative_path, type, key)
end
end
# rubocop: enable ParameterLists
@@ -100,15 +96,13 @@ module Jekyll
end
def to_liquid
@to_liquid ||= Drops::StaticFileDrop.new(self)
end
def data
@data ||= {}
end
def basename
File.basename(name, extname)
{
"basename" => File.basename(name, extname),
"name" => name,
"extname" => extname,
"modified_time" => modified_time,
"path" => File.join("", relative_path)
}
end
def placeholders
@@ -118,7 +112,7 @@ module Jekyll
@collection.relative_directory.size..relative_path.size],
:output_ext => "",
:name => "",
:title => "",
:title => ""
}
end
@@ -131,7 +125,7 @@ module Jekyll
else
::Jekyll::URL.new({
:template => @collection.url_template,
:placeholders => placeholders,
:placeholders => placeholders
})
end.to_s.gsub(%r!/$!, "")
end

View File

@@ -54,7 +54,7 @@ eos
[:hl_lines, opts.fetch(:hl_lines, nil)],
[:linenos, opts.fetch(:linenos, nil)],
[:encoding, opts.fetch(:encoding, "utf-8")],
[:cssclass, opts.fetch(:cssclass, nil)],
[:cssclass, opts.fetch(:cssclass, nil)]
].reject { |f| f.last.nil? }]
else
opts
@@ -125,7 +125,7 @@ eos
def add_code_tag(code)
code_attributes = [
"class=\"language-#{@lang.to_s.tr("+", "-")}\"",
"data-lang=\"#{@lang}\"",
"data-lang=\"#{@lang}\""
].join(" ")
"<figure class=\"highlight\"><pre><code #{code_attributes}>"\
"#{code.chomp}</code></pre></figure>"

View File

@@ -112,8 +112,8 @@ eos
def locate_include_file(context, file, safe)
includes_dirs = tag_includes_dirs(context)
includes_dirs.each do |dir|
path = File.join(dir.to_s, file.to_s)
return path if valid_include_file?(path, dir.to_s, safe)
path = File.join(dir, file)
return path if valid_include_file?(path, dir, safe)
end
raise IOError, "Could not locate the included file '#{file}' in any of "\
"#{includes_dirs}. Ensure it exists in one of those directories and, "\
@@ -155,19 +155,15 @@ eos
if cached_partial.key?(path)
cached_partial[path]
else
unparsed_file = context.registers[:site]
cached_partial[path] = context.registers[:site]
.liquid_renderer
.file(path)
begin
cached_partial[path] = unparsed_file.parse(read_file(path, context))
rescue Liquid::SyntaxError => ex
raise IncludeTagError.new(ex.message, path)
end
.parse(read_file(path, context))
end
end
def valid_include_file?(path, dir, safe)
!outside_site_source?(path, dir, safe) && File.file?(path)
!(outside_site_source?(path, dir, safe) || !File.exist?(path))
end
def outside_site_source?(path, dir, safe)

View File

@@ -14,9 +14,8 @@ module Jekyll
"'#{name}' does not contain valid date and/or title."
end
escaped_slug = Regexp.escape(slug)
@name_regex = %r!^_posts/#{path}#{date}-#{escaped_slug}\.[^.]+|
^#{path}_posts/?#{date}-#{escaped_slug}\.[^.]+!x
@name_regex = %r!^_posts/#{path}#{date}-#{slug}\.[^.]+|
^#{path}_posts/?#{date}-#{slug}\.[^.]+!x
end
def post_date

View File

@@ -28,7 +28,7 @@ class Jekyll::ThemeBuilder
def template_file(filename)
[
root.join("theme_template", "#{filename}.erb"),
root.join("theme_template", filename.to_s),
root.join("theme_template", filename.to_s)
].find(&:exist?)
end

View File

@@ -1,4 +1,4 @@
require "addressable/uri"
require "uri"
# Public: Methods that generate a URL for a resource such as a Post or a Page.
#
@@ -84,36 +84,14 @@ module Jekyll
end
end
# We include underscores in keys to allow for 'i_month' and so forth.
# This poses a problem for keys which are followed by an underscore
# but the underscore is not part of the key, e.g. '/:month_:day'.
# That should be :month and :day, but our key extraction regexp isn't
# smart enough to know that so we have to make it an explicit
# possibility.
def possible_keys(key)
if key.end_with?("_")
[key, key.chomp("_")]
else
[key]
end
end
def generate_url_from_drop(template)
template.gsub(%r!:([a-z_]+)!) do |match|
pool = possible_keys(match.sub(":".freeze, "".freeze))
winner = pool.find { |key| @placeholders.key?(key) }
if winner.nil?
raise NoMethodError,
"The URL template doesn't have #{pool.join(" or ")} keys. "\
"Check your permalink template!"
replacement = @placeholders.public_send(match.sub(":".freeze, "".freeze))
if replacement.nil?
"".freeze
else
self.class.escape_path(replacement)
end
value = @placeholders[winner]
value = "" if value.nil?
replacement = self.class.escape_path(value)
match.sub(":#{winner}", replacement)
end.gsub(%r!//!, "/".freeze)
end
@@ -145,8 +123,7 @@ module Jekyll
# pct-encoded = "%" HEXDIG HEXDIG
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*" / "+" / "," / ";" / "="
path = Addressable::URI.encode(path)
path.encode("utf-8").sub("#", "%23")
URI.escape(path, %r{[^a-zA-Z\d\-._~!$&'()*+,;=:@\/]}).encode("utf-8")
end
# Unescapes a URL path segment
@@ -160,7 +137,7 @@ module Jekyll
#
# Returns the unescaped path.
def self.unescape_path(path)
Addressable::URI.unencode(path.encode("utf-8"))
URI.unescape(path.encode("utf-8"))
end
end
end

View File

@@ -2,10 +2,8 @@
module Jekyll
module Utils
extend self
autoload :Ansi, "jekyll/utils/ansi"
autoload :Exec, "jekyll/utils/exec"
autoload :Platforms, "jekyll/utils/platforms"
autoload :WinTZ, "jekyll/utils/win_tz"
autoload :Ansi, "jekyll/utils/ansi"
# Constants for use in #slugify
SLUGIFY_MODES = %w(raw default pretty ascii).freeze

View File

@@ -17,7 +17,7 @@ module Jekyll
:yellow => 33,
:white => 37,
:blue => 34,
:cyan => 36,
:cyan => 36
}.freeze
# Strip ANSI from the current string. It also strips cursor stuff,

View File

@@ -1,25 +0,0 @@
require "open3"
module Jekyll
module Utils
module Exec
extend self
# Runs a program in a sub-shell.
#
# *args - a list of strings containing the program name and arguments
#
# Returns a Process::Status and a String of output in an array in
# that order.
def run(*args)
stdin, stdout, stderr, process = Open3.popen3(*args)
out = stdout.read.strip
err = stderr.read.strip
[stdin, stdout, stderr].each(&:close)
[process.value, out + err]
end
end
end
end

View File

@@ -19,29 +19,16 @@ module Jekyll
# /proc/version returns nothing to us.
# --
def vanilla_windows?
def really_windows?
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
!proc_version
end
# --
# XXX: Remove in 4.0
# --
alias_method :really_windows?, \
:vanilla_windows?
#
def bash_on_windows?
RbConfig::CONFIG["host_os"] =~ %r!linux! && \
proc_version =~ %r!microsoft!i
end
#
def windows?
vanilla_windows? || bash_on_windows?
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i || \
proc_version =~ %r!microsoft!i
end
#

View File

@@ -1,73 +0,0 @@
module Jekyll
module Utils
module WinTZ
extend self
# Public: Calculate the Timezone for Windows when the config file has a defined
# 'timezone' key.
#
# timezone - the IANA Time Zone specified in "_config.yml"
#
# Returns a string that ultimately re-defines ENV["TZ"] in Windows
def calculate(timezone)
External.require_with_graceful_fail("tzinfo")
tz = TZInfo::Timezone.get(timezone)
difference = Time.now.to_i - tz.now.to_i
#
# POSIX style definition reverses the offset sign.
# e.g. Eastern Standard Time (EST) that is 5Hrs. to the 'west' of Prime Meridian
# is denoted as:
# EST+5 (or) EST+05:00
# Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
sign = difference < 0 ? "-" : "+"
offset = sign == "-" ? "+" : "-" unless difference.zero?
#
# convert the difference (in seconds) to hours, as a rational number, and perform
# a modulo operation on it.
modulo = modulo_of(rational_hour(difference))
#
# Format the hour as a two-digit number.
# Establish the minutes based on modulo expression.
hh = format("%02d", absolute_hour(difference).ceil)
mm = modulo.zero? ? "00" : "30"
Jekyll.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}"
#
# Note: The 3-letter-word below doesn't have a particular significance.
"WTZ#{sign}#{hh}:#{mm}"
end
private
# Private: Convert given seconds to an hour as a rational number.
#
# seconds - supplied as an integer, it is converted to a rational number.
# 3600 - no. of seconds in an hour.
#
# Returns a rational number.
def rational_hour(seconds)
seconds.to_r/3600
end
# Private: Convert given seconds to an hour as an absolute number.
#
# seconds - supplied as an integer, it is converted to its absolute.
# 3600 - no. of seconds in an hour.
#
# Returns an integer.
def absolute_hour(seconds)
seconds.abs/3600
end
# Private: Perform a modulo operation on a given fraction.
#
# fraction - supplied as a rational number, its numerator is divided
# by its denominator and the remainder returned.
#
# Returns an integer.
def modulo_of(fraction)
fraction.numerator % fraction.denominator
end
end
end
end

View File

@@ -1,3 +1,3 @@
module Jekyll
VERSION = "3.4.5".freeze
VERSION = "3.3.0".freeze
end

View File

@@ -2,7 +2,7 @@
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# yourself editing these this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use

View File

@@ -20,6 +20,6 @@ print_hi('Tom')
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekylls GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-docs]: http://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/

Some files were not shown because too many files have changed in this diff Show More