mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
107 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42d92d1860 | ||
|
|
4a981a8a30 | ||
|
|
31ebf86fdb | ||
|
|
cd39dc962e | ||
|
|
fe12951090 | ||
|
|
2325123529 | ||
|
|
e300f897ea | ||
|
|
ce4363ca52 | ||
|
|
155300f0e9 | ||
|
|
17ce428dc4 | ||
|
|
42150e92e1 | ||
|
|
37737b22ae | ||
|
|
3372a0bb85 | ||
|
|
18b0a5e8b0 | ||
|
|
7e6769aab9 | ||
|
|
e7f53e68e6 | ||
|
|
11b3d1e477 | ||
|
|
76ef58e9e1 | ||
|
|
ee1d210e77 | ||
|
|
01ea2471ee | ||
|
|
4ea4f1499a | ||
|
|
070a4d421b | ||
|
|
0f46edd088 | ||
|
|
5ab445a6d2 | ||
|
|
bd95dbd7eb | ||
|
|
acc0797126 | ||
|
|
433d449d14 | ||
|
|
c50821b69c | ||
|
|
970f3a1d82 | ||
|
|
7f118454b5 | ||
|
|
2b31497926 | ||
|
|
9bdb9c90db | ||
|
|
672da32e7a | ||
|
|
8fe3a5d59b | ||
|
|
331361aee6 | ||
|
|
8681d67d76 | ||
|
|
917c7b13ad | ||
|
|
a6e21936a5 | ||
|
|
f98b2492fc | ||
|
|
071913e350 | ||
|
|
82fc6ba01c | ||
|
|
0ac94d7766 | ||
|
|
5a2f8d7279 | ||
|
|
382002ae42 | ||
|
|
5b90cecbc9 | ||
|
|
9bfd37570b | ||
|
|
cbde121dc4 | ||
|
|
5db0b067be | ||
|
|
ae1d7c5aa2 | ||
|
|
687785a00d | ||
|
|
ac7b264112 | ||
|
|
7683292976 | ||
|
|
24515914b4 | ||
|
|
d276dc2698 | ||
|
|
262d950b27 | ||
|
|
2ca200bc2d | ||
|
|
56862cac6c | ||
|
|
82128692f5 | ||
|
|
fbc79f6605 | ||
|
|
e894f830fa | ||
|
|
51a65754bf | ||
|
|
ce68268aaa | ||
|
|
9e4b4f2bd1 | ||
|
|
7ff9a885b8 | ||
|
|
5c4e125dad | ||
|
|
cc5c850a03 | ||
|
|
72d853779f | ||
|
|
c945c48b79 | ||
|
|
27e1433ee0 | ||
|
|
9c574f779f | ||
|
|
47b67f1222 | ||
|
|
b8d5a04b57 | ||
|
|
8701fdbc29 | ||
|
|
f29c72e0b9 | ||
|
|
fbeadab63f | ||
|
|
3c06609406 | ||
|
|
f3b6877a39 | ||
|
|
c2dff2cd15 | ||
|
|
cb11099394 | ||
|
|
17efa2a485 | ||
|
|
02133f4e1f | ||
|
|
77208fac2c | ||
|
|
f157093ab3 | ||
|
|
a395dfe27c | ||
|
|
889af57f03 | ||
|
|
b5772dc787 | ||
|
|
21d8def9ed | ||
|
|
f15804423e | ||
|
|
511ea72d05 | ||
|
|
41c82448ae | ||
|
|
ee35322193 | ||
|
|
a7e8f08bea | ||
|
|
a4171db345 | ||
|
|
aedb403afd | ||
|
|
924ca62bd2 | ||
|
|
cc52cac81a | ||
|
|
91abe9f741 | ||
|
|
d9a2758ff6 | ||
|
|
48e2de862d | ||
|
|
5687a09255 | ||
|
|
03c252ba4d | ||
|
|
6792ff936c | ||
|
|
d22b8ee392 | ||
|
|
b89efa5d5d | ||
|
|
450da91b4b | ||
|
|
b18872b658 | ||
|
|
74581422e3 |
75
.github/workflows/ci.yml
vendored
Normal file
75
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- "*-stable"
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- "*-stable"
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: "Run Tests (${{ matrix.label }})"
|
||||
runs-on: "ubuntu-latest"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- label: Ruby 2.5
|
||||
ruby_version: "2.5"
|
||||
- label: Ruby 2.7
|
||||
ruby_version: "2.7"
|
||||
- label: Ruby 3.0
|
||||
ruby_version: "3.0"
|
||||
- label: Ruby 3.1
|
||||
ruby_version: "3.1"
|
||||
- label: Ruby 3.2
|
||||
ruby_version: "3.2"
|
||||
- label: JRuby 9.2.20.1
|
||||
ruby_version: "jruby-9.2.20.1"
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: "Set up ${{ matrix.label }}"
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby_version }}
|
||||
bundler-cache: true
|
||||
cache-version: 2
|
||||
- name: Run Minitest based tests
|
||||
run: bash script/test
|
||||
- name: Run Cucumber based tests
|
||||
if: "!contains(matrix.ruby_version, 'jruby')"
|
||||
run: bash script/cucumber
|
||||
- name: Generate and Build a new site
|
||||
run: bash script/default-site
|
||||
|
||||
xtras:
|
||||
name: "${{ matrix.job_name }} (Ruby ${{ matrix.ruby_version }})"
|
||||
runs-on: "ubuntu-latest"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- job_name: "Profile Docs Site"
|
||||
step_name: "Build and Profile docs site"
|
||||
script_file: "profile-docs"
|
||||
ruby_version: "2.5"
|
||||
- job_name: "Style Check"
|
||||
step_name: "Run RuboCop"
|
||||
script_file: "fmt"
|
||||
ruby_version: "2.5"
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby_version }}
|
||||
bundler-cache: true
|
||||
cache-version: 2
|
||||
- name: ${{ matrix.step_name }}
|
||||
run: bash script/${{ matrix.script_file }}
|
||||
34
.github/workflows/release.yml
vendored
Normal file
34
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Release Gem
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- "*-stable"
|
||||
paths:
|
||||
- "lib/**/version.rb"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: "github.repository_owner == 'jekyll'"
|
||||
name: "Release Gem (Ruby ${{ matrix.ruby_version }})"
|
||||
runs-on: "ubuntu-latest"
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
ruby_version:
|
||||
- 2.7
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby_version }}
|
||||
bundler-cache: true
|
||||
- name: Build and Publish Gem
|
||||
uses: ashmaroli/release-gem@dist
|
||||
with:
|
||||
gemspec_name: jekyll
|
||||
env:
|
||||
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}
|
||||
39
.github/workflows/third-party.yml
vendored
Normal file
39
.github/workflows/third-party.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Third-Party Repository Profiling
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 3.9-stable
|
||||
pull_request:
|
||||
branches:
|
||||
- 3.9-stable
|
||||
jobs:
|
||||
build_n_profile:
|
||||
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
||||
runs-on: 'ubuntu-latest'
|
||||
env:
|
||||
BUNDLE_GEMFILE: "sandbox/Gemfile"
|
||||
BUNDLE_PATH: "vendor/bundle"
|
||||
BUNDLE_JOBS: 4
|
||||
BUNDLE_RETRY: 3
|
||||
steps:
|
||||
- name: Checkout Jekyll
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 5
|
||||
path: jekyll
|
||||
- name: Checkout Third-Party Repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ashmaroli/tomjoht.github.io
|
||||
path: sandbox
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
bundler-cache: true
|
||||
- name: Run Jekyll Build 3 times
|
||||
run: |
|
||||
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
||||
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
||||
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
||||
12
.rubocop.yml
12
.rubocop.yml
@@ -8,7 +8,7 @@ Jekyll/NoPutsAllowed:
|
||||
- rake/*.rake
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.3
|
||||
TargetRubyVersion: 2.1
|
||||
Include:
|
||||
- lib/**/*.rb
|
||||
Exclude:
|
||||
@@ -53,7 +53,7 @@ Layout/EmptyComment:
|
||||
Enabled: false
|
||||
Layout/EndAlignment:
|
||||
Severity: error
|
||||
Lint/UnneededRequireStatement:
|
||||
Lint/SplatKeywordArguments:
|
||||
Enabled: false
|
||||
Lint/UnreachableCode:
|
||||
Severity: error
|
||||
@@ -107,8 +107,6 @@ Naming/MemoizedInstanceVariableName:
|
||||
Naming/UncommunicativeMethodParamName:
|
||||
AllowedNames:
|
||||
- _
|
||||
Performance/UnfreezeString:
|
||||
Enabled: false
|
||||
Security/MarshalLoad:
|
||||
Exclude:
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
@@ -152,8 +150,6 @@ Style/ModuleFunction:
|
||||
Enabled: false
|
||||
Style/MultilineTernaryOperator:
|
||||
Severity: error
|
||||
Style/NumericPredicate:
|
||||
Enabled: false
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
"%q": "{}"
|
||||
@@ -163,8 +159,6 @@ Style/PercentLiteralDelimiters:
|
||||
"%w": "()"
|
||||
"%W": "()"
|
||||
"%x": "()"
|
||||
Style/RedundantFreeze:
|
||||
Enabled: false
|
||||
Style/RedundantReturn:
|
||||
Enabled: false
|
||||
Style/RedundantSelf:
|
||||
@@ -173,8 +167,6 @@ Style/RegexpLiteral:
|
||||
EnforcedStyle: percent_r
|
||||
Style/RescueModifier:
|
||||
Enabled: false
|
||||
Style/SafeNavigation:
|
||||
Enabled: false
|
||||
Style/SignalException:
|
||||
EnforcedStyle: only_raise
|
||||
Style/SingleLineMethods:
|
||||
|
||||
55
.travis.yml
55
.travis.yml
@@ -1,55 +0,0 @@
|
||||
bundler_args: --without benchmark:site:development
|
||||
script: script/cibuild
|
||||
cache: bundler
|
||||
language: ruby
|
||||
sudo: false
|
||||
|
||||
rvm:
|
||||
- &ruby1 2.5.1
|
||||
- &ruby2 2.4.4
|
||||
- &ruby3 2.3.7
|
||||
- &jruby jruby-9.1.16.0
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=fmt
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=default-site
|
||||
exclude:
|
||||
- rvm: *jruby
|
||||
env: TEST_SUITE=cucumber
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- TEST_SUITE=test
|
||||
- TEST_SUITE=cucumber
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
- /*-stable/
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
secure: "\
|
||||
dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4Y\
|
||||
GEilNRzKPz18AsFptVXofpwyqcBxaCfmHP809NX5PHBaadydveLm+TNVao2XeLXSWu+HUNAY\
|
||||
O1AanCUbJSEyJTju347xCBGzESU=\
|
||||
"
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
repo_token:
|
||||
secure: "\
|
||||
mAuvDu+nrzB8dOaLqsublDGt423mGRyZYM3vsrXh4Tf1sT+L1PxsRzU4gLmcV27HtX2Oq9\
|
||||
DA4vsRURfABU0fIhwYkQuZqEcA3d8TL36BZcGEshG6MQ2AmnYsmFiTcxqV5bmlElHEqQuT\
|
||||
5SUFXLafgZPBnL0qDwujQcHukID41sE=\
|
||||
"
|
||||
# regular test configuration
|
||||
after_success:
|
||||
- bundle exec codeclimate-test-reporter
|
||||
|
||||
before_install:
|
||||
- gem update --system
|
||||
- gem install bundler
|
||||
66
Gemfile
66
Gemfile
@@ -5,13 +5,13 @@ gemspec :name => "jekyll"
|
||||
|
||||
gem "rake", "~> 12.0"
|
||||
|
||||
gem "rouge", ENV["ROUGE"] if ENV["ROUGE"]
|
||||
|
||||
group :development do
|
||||
gem "launchy", "~> 2.3"
|
||||
gem "pry"
|
||||
|
||||
unless RUBY_ENGINE == "jruby"
|
||||
gem "pry-byebug"
|
||||
end
|
||||
gem "pry-byebug" unless RUBY_ENGINE == "jruby"
|
||||
end
|
||||
|
||||
#
|
||||
@@ -22,22 +22,35 @@ group :test do
|
||||
gem "httpclient"
|
||||
gem "jekyll_test_plugin"
|
||||
gem "jekyll_test_plugin_malicious"
|
||||
gem "nokogiri", "~> 1.7"
|
||||
gem "nokogiri", "~> 1.9"
|
||||
|
||||
# Ruby 3.1.0 shipped with `psych-4.0.3` which caused some of our Cucumber-based tests to fail.
|
||||
# TODO: Remove lock once we implement a way to use Psych 4 without breaking anything.
|
||||
# See https://github.com/jekyll/jekyll/pull/8918
|
||||
gem "psych", "~> 3.3"
|
||||
|
||||
gem "rspec"
|
||||
gem "rspec-mocks"
|
||||
gem "rubocop", "~> 0.55.0"
|
||||
gem "rubocop", "~> 0.56.0"
|
||||
gem "test-dependency-theme", :path => File.expand_path("test/fixtures/test-dependency-theme", __dir__)
|
||||
gem "test-theme", :path => File.expand_path("test/fixtures/test-theme", __dir__)
|
||||
gem "test-theme-skinny", :path => File.expand_path("test/fixtures/test-theme-skinny", __dir__)
|
||||
gem "test-theme-symlink", :path => File.expand_path("test/fixtures/test-theme-symlink", __dir__)
|
||||
|
||||
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
|
||||
gem "webrick" if RUBY_VERSION >= "3"
|
||||
|
||||
# http_parser.rb has stopped shipping jruby-compatible versions
|
||||
# latest compatible one was 0.6.0 https://rubygems.org/gems/http_parser.rb
|
||||
if RUBY_ENGINE == "jruby"
|
||||
gem "http_parser.rb", "~> 0.6.0"
|
||||
gem "jruby-openssl"
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
group :test_legacy do
|
||||
if RUBY_PLATFORM =~ %r!cygwin!
|
||||
gem "test-unit"
|
||||
end
|
||||
gem "test-unit" if RUBY_PLATFORM =~ %r!cygwin!
|
||||
|
||||
gem "minitest"
|
||||
gem "minitest-profile"
|
||||
@@ -60,36 +73,49 @@ 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", "~> 0.9"
|
||||
gem "jekyll-gist"
|
||||
gem "jekyll-paginate"
|
||||
gem "jekyll-redirect-from"
|
||||
gem "kramdown", "~> 1.14"
|
||||
|
||||
# Add gem 'matrix'
|
||||
# Ref: https://github.com/jekyll/jekyll/commit/d0eb07ba29dc7d5f52defab855bdb7a768cf824c
|
||||
gem "matrix"
|
||||
|
||||
gem "mime-types", "~> 3.0"
|
||||
gem "rdoc", "~> 6.0"
|
||||
gem "tomlrb", "~> 1.2"
|
||||
gem "rdoc", "~> 6.3.0"
|
||||
gem "tomlrb", "~> 2.0"
|
||||
|
||||
if ENV["KRAMDOWN_VERSION"].nil? || ENV["KRAMDOWN_VERSION"].to_i >= 2
|
||||
gem "kramdown-syntax-coderay"
|
||||
gem "kramdown-parser-gfm"
|
||||
else
|
||||
gem "coderay", "~> 1.0"
|
||||
end
|
||||
|
||||
platform :ruby, :mswin, :mingw, :x64_mingw do
|
||||
gem "classifier-reborn", "~> 2.2.0"
|
||||
gem "liquid-c", "~> 3.0"
|
||||
gem "liquid-c", "~> 4.0"
|
||||
gem "pygments.rb", "~> 1.0"
|
||||
gem "rdiscount", "~> 2.0"
|
||||
gem "yajl-ruby", "~> 1.3"
|
||||
gem "redcarpet", "~> 3.2", ">= 3.2.3"
|
||||
gem "yajl-ruby", "~> 1.3.1"
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem "tzinfo-data", :platforms => [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
# and associated library
|
||||
platforms :jruby, :mswin, :mingw, :x64_mingw do
|
||||
gem "tzinfo", ENV["TZINFO_VERSION"] if ENV["TZINFO_VERSION"]
|
||||
gem "tzinfo-data"
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
group :site do
|
||||
if ENV["PROOF"]
|
||||
gem "html-proofer", "~> 3.4"
|
||||
end
|
||||
gem "html-proofer", "~> 3.4" if ENV["PROOF"]
|
||||
|
||||
gem "jekyll-avatar"
|
||||
gem "jekyll-mentions"
|
||||
|
||||
117
History.markdown
117
History.markdown
@@ -1,42 +1,91 @@
|
||||
## HEAD
|
||||
## 3.9.3 / 2023-01-27
|
||||
|
||||
### Documentation
|
||||
### Bug Fixes
|
||||
|
||||
* Release post for v3.8.0 (#6849)
|
||||
* Add Installation Instructions for Ubuntu (#6925)
|
||||
* add liquid tag jekyll-flickr (#6946)
|
||||
* Add 4.0 development post (#6934)
|
||||
* Updated copy - fixed casing of SaaS on resources page. (#6949)
|
||||
* WIP: Do not advise users to install Jekyll outside of Bundler (#6927)
|
||||
* Don't prompt for sudo when installing with Ubuntu WSL (#6781)
|
||||
* Fix typo (#6969)
|
||||
* Add version number for group_by_exp doc (#6956)
|
||||
* Update Windows install docs (#6926)
|
||||
* Remove documentation for using Redcarpet (#6990)
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* use jekyll-compose if installed (#6932)
|
||||
* Memoize computing excerpt's relative_path (#6951)
|
||||
* Liquefied link tag (#6269)
|
||||
* Suggest re-running command with --trace on fail (#6551)
|
||||
|
||||
### Major Enhancements
|
||||
|
||||
* Remove unused error class (#6511)
|
||||
* Drop support for Ruby 2.1 and 2.2 (#6560)
|
||||
* Add vendor folder to a newly installed site's .gitignore (#6968)
|
||||
* bump i18n (#6931)
|
||||
* We are not using Ruby 2.2 anymore (#6977)
|
||||
* Drop support for older versions of Rouge (#6978)
|
||||
* Remove support for Redcarpet (#6987)
|
||||
* 3.9.x: Support i18n 1.x (#9269)
|
||||
* Backport #8880 for v3.9.x: Support both tzinfo v1 and v2 alongwith
|
||||
non-half hour offsets (#9280)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Remove unnecessary Jekyll::Page constant (#6770)
|
||||
* Loggers should accept both numbers and symbols (#6967)
|
||||
* Update instructions for releasing docs Gem (#6975)
|
||||
* yajl-ruby update to v1.4.0 (#6976)
|
||||
* v3.9.x: test under Ruby 3.2 #9272)
|
||||
* v3.9.x: fix rdiscount test (#9277)
|
||||
|
||||
## 3.9.2 / 2022-03-27
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Lock `http_parser.rb` gem to `v0.6.x` on JRuby (#8943)
|
||||
* Backport #8756 for v3.9.x: Respect collections_dir config within include tag (#8795)
|
||||
* Backport #8965 for v3.9.x: Fix response header for content served via `jekyll serve` (#8976)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Update and fix CI for `3.9-stable` on Ruby 3.x (#8942)
|
||||
* Fix CI for commits to `3.9-stable` branch (#8788)
|
||||
|
||||
## 3.9.1 / 2021-04-08
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Backport #8618 for v3.9.x: Update include tag to be more permissive (#8629)
|
||||
|
||||
## 3.9.0 / 2020-08-05
|
||||
|
||||
### Minor Enhancements
|
||||
|
||||
* Allow use of kramdown v2 (#8322)
|
||||
* Add default language for kramdown syntax highlighting (#8325)
|
||||
|
||||
## 3.8.7 / 2020-05-08
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Prevent console warnings with Ruby 2.7 (#8125)
|
||||
|
||||
## 3.8.6 / 2019-07-02
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update log output for an invalid theme directory (#7734)
|
||||
* Memoize `SiteDrop#documents` to reduce allocations (#7722)
|
||||
* Excerpt handling of custom and intermediate tags (#7467)
|
||||
* Escape valid special chars in a site's path name (#7573)
|
||||
* Revert memoizing `Site#docs_to_write` and refactor `#documents` (#7689)
|
||||
* Fix broken `include_relative` usage in excerpt (#7690)
|
||||
* Install platform-specific gems as required (3c06609406)
|
||||
|
||||
### Security Fixes
|
||||
|
||||
* Theme gems: ensure directories aren't symlinks (#7424)
|
||||
|
||||
## 3.8.5 / 2018-11-04
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Re-implement handling Liquid blocks in excerpts (#7250)
|
||||
|
||||
## 3.8.4 / 2018-09-18
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* security: fix `include` bypass of `EntryFilter#filter` symlink check (#7228)
|
||||
|
||||
## 3.8.3 / 2018-06-05
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix --unpublished not affecting collection documents (#7027)
|
||||
|
||||
## 3.8.2 / 2018-05-18
|
||||
|
||||
### Development Fixes
|
||||
|
||||
* Update rubocop version (#7016)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Add whitespace control to LIQUID_TAG_REGEX (#7015)
|
||||
|
||||
## 3.8.1 / 2018-05-01
|
||||
|
||||
|
||||
31
appveyor.yml
31
appveyor.yml
@@ -6,28 +6,37 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
- /.*-stable/
|
||||
|
||||
build: off
|
||||
|
||||
install:
|
||||
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%\bin;%PATH%
|
||||
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH%
|
||||
- bundle install --retry 5 --jobs=%NUMBER_OF_PROCESSORS% --clean --path vendor\bundle
|
||||
|
||||
environment:
|
||||
BUNDLE_WITHOUT: "benchmark:site:development"
|
||||
BUNDLE_WITHOUT: "benchmark:development"
|
||||
matrix:
|
||||
- RUBY_FOLDER_VER: "25"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TZINFO_VERSION: "~> 1.2"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TZINFO_VERSION: "~> 2.0"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "25"
|
||||
TEST_SUITE: "cucumber"
|
||||
- RUBY_FOLDER_VER: "25"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "default-site"
|
||||
- RUBY_FOLDER_VER: "25-x64"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "profile-docs"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TZINFO_VERSION: "~> 1.2"
|
||||
TEST_SUITE: "cucumber"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TZINFO_VERSION: "~> 2.0"
|
||||
TEST_SUITE: "cucumber"
|
||||
|
||||
test_script:
|
||||
- ruby --version
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
version: 3.8.1
|
||||
version: 3.9.3
|
||||
name: Jekyll • Simple, blog-aware, static sites
|
||||
description: Transform your plain text into static websites and blogs
|
||||
url: https://jekyllrb.com
|
||||
|
||||
@@ -689,6 +689,11 @@ liquid:
|
||||
strict_variables: false
|
||||
|
||||
# Markdown Processors
|
||||
rdiscount:
|
||||
extensions: []
|
||||
|
||||
redcarpet:
|
||||
extensions: []
|
||||
|
||||
kramdown:
|
||||
auto_ids: true
|
||||
@@ -723,6 +728,50 @@ mutually exclusive.
|
||||
The various Markdown renderers supported by Jekyll sometimes have extra options
|
||||
available.
|
||||
|
||||
### Redcarpet
|
||||
|
||||
Redcarpet can be configured by providing an `extensions` sub-setting, whose
|
||||
value should be an array of strings. Each string should be the name of one of
|
||||
the `Redcarpet::Markdown` class's extensions; if present in the array, it will
|
||||
set the corresponding extension to `true`.
|
||||
|
||||
Jekyll handles two special Redcarpet extensions:
|
||||
|
||||
- `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
|
||||
extension (for delimiting code blocks with triple tildes or triple backticks)
|
||||
to `true`, probably because GitHub's eager adoption of them is starting to make
|
||||
them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
|
||||
when used with Jekyll; instead, you can use this inverted version of the
|
||||
extension for disabling fenced code.
|
||||
|
||||
Note that you can also specify a language for highlighting after the first
|
||||
delimiter:
|
||||
|
||||
```ruby
|
||||
# ...ruby code
|
||||
```
|
||||
|
||||
With both fenced code blocks and highlighter enabled, this will statically
|
||||
highlight the code; without any syntax highlighter, it will add a
|
||||
`class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
|
||||
hint by various JavaScript code highlighting libraries.
|
||||
|
||||
- `smart` --- This pseudo-extension turns on SmartyPants, which converts
|
||||
straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
|
||||
|
||||
All other extensions retain their usual names from Redcarpet, and no renderer
|
||||
options aside from `smart` can be specified in Jekyll. [A list of available
|
||||
extensions can be found in the Redcarpet README file.][redcarpet_extensions]
|
||||
Make sure you're looking at the README for the right version of
|
||||
Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
|
||||
extensions are:
|
||||
|
||||
- `tables`
|
||||
- `no_intra_emphasis`
|
||||
- `autolink`
|
||||
|
||||
[redcarpet_extensions]: https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use
|
||||
|
||||
### Custom Markdown Processors
|
||||
|
||||
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
|
||||
|
||||
@@ -4,6 +4,129 @@ permalink: "/docs/history/"
|
||||
note: This file is autogenerated. Edit /History.markdown instead.
|
||||
---
|
||||
|
||||
## 3.9.3 / 2023-01-27
|
||||
{: #v3-9-3}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-9-3}
|
||||
|
||||
- 3.9.x: Support i18n 1.x ([#9269]({{ site.repository }}/issues/9269))
|
||||
- Backport [#8880]({{ site.repository }}/issues/8880) for v3.9.x: Support both tzinfo v1 and v2 alongwith
|
||||
non-half hour offsets ([#9280]({{ site.repository }}/issues/9280))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v3-9-3}
|
||||
|
||||
- v3.9.x: test under Ruby 3.2 [#9272]({{ site.repository }}/issues/9272))
|
||||
- v3.9.x: fix rdiscount test ([#9277]({{ site.repository }}/issues/9277))
|
||||
|
||||
|
||||
## 3.9.2 / 2022-03-27
|
||||
{: #v3-9-2}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-9-2}
|
||||
|
||||
- Lock `http_parser.rb` gem to `v0.6.x` on JRuby ([#8943]({{ site.repository }}/issues/8943))
|
||||
- Backport [#8756]({{ site.repository }}/issues/8756) for v3.9.x: Respect collections_dir config within include tag ([#8795]({{ site.repository }}/issues/8795))
|
||||
- Backport [#8965]({{ site.repository }}/issues/8965) for v3.9.x: Fix response header for content served via `jekyll serve` ([#8976]({{ site.repository }}/issues/8976))
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v3-9-2}
|
||||
|
||||
- Update and fix CI for `3.9-stable` on Ruby 3.x ([#8942]({{ site.repository }}/issues/8942))
|
||||
- Fix CI for commits to `3.9-stable` branch ([#8788]({{ site.repository }}/issues/8788))
|
||||
|
||||
|
||||
## 3.9.1 / 2021-04-08
|
||||
{: #v3-9-1}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-9-1}
|
||||
|
||||
- Backport [#8618]({{ site.repository }}/issues/8618) for v3.9.x: Update include tag to be more permissive ([#8629]({{ site.repository }}/issues/8629))
|
||||
|
||||
|
||||
## 3.9.0 / 2020-08-05
|
||||
{: #v3-9-0}
|
||||
|
||||
### Minor Enhancements
|
||||
{: #minor-enhancements-v3-9-0}
|
||||
|
||||
- Allow use of kramdown v2 ([#8322]({{ site.repository }}/issues/8322))
|
||||
- Add default language for kramdown syntax highlighting ([#8325]({{ site.repository }}/issues/8325))
|
||||
|
||||
|
||||
## 3.8.7 / 2020-05-08
|
||||
{: #v3-8-7}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-8-7}
|
||||
|
||||
- Prevent console warnings with Ruby 2.7 ([#8125]({{ site.repository }}/issues/8125))
|
||||
|
||||
|
||||
## 3.8.6 / 2019-07-02
|
||||
{: #v3-8-6}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-8-6}
|
||||
|
||||
- Update log output for an invalid theme directory ([#7734]({{ site.repository }}/issues/7734))
|
||||
- Memoize `SiteDrop#documents` to reduce allocations ([#7722]({{ site.repository }}/issues/7722))
|
||||
- Excerpt handling of custom and intermediate tags ([#7467]({{ site.repository }}/issues/7467))
|
||||
- Escape valid special chars in a site's path name ([#7573]({{ site.repository }}/issues/7573))
|
||||
- Revert memoizing `Site#docs_to_write` and refactor `#documents` ([#7689]({{ site.repository }}/issues/7689))
|
||||
- Fix broken `include_relative` usage in excerpt ([#7690]({{ site.repository }}/issues/7690))
|
||||
- Install platform-specific gems as required (3c06609406)
|
||||
|
||||
### Security Fixes
|
||||
{: #security-fixes-v3-8-6}
|
||||
|
||||
- Theme gems: ensure directories aren't symlinks ([#7424]({{ site.repository }}/issues/7424))
|
||||
|
||||
|
||||
## 3.8.5 / 2018-11-04
|
||||
{: #v3-8-5}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-8-5}
|
||||
|
||||
- Re-implement handling Liquid blocks in excerpts ([#7250]({{ site.repository }}/issues/7250))
|
||||
|
||||
|
||||
## 3.8.4 / 2018-09-18
|
||||
{: #v3-8-4}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-8-4}
|
||||
|
||||
- security: fix `include` bypass of `EntryFilter#filter` symlink check ([#7228]({{ site.repository }}/issues/7228))
|
||||
|
||||
|
||||
## 3.8.3 / 2018-06-05
|
||||
{: #v3-8-3}
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-8-3}
|
||||
|
||||
- Fix --unpublished not affecting collection documents ([#7027]({{ site.repository }}/issues/7027))
|
||||
|
||||
|
||||
## 3.8.2 / 2018-05-18
|
||||
{: #v3-8-2}
|
||||
|
||||
### Development Fixes
|
||||
{: #development-fixes-v3-8-2}
|
||||
|
||||
- Update rubocop version ([#7016]({{ site.repository }}/issues/7016))
|
||||
|
||||
### Bug Fixes
|
||||
{: #bug-fixes-v3-8-2}
|
||||
|
||||
- Add whitespace control to LIQUID_TAG_REGEX ([#7015]({{ site.repository }}/issues/7015))
|
||||
|
||||
|
||||
## 3.8.1 / 2018-05-01
|
||||
{: #v3-8-1}
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@ description: Official guide to install Jekyll on macOS, GNU/Linux or Windows.
|
||||
permalink: /docs/installation/
|
||||
---
|
||||
|
||||
Jekyll is a [Ruby Gem](http://guides.rubygems.org/rubygems-basics/), and can be
|
||||
installed on most systems.
|
||||
|
||||
- [Requirements](#requirements)
|
||||
- [Install Jekyll on macOS](#macOS)
|
||||
- [Install Jekyll on Ubuntu Linux](#ubuntu)
|
||||
- [Install Jekyll on Windows](../windows/)
|
||||
- [Install on macOS](#macOS)
|
||||
- [Install on Windows](../windows/)
|
||||
- [Upgrade Jekyll](#upgrade-jekyll)
|
||||
|
||||
Installing Jekyll should be straight-forward if your system meets the requirements.
|
||||
|
||||
## Requirements
|
||||
|
||||
Before you start, make sure your system has the following:
|
||||
@@ -113,35 +111,6 @@ Check out the [troubleshooting](../troubleshooting/) page or
|
||||
|
||||
</div>
|
||||
|
||||
## Install on Ubuntu Linux {#ubuntu}
|
||||
|
||||
Before we install Jekyll, we need to make sure we have all the required
|
||||
dependencies.
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby ruby-dev build-essential
|
||||
```
|
||||
|
||||
It is best to avoid installing Ruby Gems as the root user. Therefore, we need to
|
||||
set up a gem installation directory for your user account. The following
|
||||
commands will add environment variables to your `~/.bashrc` file to configure
|
||||
the gem installation path. Run them now:
|
||||
|
||||
```sh
|
||||
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
|
||||
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
|
||||
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
Finally, install Jekyll:
|
||||
|
||||
```sh
|
||||
gem install jekyll bundler
|
||||
```
|
||||
|
||||
That's it! You're ready to start using Jekyll.
|
||||
|
||||
## Upgrade Jekyll
|
||||
|
||||
Before you start developing with Jekyll, you may want to check that you're up to date with the latest version. To find the currently installed version of Jekyll, run one of these commands:
|
||||
|
||||
@@ -69,14 +69,6 @@ And then, you're done! :tada: Feel free to celebrate!
|
||||
|
||||
If you have access to the [@jekyllrb](https://twitter.com/jekyllrb) Twitter account, you should tweet the release post from there. If not, just ask another maintainer to do it or to give you access.
|
||||
|
||||
### Build the docs
|
||||
|
||||
We package our documentation as a :gem: Gem for offline use.
|
||||
|
||||
This is done with the
|
||||
[**jekyll-docs**](https://github.com/jekyll/jekyll-docs#building) repository,
|
||||
and more detailed instructions are provided there.
|
||||
|
||||
## For non-core gems
|
||||
|
||||
If you're not a maintainer for `jekyll/jekyll`, the procedure is much simpler in a lot of cases. Generally, the procedure still looks like this:
|
||||
|
||||
@@ -886,7 +886,6 @@ You can find a few useful plugins at the following locations:
|
||||
- [jekyll-html](https://github.com/kacperduras/jekyll-html): A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections.
|
||||
- [jekyll-onebox](https://github.com/rriemann/jekyll-onebox): Liquid tag for displaying HTML previews (embeds) for links to popular domains. Plugin is based on [Onebox](https://github.com/discourse/onebox) that powers link previews in [Discourse](http://github.com/discourse/discourse) forums.
|
||||
- [jekyll-w2m](https://github.com/kacperduras/jekyll-w2m): A Jekyll plugin to liberate content from Microsoft Word documents (powered by [word-to-markdown](https://github.com/benbalter/word-to-markdown)).
|
||||
- [jekyll-flickr](https://github.com/rriemann/jekyll-flickr): Liquid tag for responsive Flickr images using HTML5 srcset. Subtitles and automatic license notices are supported.
|
||||
|
||||
#### Collections
|
||||
|
||||
|
||||
@@ -26,15 +26,13 @@ If you encounter any unexpected errors during the above, please refer to the [tr
|
||||
|
||||
## About Bundler
|
||||
|
||||
`gem install bundler` installs the [bundler](https://rubygems.org/gems/bundler) gem through [RubyGems](https://rubygems.org/). You only need to install it once — not every time you create a new Jekyll project. Here are some additional details:
|
||||
`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 — 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.
|
||||
|
||||
For more information about how to use Bundler in your Jekyll project, this [tutorial](https://jekyllrb.com/tutorials/using-jekyll-with-bundler/) should provide answers to the most common questions and explain how to get up and running quickly.
|
||||
|
||||
## 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:
|
||||
|
||||
@@ -25,7 +25,7 @@ Jekyll's growing use is producing a wide variety of tutorials, frameworks, exten
|
||||
|
||||
## Integrations
|
||||
|
||||
- Use a SaaS service as a backend for forms (contact forms, hiring forms, etc.)
|
||||
- Use a saas service as a backend for forms (contact forms, hiring forms, etc.)
|
||||
|
||||
- [Formspree (open source)](https://formspree.io/)
|
||||
- [FormKeep](https://formkeep.com/guides/contact-form-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
|
||||
|
||||
@@ -147,8 +147,7 @@ you come up with your own tags via plugins.
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Where Expression</strong></p>
|
||||
<p>Select all the objects in an array where the expression is true.
|
||||
{% include docs_version_badge.html version="3.2.0" %}</p>
|
||||
<p>Select all the objects in an array where the expression is true. Jekyll v3.2.0 & later.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
@@ -179,8 +178,7 @@ you come up with your own tags via plugins.
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Group By Expression</strong></p>
|
||||
<p>Group an array's items using a Liquid expression.
|
||||
{% include docs_version_badge.html version="3.4.0" %}</p>
|
||||
<p>Group an array's items using a Liquid expression.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
@@ -588,23 +586,6 @@ One major benefit of using the `link` or `post_url` tag is link validation. If t
|
||||
|
||||
Note you cannot add filters to `link` tags. For example, you cannot append a string using Liquid filters, such as `{% raw %}{% link mypage.html | append: "#section1" %} {% endraw %}`. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.
|
||||
|
||||
The name of the file you want to link 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 link:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% link {{ page.my_variable }} %}{% endraw %}
|
||||
```
|
||||
|
||||
In this example, the link would add link to the file `footer_company_a.html`.
|
||||
|
||||
### Linking to posts
|
||||
|
||||
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
|
||||
|
||||
@@ -7,72 +7,13 @@ While Windows is not an officially-supported platform, it can be used to run Jek
|
||||
|
||||
|
||||
## Installing Jekyll
|
||||
The easiest way to run Jekyll is by using the [RubyInstaller][] for Windows.
|
||||
|
||||
### Installation via RubyInstaller
|
||||
|
||||
[RubyInstaller][] is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more.
|
||||
We only cover RubyInstaller-2.4 and newer here, older versions need to [install the Devkit][Devkit-install] manually.
|
||||
|
||||
1. Download and Install a **Ruby+Devkit** version from [RubyInstaller Downloads][RubyInstaller-downloads].
|
||||
Use default options for installation.
|
||||
2. Open a new command prompt window from the start menu, so that changes to the `PATH` environment variable becomes effective.
|
||||
Install Jekyll and Bundler via: `gem install jekyll bundler`
|
||||
3. Check if Jekyll installed properly: `jekyll -v`
|
||||
|
||||
That's it, you're ready to install our [default minimal blog theme](https://github.com/jekyll/minima) with `jekyll new jekyll-website`.
|
||||
|
||||
[RubyInstaller]: https://rubyinstaller.org/
|
||||
[RubyInstaller-downloads]: https://rubyinstaller.org/downloads/
|
||||
[Devkit-install]: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
|
||||
If you are using Windows 10 Anniversary Update, the easiest way to run Jekyll is by [installing][WSL-Guide] the new Bash on Ubuntu on Windows.
|
||||
|
||||
|
||||
### Encoding
|
||||
### Installation via Bash on Windows 10
|
||||
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header characters exist in your files or very, very bad things will happen to
|
||||
Jekyll. This is especially relevant when you're running Jekyll on Windows.
|
||||
|
||||
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a "Liquid Exception: Incompatible character encoding" error during the site generation process. It can be done with the following command:
|
||||
|
||||
```sh
|
||||
chcp 65001
|
||||
```
|
||||
|
||||
|
||||
### Time-Zone Management
|
||||
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
|
||||
|
||||
Jekyll now uses a rubygem to internally configure Timezone based on established [IANA Timezone Database][IANA-database].
|
||||
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their 'Gemfile' by default, existing sites *will* have to update their 'Gemfile' (and installed) to enable development on Windows:
|
||||
|
||||
```ruby
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
```
|
||||
|
||||
[IANA-database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
|
||||
### Auto Regeneration
|
||||
|
||||
Jekyll uses the `listen` gem to watch for changes when the `--watch` switch is specified during a build or serve. While `listen` has built-in support for UNIX systems, it may require an extra gem for compatibility with Windows.
|
||||
|
||||
Add the following to the Gemfile for your site if you have issues with auto-regeneration on Windows alone:
|
||||
|
||||
```ruby
|
||||
gem 'wdm', '~> 0.1.1' if Gem.win_platform?
|
||||
```
|
||||
|
||||
You have to use a [Ruby+Devkit](https://rubyinstaller.org/downloads/) version of the RubyInstaller.
|
||||
|
||||
|
||||
## Installation via Bash on Windows 10
|
||||
|
||||
If you are using Windows 10 version 1607 or later, another option to run Jekyll is by [installing][WSL-Guide] the Windows Subsystem for Linux.
|
||||
|
||||
|
||||
*Note:* You must have [Windows Subsystem for Linux][BASH-WSL] enabled.
|
||||
*Note:* You must have [Bash on Ubuntu on Windows][BASH-WSL] enabled.
|
||||
|
||||
First let's make sure all our packages / repositories are up to date. Open a new Command Prompt instance, and type the following:
|
||||
|
||||
@@ -110,12 +51,6 @@ Check if Jekyll installed properly by running:
|
||||
jekyll -v
|
||||
```
|
||||
|
||||
Configure the bundler/gem path so bundle doesn't prompt for sudo
|
||||
|
||||
```sh
|
||||
bundle config path vendor/bundle
|
||||
```
|
||||
|
||||
**And that's it!**
|
||||
|
||||
To start a new project named `my_blog`, just run:
|
||||
@@ -136,3 +71,152 @@ You can make sure time management is working properly by inspecting your `_posts
|
||||
[WSL-Guide]: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
|
||||
[BASH-WSL]: https://msdn.microsoft.com/en-us/commandline/wsl/about
|
||||
|
||||
|
||||
### Installation via RubyInstaller
|
||||
|
||||
[RubyInstaller][] is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more.
|
||||
|
||||
1. Download and Install a package manager version from [RubyInstaller Downloads][RubyInstaller-downloads].
|
||||
2. Install Jekyll and Bundler via a command prompt window: `gem install jekyll bundler`
|
||||
3. Check if Jekyll installed properly: `jekyll -v`
|
||||
|
||||
[RubyInstaller]: https://rubyinstaller.org/
|
||||
[RubyInstaller-downloads]: https://rubyinstaller.org/downloads/
|
||||
|
||||
|
||||
### Installation via Chocolatey
|
||||
|
||||
A quick way to install Jekyll using Chocolatey is to follow the [installation instructions by David Burela](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/):
|
||||
|
||||
1. Install a package manager for Windows called [Chocolatey][]
|
||||
2. Install Ruby via Chocolatey: `choco install ruby -y`
|
||||
3. Reopen a command prompt and install Jekyll: `gem install jekyll`
|
||||
|
||||
Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` with versions of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here][ssl-certificate-update].
|
||||
|
||||
[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
|
||||
|
||||
|
||||
### Installing *github-pages* via Chocolatey
|
||||
|
||||
This section is part of an article written by [Jens Willmer][jwillmerPost]. To follow the instructions you need to have [Chocolatey][] installed on your system. If you already have a version of Ruby installed you need to uninstall it before you can continue.
|
||||
|
||||
|
||||
#### Install Ruby and Ruby development kit
|
||||
|
||||
Open a command prompt and execute the following commands:
|
||||
|
||||
* `choco install ruby -version 2.2.4`
|
||||
* `choco install ruby2.devkit` - _needed for compilation of json gem_
|
||||
|
||||
|
||||
#### Configure Ruby development kit
|
||||
|
||||
The development kit did not set the environment path for Ruby so we need to do it.
|
||||
|
||||
* Open command prompt in `C:\tools\DevKit2`
|
||||
* Execute `ruby dk.rb init` to create a file called `config.yml`
|
||||
* Edit the `config.yml` file and include the path to Ruby `- C:/tools/ruby22`
|
||||
* Execute the following command to set the path: `ruby dk.rb install`
|
||||
|
||||
|
||||
#### Nokogiri gem installation
|
||||
|
||||
This gem is also needed in the github-pages and to get it running on Windows x64 we have to install a few things.
|
||||
|
||||
**Note:** In the current [pre release][nokogiriFails] it works out of the box with Windows x64 but this version is not referenced in the github-pages.
|
||||
|
||||
```sh
|
||||
choco install libxml2 -Source "https://www.nuget.org/api/v2/"
|
||||
|
||||
choco install libxslt -Source "https://www.nuget.org/api/v2/"
|
||||
|
||||
choco install libiconv -Source "https://www.nuget.org/api/v2/
|
||||
|
||||
gem install nokogiri --^
|
||||
--with-xml2-include=C:\Chocolatey\lib\libxml2.2.7.8.7\build\native\include^
|
||||
--with-xml2-lib=C:\Chocolatey\lib\libxml2.redist.2.7.8.7\build\native\bin\v110\x64\Release\dynamic\cdecl^
|
||||
--with-iconv-include=C:\Chocolatey\lib\libiconv.1.14.0.11\build\native\include^
|
||||
--with-iconv-lib=C:\Chocolatey\lib\libiconv.redist.1.14.0.11\build\native\bin\v110\x64\Release\dynamic\cdecl^
|
||||
--with-xslt-include=C:\Chocolatey\lib\libxslt.1.1.28.0\build\native\include^
|
||||
--with-xslt-lib=C:\Chocolatey\lib\libxslt.redist.1.1.28.0\build\native\bin\v110\x64\Release\dynamic
|
||||
```
|
||||
|
||||
#### Install github-pages
|
||||
|
||||
* Open command prompt and install [Bundler][]: `gem install bundler`
|
||||
* Create a file called `Gemfile` without any extension in your root directory of your blog
|
||||
* Copy & paste the two lines into the file:
|
||||
|
||||
|
||||
```ruby
|
||||
source 'https://rubygems.org'
|
||||
gem 'github-pages', group: :jekyll_plugins
|
||||
```
|
||||
|
||||
* **Note:** We use an unsecure connection because SSL throws exceptions in the version of Ruby
|
||||
* Open a command prompt, target your local blog repository root, and install github-pages: `bundle install`
|
||||
|
||||
|
||||
After this process you should have github-pages installed on your system and you can host your blog again with `jekyll s`.
|
||||
There will be a warning on startup that you should include `gem 'wdm', '>= 0.1.0' if Gem.win_platform?` to your `Gemfile` but I could not get `jekyll s` working if I include that line so for the moment I ignore that warning.
|
||||
|
||||
In the future the installation process of the github-pages should be as simple as the setup of the blog. But as long as the new version of the Nokogiri ([v1.6.8][nokogiriReleases]) is not stable and referenced, it is work to get it up and running on Windows.
|
||||
|
||||
[jwillmerPost]: https://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46 "Installation instructions by Jens Willmer"
|
||||
[Chocolatey]: https://chocolatey.org/install "Package manager for Windows"
|
||||
[nokogiriFails]: https://github.com/sparklemotion/nokogiri/issues/1456#issuecomment-206481794 "Nokogiri fails to install on Ruby 2.3 for Windows"
|
||||
[Bundler]: http://bundler.io/ "Ruby Dependencie Manager"
|
||||
[nokogiriReleases]: https://github.com/sparklemotion/nokogiri/releases "Nokogiri Releases"
|
||||
|
||||
For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3].
|
||||
|
||||
Optionally you can use [Autoinstall Jekyll for Windows][fastjekyll-autoinstall].
|
||||
|
||||
[windows-installjekyll3]: https://labs.sverrirs.com/jekyll/
|
||||
[fastjekyll-autoinstall]: https://github.com/KeJunMao/fastjekyll#autoinstall-jekyll-for-windows
|
||||
|
||||
|
||||
## Encoding
|
||||
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header characters exist in your files or very, very bad things will happen to
|
||||
Jekyll. This is especially relevant when you're running Jekyll on Windows.
|
||||
|
||||
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a "Liquid Exception: Incompatible character encoding" error during the site generation process. It can be done with the following command:
|
||||
|
||||
```sh
|
||||
chcp 65001
|
||||
```
|
||||
|
||||
|
||||
## Time-Zone Management
|
||||
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
|
||||
|
||||
Jekyll now uses a rubygem to internally configure Timezone based on established [IANA Timezone Database][IANA-database].
|
||||
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their 'Gemfile' by default, existing sites *will* have to update their 'Gemfile' (and installed) to enable development on Windows:
|
||||
|
||||
```ruby
|
||||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
# and associated library.
|
||||
platforms :mingw, :x64_mingw, :mswin, :jruby do
|
||||
gem "tzinfo", ">= 1", "< 3"
|
||||
gem "tzinfo-data"
|
||||
end
|
||||
```
|
||||
|
||||
[IANA-database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
|
||||
|
||||
## Auto Regeneration
|
||||
|
||||
Jekyll uses the `listen` gem to watch for changes when the `--watch` switch is specified during a build or serve. While `listen` has built-in support for UNIX systems, it may require an extra gem for compatibility with Windows.
|
||||
|
||||
Add the following to the Gemfile for your site if you have issues with auto-regeneration on Windows alone:
|
||||
|
||||
```ruby
|
||||
gem 'wdm', '~> 0.1.1' if Gem.win_platform?
|
||||
```
|
||||
|
||||
You may first have to download and install the [Ruby DevKit](https://rubyinstaller.org/downloads/) by following [the instructions here](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit).
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
title: "Jekyll 4.0 is on the Horizon!"
|
||||
date: "2018-04-19 16:07:00 +0100"
|
||||
author: oe
|
||||
categories: [community]
|
||||
---
|
||||
|
||||
With the release of Jekyll 3.8.0, it's been 2 and a half years since the last major release. Jekyll 3.0.0 was released in late October of 2015! That's a long time ago, and we've been working towards the next major release of Jekyll for a couple of months now. Here's a small preview of what's to come:
|
||||
|
||||
- Dropping support for Ruby 2.1 and 2.2. Both versions have reached their EOL period.
|
||||
- Dropping Pygments as a dependency. We're already defaulting to Rouge, and this removes the implicit Python dependency. (finally!)
|
||||
- Making the `link` tag use relative URLs. This is a big breaking change, but it's the cleaner solution.
|
||||
|
||||
We're open to more ideas, though. If the development cost isn't too high, or if someone volunteers to take care of the implementation, it's likely that your suggestion might make it into Jekyll 4.0. Head over to this [issue] for more details. Some interesting topics might be improving Internationalization support in Jekyll, creating convenience Liquid tags, et cetera.
|
||||
|
||||
That being said, the development period of version 4.0 begins _now_. This means a couple of things:
|
||||
|
||||
- New features will only be implemented in Jekyll 4.0. There will be no 3.9.0 or the like.
|
||||
- Same with bug fixes, unless they concern something introduced in Jekyll 3.7 or 3.8, in which case we will backport the fixes and release a patch version.
|
||||
- Now is a great time to finally take on the feature you've wanted to see in Jekyll for ages! Just open an issue or experiment with the code to get going!
|
||||
|
||||
As for a release date, we're currently aiming for late summer, around September or so. However, keep in mind that this project is purely volunteer-run, and as such, delays might occur and we might not hit that release date.
|
||||
|
||||
Finally, this is a great time for newcomers to open-source to make their first contribution. We'll be doing our best to mark recommended contributions and create newcomer-friendly issues, as well as to provide mentoring throughout the contribution process (although we'd like to think that we're already pretty proficient at that). So if you've always been hestitant about contributing to a large open-source project, Jekyll is a good place to start!
|
||||
|
||||
Happy Jekylling! :wave:
|
||||
|
||||
[issue]: https://github.com/jekyll/jekyll/issues/6948
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
title: 'Jekyll 3.8.0 Released'
|
||||
date: 2018-04-19 19:45:15 +0530
|
||||
author: ashmaroli
|
||||
version: 3.8.0
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Aloha Jekyllers!! :wave:
|
||||
|
||||
After months of toiling on the codebase and shipping a couple of release-candidates, the Jekyll Team is delighted to finally
|
||||
present `v3.8.0`, packed with optimizations, improvements, some new features and a couple of bug-fixes. Yay!!!
|
||||
|
||||
Under the hood, Jekyll has undergone many minor changes that will allow it to run more performantly in the coming years. :smiley:
|
||||
Rest assured, our users should see minor improvements in their site's build times.
|
||||
|
||||
Speaking of improvements, users running a site containing a huge amount of posts or those who like to use our `where` filter
|
||||
frequently in a single template, are going to see a massive reduction in their total build times!! :tada:
|
||||
|
||||
Hold on, this version is not just about optimizations, there are some new features as well..:
|
||||
* Detect non-existent variables and filters specified in a template by enabling `strict_variables` and `strict_filters` under the
|
||||
`liquid` key in your config file.
|
||||
* Allow *date filters* to output ordinal days.
|
||||
* `jekyll doctor` now warns you if you have opted for custom `collections_dir` but placed `_posts` directory outside that
|
||||
directory.
|
||||
|
||||
..and yes, a couple of bug-fixes, notably:
|
||||
* Jekyll now handles future-dated documents properly.
|
||||
* Jekyll is able to handle Liquid blocks intelligently in excerpts.
|
||||
* A few methods that were *not meant to be publically accessible* have been entombed properly.
|
||||
* A few bugs that still plagued our `collections_dir` feature from `v3.7` got crushed.
|
||||
|
||||
As always, the full list of changes since last release can be viewed [here](/docs/history/#v3-8-0).
|
||||
|
||||
A big thanks to the following people who contributed to our repository with pull-requests that improved our codebase, documentation
|
||||
and tests:
|
||||
|
||||
Ana María Martínez Gómez, Antonio Argote, Ashwin Maroli, Awjin Ahn, Ben Balter, Benjamin Høegh, Christian Oliff, Damien Solodow,
|
||||
David Zhang, Delson Lima, Eric Cornelissen, Florian Thomas, Frank Taillandier, Heinrich Hartmann, Jakob Vad Nielsen, John Eismeier,
|
||||
Kacper Duras, KajMagnus, Mario Cekic, Max Vilimpoc, Michael H, Mike Kasberg, Parker Moore, Pat Hawks, Paweł Kuna, Robert Riemann,
|
||||
Roger Rohrbach, Semen Zhydenko, Stefan Dellmuth, Tim Carry, olivia, and steelman.
|
||||
|
||||
Happy Jekylling!! :sparkles:
|
||||
19
docs/_posts/2018-05-18-jekyll-3-8-2-released.markdown
Normal file
19
docs/_posts/2018-05-18-jekyll-3-8-2-released.markdown
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: 'Jekyll 3.8.2 Released'
|
||||
date: 2018-05-19 10:30:00 -0500
|
||||
author: pathawks
|
||||
version: 3.8.2
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Hello Jekyllers!!
|
||||
|
||||
Today we are releasing `v3.8.2`, which fixes the way Jekyll generates excerpts
|
||||
for posts when the first paragraph of the post contains Liquid tags that take
|
||||
advantage of [Liquid's whitespace control feature][Liquid whitespace].
|
||||
|
||||
Big thanks to @kylebarbour, who first reported this issue and also very quickly
|
||||
submitted a fix. Also thanks to @nickskalkin for making sure that we are using
|
||||
the latest version of Rubocop to lint our code.
|
||||
|
||||
[Liquid whitespace]: https://shopify.github.io/liquid/basics/whitespace/
|
||||
13
docs/_posts/2018-06-04-jekyll-3-8-3-released.markdown
Normal file
13
docs/_posts/2018-06-04-jekyll-3-8-3-released.markdown
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: 'Jekyll 3.8.3 Released'
|
||||
date: 2018-06-05 09:00:00 -0500
|
||||
author: pathawks
|
||||
version: 3.8.3
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
This release fixes a regression in 3.8 where collections with `published: false`
|
||||
do not show when using the `--unpublished` flag.
|
||||
|
||||
Thanks to @philipbelesky for reporting and fixing this issue; collections with
|
||||
`published: false` now behave the same way as Posts.
|
||||
19
docs/_posts/2019-07-02-jekyll-3-8-6-released.markdown
Normal file
19
docs/_posts/2019-07-02-jekyll-3-8-6-released.markdown
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: 'Jekyll 3.8.6 Released'
|
||||
date: 2019-07-02 11:21:02 -0400
|
||||
author: parkr
|
||||
version: 3.8.6
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
We have another patch release in the 3.8 series! This time, we have one security patch
|
||||
and a handful of bug patches, including:
|
||||
|
||||
- Filter symlinks from theme gems
|
||||
- Fix excerpt handling of some Liquid tags
|
||||
- Handle case where a theme directory doesn't exist
|
||||
- A few internal optimizations to reduce memory overhead
|
||||
|
||||
... and a few more! You can check out the patches and see all the details in [the release notes](/docs/history/#v3-8-6)
|
||||
|
||||
Happy Jekylling!
|
||||
28
docs/_posts/2020-08-06-jekyll-3-9-0-released.markdown
Normal file
28
docs/_posts/2020-08-06-jekyll-3-9-0-released.markdown
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: 'Jekyll 3.9.0 Released'
|
||||
author: parkr
|
||||
version: 3.9.0
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Jekyll 3.9.0 allows use of kramdown v2, the latest series of kramdown.
|
||||
|
||||
If you choose to upgrade, please note that the GitHub-Flavored Markdown
|
||||
parser and other features of kramdown v1 are now distributed via
|
||||
separate gems. If you would like to continue using these features, you will
|
||||
need to add the gems to your `Gemfile`. They are as follows:
|
||||
|
||||
- GFM parser – `kramdown-parser-gfm`
|
||||
- coderay syntax highlighter – `kramdown-syntax-coderay`
|
||||
- mathjaxnode math engine – `kramdown-math-mathjaxnode`
|
||||
- sskatex math engine – `kramdown-math-sskatex`
|
||||
- katex math engine – `kramdown-math-katex`
|
||||
- ritex math engine – `kramdown-math-ritex`
|
||||
- itex2mml math engine – `kramdown-math-itex2mml`
|
||||
|
||||
Jekyll will require the given gem when the configuration requires it, and
|
||||
will show a helpful message when a dependency is missing.
|
||||
|
||||
You can check out the patches and see all the details in [the release notes](/docs/history/#v3-9-0)
|
||||
|
||||
Happy Jekylling!
|
||||
28
docs/_posts/2021-04-07-jekyll-3-9-1-released.markdown
Normal file
28
docs/_posts/2021-04-07-jekyll-3-9-1-released.markdown
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: 'Jekyll 3.9.1 Released'
|
||||
date: 2021-04-07 15:59:45 -0400
|
||||
author: parkr
|
||||
version: 3.9.1
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
This patch release of the 3.9 series is released to fix a bug where the
|
||||
`include` tag does not allow valid filename characters. For example, this
|
||||
would previously fail:
|
||||
|
||||
{% raw %}
|
||||
```text
|
||||
{% include my-logo@2x.svg %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
This release adds support for the following characters in filenames:
|
||||
|
||||
- `@`
|
||||
- `-`
|
||||
- `(` and `)`
|
||||
- `+`
|
||||
- `~`
|
||||
- `#`
|
||||
|
||||
Happy Jekylling!
|
||||
19
docs/_posts/2022-03-27-jekyll-3-9-2-released.markdown
Normal file
19
docs/_posts/2022-03-27-jekyll-3-9-2-released.markdown
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: 'Jekyll 3.9.2 Released'
|
||||
date: 2022-03-27 13:20:00 -0700
|
||||
author: parkr
|
||||
version: 3.9.2
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Hey Jekyllers,
|
||||
|
||||
Quick bug-fix release for you all today:
|
||||
|
||||
1. Ruby 3.0 and 3.1 support :tada: (you will need to run `bundle add webrick` for `jekyll serve` to work)
|
||||
2. `jekyll serve` will no longer inject a charset into the MIME type for
|
||||
binary types
|
||||
3. Incremental regeneration now handles includes in collection files
|
||||
correctly
|
||||
|
||||
That's all, Happy Jekylling!
|
||||
15
docs/_posts/2023-01-27-jekyll-3-9-3-released.markdown
Normal file
15
docs/_posts/2023-01-27-jekyll-3-9-3-released.markdown
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: 'Jekyll 3.9.3 Released'
|
||||
date: 2023-01-27 13:10:25 -0800
|
||||
author: parkr
|
||||
version: 3.9.3
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
Jekyll 3.9.3 is a bug fix release loosening version restrictions for
|
||||
dependencies `i18n` and `tzinfo` gems. You can now use Jekyll v3.9 with
|
||||
newer versions of these gems!
|
||||
|
||||
More details in [the full release notes]({% link _docs/history.md %}#v3-9-3).
|
||||
|
||||
Happy Jekylling!
|
||||
@@ -45,7 +45,7 @@ overview: true
|
||||
<p class="line">
|
||||
<span class="path">~</span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">gem install bundler jekyll</span>
|
||||
<span class="command">gem install jekyll bundler</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path">~</span>
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.8.1
|
||||
3.9.3
|
||||
|
||||
@@ -263,6 +263,104 @@ Feature: Collections
|
||||
And the "_site/puppies/snowy.html" file should not exist
|
||||
And the "_site/puppies/hardy.html" file should not exist
|
||||
|
||||
Scenario: Access rendered collection with future date and unpublished flag via Liquid
|
||||
Given I have a _puppies directory
|
||||
And I have the following documents under the puppies collection:
|
||||
| title | date | content | published |
|
||||
| Rover | 2007-12-31 | content for Rover. | true |
|
||||
| Figor | 2007-12-31 | content for Figor. | false |
|
||||
| Snowy | 2199-12-31 | content for Snowy. | true |
|
||||
| Hardy | 2199-12-31 | content for Hardy. | false |
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
puppies:
|
||||
output: true
|
||||
"""
|
||||
And I have a "index.md" page that contains "{% for puppy in site.puppies %}<div>{{ puppy.title }}</div>{% endfor %}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "<div>Rover</div>" in "_site/index.html"
|
||||
But I should see "<div>Snowy</div>" in "_site/index.html"
|
||||
And I should not see "<div>Figor</div>" in "_site/index.html"
|
||||
And I should not see "<div>Hardy</div>" in "_site/index.html"
|
||||
And the "_site/puppies/rover.html" file should exist
|
||||
And the "_site/puppies/snowy.html" file should not exist
|
||||
And the "_site/puppies/figor.html" file should not exist
|
||||
And the "_site/puppies/hardy.html" file should not exist
|
||||
When I run jekyll build --unpublished
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "<div>Rover</div>" in "_site/index.html"
|
||||
And I should see "<div>Snowy</div>" in "_site/index.html"
|
||||
And I should see "<div>Figor</div>" in "_site/index.html"
|
||||
But I should see "<div>Hardy</div>" in "_site/index.html"
|
||||
And the "_site/puppies/rover.html" file should exist
|
||||
And the "_site/puppies/snowy.html" file should not exist
|
||||
And the "_site/puppies/figor.html" file should exist
|
||||
And the "_site/puppies/hardy.html" file should not exist
|
||||
When I run jekyll build --unpublished --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "<div>Rover</div>" in "_site/index.html"
|
||||
And I should see "<div>Snowy</div>" in "_site/index.html"
|
||||
And I should see "<div>Figor</div>" in "_site/index.html"
|
||||
But I should see "<div>Hardy</div>" in "_site/index.html"
|
||||
And the "_site/puppies/rover.html" file should exist
|
||||
And the "_site/puppies/snowy.html" file should exist
|
||||
And the "_site/puppies/figor.html" file should exist
|
||||
And the "_site/puppies/hardy.html" file should exist
|
||||
|
||||
Scenario: Access unrendered collection with future date and unpublished flag via Liquid
|
||||
Given I have a _puppies directory
|
||||
And I have the following documents under the puppies collection:
|
||||
| title | date | content | published |
|
||||
| Rover | 2007-12-31 | content for Rover. | true |
|
||||
| Figor | 2007-12-31 | content for Figor. | false |
|
||||
| Snowy | 2199-12-31 | content for Snowy. | true |
|
||||
| Hardy | 2199-12-31 | content for Hardy. | false |
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
collections:
|
||||
puppies:
|
||||
output: false
|
||||
"""
|
||||
And I have a "index.md" page that contains "{% for puppy in site.puppies %}<div>{{ puppy.title }}</div>{% endfor %}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "<div>Rover</div>" in "_site/index.html"
|
||||
But I should see "<div>Snowy</div>" in "_site/index.html"
|
||||
And I should not see "<div>Figor</div>" in "_site/index.html"
|
||||
And I should not see "<div>Hardy</div>" in "_site/index.html"
|
||||
And the "_site/puppies/rover.html" file should not exist
|
||||
And the "_site/puppies/snowy.html" file should not exist
|
||||
And the "_site/puppies/figor.html" file should not exist
|
||||
And the "_site/puppies/hardy.html" file should not exist
|
||||
When I run jekyll build --unpublished
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "<div>Rover</div>" in "_site/index.html"
|
||||
And I should see "<div>Snowy</div>" in "_site/index.html"
|
||||
And I should see "<div>Figor</div>" in "_site/index.html"
|
||||
But I should see "<div>Hardy</div>" in "_site/index.html"
|
||||
And the "_site/puppies/rover.html" file should not exist
|
||||
And the "_site/puppies/snowy.html" file should not exist
|
||||
And the "_site/puppies/figor.html" file should not exist
|
||||
And the "_site/puppies/hardy.html" file should not exist
|
||||
When I run jekyll build --unpublished --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "<div>Rover</div>" in "_site/index.html"
|
||||
And I should see "<div>Snowy</div>" in "_site/index.html"
|
||||
And I should see "<div>Figor</div>" in "_site/index.html"
|
||||
But I should see "<div>Hardy</div>" in "_site/index.html"
|
||||
And the "_site/puppies/rover.html" file should not exist
|
||||
And the "_site/puppies/snowy.html" file should not exist
|
||||
And the "_site/puppies/figor.html" file should not exist
|
||||
And the "_site/puppies/hardy.html" file should not exist
|
||||
|
||||
Scenario: All the documents
|
||||
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
|
||||
And I have fixture collections
|
||||
@@ -288,7 +386,23 @@ 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 "Second document's output: <p>Use <code class=\"highlighter-rouge\">Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"
|
||||
And I should see "Second document's output: <p>Use <code class=\"language-plaintext highlighter-rouge\">Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"
|
||||
|
||||
Scenario: Documents have an output attribute, which is the converted HTML based on site.config
|
||||
Given I have an "index.html" page that contains "Second document's output: {{ site.documents[2].output }}"
|
||||
And I have fixture collections
|
||||
And I have a "_config.yml" file with content:
|
||||
"""
|
||||
kramdown:
|
||||
guess_lang: false
|
||||
collections:
|
||||
- methods
|
||||
"""
|
||||
And I'm using kramdown v2
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
Then the _site directory should exist
|
||||
And I should see "Second document's output: <p>Use <code>Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"
|
||||
|
||||
Scenario: Filter documents by where
|
||||
Given I have an "index.html" page that contains "{% assign items = site.methods | where: 'whatever','foo.bar' %}Item count: {{ items.size }}"
|
||||
|
||||
@@ -175,17 +175,17 @@ Feature: Create sites
|
||||
Given I have a _posts directory
|
||||
And I have the following post:
|
||||
| title | date | layout | content |
|
||||
| entry1 | 2020-12-31 | post | content for entry1. |
|
||||
| entry1 | 2040-12-31 | post | content for entry1. |
|
||||
| entry2 | 2007-12-31 | post | content for entry2. |
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "content for entry2" in "_site/2007/12/31/entry2.html"
|
||||
And the "_site/2020/12/31/entry1.html" file should not exist
|
||||
And the "_site/2040/12/31/entry1.html" file should not exist
|
||||
When I run jekyll build --future
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And the "_site/2020/12/31/entry1.html" file should exist
|
||||
And the "_site/2040/12/31/entry1.html" file should exist
|
||||
|
||||
Scenario: Basic site with layouts, posts and related posts
|
||||
Given I have a _layouts directory
|
||||
|
||||
60
features/include_relative_tag.feature
Normal file
60
features/include_relative_tag.feature
Normal file
@@ -0,0 +1,60 @@
|
||||
Feature: include_relative Tag
|
||||
In order to share content across several closely related pages
|
||||
As a hacker who likes to blog
|
||||
I want to be able to include snippets in my site's pages and documents relative to current file
|
||||
|
||||
Scenario: Include a file relative to a post
|
||||
Given I have a _posts directory
|
||||
And I have a _posts/snippets directory
|
||||
And I have the following post:
|
||||
| title | date | content |
|
||||
| Star Wars | 2018-09-02 | {% include_relative snippets/welcome_para.md %} |
|
||||
And I have an "_posts/snippets/welcome_para.md" file that contains "Welcome back Dear Reader!"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Welcome back Dear Reader!" in "_site/2018/09/02/star-wars.html"
|
||||
|
||||
Scenario: Include a nested file relative to a post
|
||||
Given I have a _posts directory
|
||||
And I have a _posts/snippets directory
|
||||
And I have a _posts/snippets/welcome_para directory
|
||||
And I have the following post:
|
||||
| title | date | content |
|
||||
| Star Wars | 2018-09-02 | {% include_relative snippets/welcome_para.md %} |
|
||||
And I have an "_posts/snippets/welcome_para.md" file that contains "{% include_relative snippets/welcome_para/greeting.md %} Dear Reader!"
|
||||
And I have an "_posts/snippets/welcome_para/greeting.md" file that contains "Welcome back"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Welcome back Dear Reader!" in "_site/2018/09/02/star-wars.html"
|
||||
|
||||
Scenario: Include a nested file relative to a post as an excerpt
|
||||
Given I have a _posts directory
|
||||
And I have a _posts/snippets directory
|
||||
And I have a _posts/snippets/welcome_para directory
|
||||
And I have a "_posts/2018-09-02-star-wars.md" file with content:
|
||||
"""
|
||||
{% include_relative snippets/welcome_para.md %}
|
||||
|
||||
Hello World
|
||||
"""
|
||||
And I have an "_posts/snippets/welcome_para.md" file that contains "{% include_relative snippets/welcome_para/greeting.md %} Dear Reader!"
|
||||
And I have an "_posts/snippets/welcome_para/greeting.md" file that contains "Welcome back"
|
||||
And I have an "index.md" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Welcome back Dear Reader!" in "_site/2018/09/02/star-wars.html"
|
||||
And I should see "Welcome back Dear Reader!" in "_site/index.html"
|
||||
|
||||
Scenario: Include a nested file relative to a page at root
|
||||
Given I have a snippets directory
|
||||
And I have a snippets/welcome_para directory
|
||||
And I have a "index.md" page that contains "{% include_relative snippets/welcome_para.md %}"
|
||||
And I have a "snippets/welcome_para.md" file that contains "{% include_relative snippets/welcome_para/greeting.md %} Dear Reader!"
|
||||
And I have a "snippets/welcome_para/greeting.md" file that contains "Welcome back"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Welcome back Dear Reader!" in "_site/index.html"
|
||||
@@ -67,6 +67,25 @@ Feature: Incremental rebuild
|
||||
And the _site directory should exist
|
||||
And I should see "Basic Site with include tag: Regenerated by Jekyll" in "_site/index.html"
|
||||
|
||||
Scenario: Rebuild when a dependency of document in custom collection_dir is changed
|
||||
Given I have a _includes directory
|
||||
And I have a configuration file with "collections_dir" set to "collections"
|
||||
And I have a collections/_posts directory
|
||||
And I have the following post within the "collections" directory:
|
||||
| title | date | layout | content |
|
||||
| Wargames | 2009-03-27 | default | Basic Site with include tag: {% include about.html %} |
|
||||
And I have an "_includes/about.html" file that contains "Generated by Jekyll"
|
||||
When I run jekyll build -I
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/2009/03/27/wargames.html"
|
||||
When I wait 1 second
|
||||
Then I have an "_includes/about.html" file that contains "Regenerated by Jekyll"
|
||||
When I run jekyll build -I
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Basic Site with include tag: Regenerated by Jekyll" in "_site/2009/03/27/wargames.html"
|
||||
|
||||
Scenario: A themed-site and incremental regeneration
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have an "index.md" page that contains "Themed site"
|
||||
|
||||
@@ -5,6 +5,19 @@ Feature: Rendering
|
||||
But I want to make it as simply as possible
|
||||
So render with Liquid and place in Layouts
|
||||
|
||||
Scenario: Rendering a site with parentheses in its path name
|
||||
Given I have a blank site in "omega(beta)"
|
||||
And I have an "omega(beta)/test.md" page with layout "simple" that contains "Hello World"
|
||||
And I have an omega(beta)/_includes directory
|
||||
And I have an "omega(beta)/_includes/head.html" file that contains "Snippet"
|
||||
And I have a configuration file with "source" set to "omega(beta)"
|
||||
And I have an omega(beta)/_layouts directory
|
||||
And I have an "omega(beta)/_layouts/simple.html" file that contains "{% include head.html %}: {{ content }}"
|
||||
When I run jekyll build --profile
|
||||
Then I should get a zero exit status
|
||||
And I should see "Snippet: <p>Hello World</p>" in "_site/test.html"
|
||||
And I should see "_layouts/simple.html" in the build output
|
||||
|
||||
Scenario: When receiving bad Liquid
|
||||
Given I have a "index.html" page with layout "simple" that contains "{% include invalid.html %}"
|
||||
And I have a simple layout that contains "{{ content }}"
|
||||
|
||||
@@ -81,6 +81,14 @@ Feature: Site configuration
|
||||
And the _site directory should exist
|
||||
And I should see "<a href=\"https://www.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)"
|
||||
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"
|
||||
|
||||
Scenario: Highlight code with pygments
|
||||
Given I have an "index.html" page that contains "{% highlight ruby %} puts 'Hello world!' {% endhighlight %}"
|
||||
When I run jekyll build
|
||||
@@ -195,6 +203,28 @@ Feature: Site configuration
|
||||
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T09:22:00-10:00" in "_site/2013/04/09/entry1.html"
|
||||
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-09T13:14:00-10:00" in "_site/2013/04/09/entry2.html"
|
||||
|
||||
Scenario: Generate proper dates with explicitly set timezone (using non-half hour offset )
|
||||
Given I have a _layouts directory
|
||||
And I have a page layout that contains "Page Layout: {{ site.posts.size }}"
|
||||
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 | Australia/Eucla |
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
| entry1 | 2013-04-09 23:22 +0400 | post | content for entry1. |
|
||||
| entry2 | 2013-04-10 03:14 +0400 | post | content for entry2. |
|
||||
When I run jekyll build
|
||||
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 the "_site/2013/04/10/entry1.html" file should exist
|
||||
And the "_site/2013/04/10/entry2.html" file should exist
|
||||
And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-10T04:07:00\+08:45" in "_site/2013/04/10/entry1.html"
|
||||
And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T07:59:00\+08:45" in "_site/2013/04/10/entry2.html"
|
||||
|
||||
Scenario: Limit the number of posts generated by most recent date
|
||||
Given I have a _posts directory
|
||||
And I have a configuration file with:
|
||||
|
||||
@@ -185,6 +185,12 @@ end
|
||||
|
||||
#
|
||||
|
||||
Given("I'm using kramdown v{int}") do |int|
|
||||
skip_this_scenario unless Kramdown::VERSION.to_i == int.to_i
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
Given(%r!^I wait (\d+) second(s?)$!) do |time, _|
|
||||
sleep(time.to_f)
|
||||
end
|
||||
|
||||
@@ -57,6 +57,17 @@ Feature: Writing themes
|
||||
And I should see "From your site." in "_site/assets/application.coffee"
|
||||
And I should see "From your site." in "_site/assets/base.js"
|
||||
|
||||
Scenario: A theme with *just* layouts
|
||||
Given I have a configuration file with "theme" set to "test-theme-skinny"
|
||||
And I have an "index.html" page with layout "home" that contains "The quick brown fox."
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "Message: The quick brown fox." in "_site/index.html"
|
||||
But I should not see "_includes" in the build output
|
||||
And I should not see "_sass" in the build output
|
||||
And I should not see "assets" in the build output
|
||||
|
||||
Scenario: Requiring dependencies of a theme
|
||||
Given I have a configuration file with "theme" set to "test-dependency-theme"
|
||||
When I run jekyll build
|
||||
|
||||
@@ -8,7 +8,7 @@ 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.3.0"
|
||||
s.required_ruby_version = ">= 2.1.0"
|
||||
|
||||
s.name = "jekyll"
|
||||
s.version = Jekyll::VERSION
|
||||
@@ -33,13 +33,18 @@ Gem::Specification.new do |s|
|
||||
s.add_runtime_dependency("addressable", "~> 2.4")
|
||||
s.add_runtime_dependency("colorator", "~> 1.0")
|
||||
s.add_runtime_dependency("em-websocket", "~> 0.5")
|
||||
s.add_runtime_dependency("i18n", "~> 1.0")
|
||||
s.add_runtime_dependency("i18n", ">= 0.7", "< 2")
|
||||
s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0")
|
||||
s.add_runtime_dependency("jekyll-watch", "~> 2.0")
|
||||
s.add_runtime_dependency("kramdown", "~> 1.14")
|
||||
s.add_runtime_dependency("liquid", "~> 4.0")
|
||||
s.add_runtime_dependency("mercenary", "~> 0.3.3")
|
||||
s.add_runtime_dependency("pathutil", "~> 0.9")
|
||||
s.add_runtime_dependency("rouge", "~> 3.0")
|
||||
rouge_versions = ENV["ROUGE_VERSION"] ? ["~> #{ENV["ROUGE_VERSION"]}"] : [">= 1.7", "< 4"]
|
||||
s.add_runtime_dependency("rouge", *rouge_versions)
|
||||
s.add_runtime_dependency("safe_yaml", "~> 1.0")
|
||||
|
||||
# Depend on kramdown. For kramdown v2, extra gems are required.
|
||||
# https://kramdown.gettalong.org/news.html#kramdown-200-released
|
||||
kramdown_versions = ENV["KRAMDOWN_VERSION"] ? ["~> #{ENV["KRAMDOWN_VERSION"]}"] : [">= 1.17", "< 3"]
|
||||
s.add_runtime_dependency("kramdown", *kramdown_versions)
|
||||
end
|
||||
|
||||
@@ -212,7 +212,9 @@ module Jekyll
|
||||
def read_document(full_path)
|
||||
doc = Document.new(full_path, :site => site, :collection => self)
|
||||
doc.read
|
||||
docs << doc unless doc.data["published"] == false
|
||||
if site.unpublished || doc.published?
|
||||
docs << doc
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -73,30 +73,6 @@ module Jekyll
|
||||
"Fail if errors are present in front matter"
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
# Run ::process method in a given set of Jekyll::Command subclasses and suggest
|
||||
# re-running the associated command with --trace switch to obtain any additional
|
||||
# information or backtrace regarding the encountered Exception.
|
||||
#
|
||||
# cmd - the Jekyll::Command to be handled
|
||||
# options - configuration overrides
|
||||
# klass - an array of Jekyll::Command subclasses associated with the command
|
||||
#
|
||||
# Note that all exceptions are rescued..
|
||||
# rubocop: disable RescueException
|
||||
def process_with_graceful_fail(cmd, options, *klass)
|
||||
klass.each { |k| k.process(options) if k.respond_to?(:process) }
|
||||
rescue Exception => e
|
||||
raise e if cmd.trace
|
||||
|
||||
msg = " Please append `--trace` to the `#{cmd.name}` command "
|
||||
dashes = "-" * msg.length
|
||||
Jekyll.logger.error "", dashes
|
||||
Jekyll.logger.error "Jekyll #{Jekyll::VERSION} ", msg
|
||||
Jekyll.logger.error "", " for any additional information or backtrace. "
|
||||
Jekyll.logger.abort_with "", dashes
|
||||
end
|
||||
# rubocop: enable RescueException
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ module Jekyll
|
||||
|
||||
c.action do |_, options|
|
||||
options["serving"] = false
|
||||
process_with_graceful_fail(c, options, self)
|
||||
Jekyll::Commands::Build.process(options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,12 +87,23 @@ 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]
|
||||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
# and associated library.
|
||||
platforms :mingw, :x64_mingw, :mswin, :jruby do
|
||||
gem "tzinfo", ">= 1", "< 3"
|
||||
gem "tzinfo-data"
|
||||
end
|
||||
|
||||
# Performance-booster for watching directories on Windows
|
||||
gem "wdm", "~> 0.1.0" if Gem.win_platform?
|
||||
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
|
||||
|
||||
# kramdown v2 ships without the gfm parser by default. If you're using
|
||||
# kramdown v1, comment out this line.
|
||||
gem "kramdown-parser-gfm"
|
||||
|
||||
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
|
||||
# do not have a Java counterpart.
|
||||
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
|
||||
RUBY
|
||||
end
|
||||
|
||||
|
||||
@@ -72,21 +72,29 @@ module Jekyll
|
||||
opts["serving"] = true
|
||||
opts["watch"] = true unless opts.key?("watch")
|
||||
|
||||
# Set the reactor to nil so any old reactor will be GCed.
|
||||
# We can't unregister a hook so while running tests we don't want to
|
||||
# inadvertently keep using a reactor created by a previous test.
|
||||
@reload_reactor = nil
|
||||
|
||||
config = configuration_from_options(opts)
|
||||
config["url"] = default_url(config) if Jekyll.env == "development"
|
||||
|
||||
process_with_graceful_fail(cmd, config, Build, Serve)
|
||||
start(opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def start(opts)
|
||||
# Set the reactor to nil so any old reactor will be GCed.
|
||||
# We can't unregister a hook so in testing when Serve.start is
|
||||
# called multiple times we don't want to inadvertently keep using
|
||||
# a reactor created by a previous test when our test might not
|
||||
@reload_reactor = nil
|
||||
|
||||
config = configuration_from_options(opts)
|
||||
if Jekyll.env == "development"
|
||||
config["url"] = default_url(config)
|
||||
end
|
||||
[Build, Serve].each { |klass| klass.process(config) }
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def process(opts)
|
||||
opts = configuration_from_options(opts)
|
||||
destination = opts["destination"]
|
||||
@@ -194,6 +202,7 @@ module Jekyll
|
||||
:JekyllOptions => opts,
|
||||
:DoNotReverseLookup => true,
|
||||
:MimeTypes => mime_types,
|
||||
:MimeTypesCharset => mime_types_charset,
|
||||
:DocumentRoot => opts["destination"],
|
||||
:StartCallback => start_callback(opts["detach"]),
|
||||
:StopCallback => stop_callback(opts["detach"]),
|
||||
@@ -371,6 +380,11 @@ module Jekyll
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def mime_types_charset
|
||||
SafeYAML.load_file(File.expand_path("serve/mime_types_charset.json", __dir__))
|
||||
end
|
||||
|
||||
def read_file(source_dir, file_path)
|
||||
File.read(Jekyll.sanitized_path(source_dir, file_path))
|
||||
end
|
||||
|
||||
71
lib/jekyll/commands/serve/mime_types_charset.json
Normal file
71
lib/jekyll/commands/serve/mime_types_charset.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"application/javascript": "UTF-8",
|
||||
"application/json": "UTF-8",
|
||||
"application/manifest+json": "UTF-8",
|
||||
"application/vnd.syncml+xml": "UTF-8",
|
||||
"application/vnd.syncml.dm+wbxml": "UTF-8",
|
||||
"application/vnd.syncml.dm+xml": "UTF-8",
|
||||
"application/vnd.syncml.dmddf+xml": "UTF-8",
|
||||
"application/vnd.wap.wbxml": "UTF-8",
|
||||
"text/cache-manifest": "UTF-8",
|
||||
"text/calendar": "UTF-8",
|
||||
"text/coffeescript": "UTF-8",
|
||||
"text/css": "UTF-8",
|
||||
"text/csv": "UTF-8",
|
||||
"text/html": "UTF-8",
|
||||
"text/jade": "UTF-8",
|
||||
"text/jsx": "UTF-8",
|
||||
"text/less": "UTF-8",
|
||||
"text/markdown": "UTF-8",
|
||||
"text/mathml": "UTF-8",
|
||||
"text/mdx": "UTF-8",
|
||||
"text/n3": "UTF-8",
|
||||
"text/plain": "UTF-8",
|
||||
"text/prs.lines.tag": "UTF-8",
|
||||
"text/richtext": "UTF-8",
|
||||
"text/sgml": "UTF-8",
|
||||
"text/shex": "UTF-8",
|
||||
"text/slim": "UTF-8",
|
||||
"text/spdx": "UTF-8",
|
||||
"text/stylus": "UTF-8",
|
||||
"text/tab-separated-values": "UTF-8",
|
||||
"text/troff": "UTF-8",
|
||||
"text/turtle": "UTF-8",
|
||||
"text/uri-list": "UTF-8",
|
||||
"text/vcard": "UTF-8",
|
||||
"text/vnd.curl": "UTF-8",
|
||||
"text/vnd.curl.dcurl": "UTF-8",
|
||||
"text/vnd.curl.mcurl": "UTF-8",
|
||||
"text/vnd.curl.scurl": "UTF-8",
|
||||
"text/vnd.familysearch.gedcom": "UTF-8",
|
||||
"text/vnd.fly": "UTF-8",
|
||||
"text/vnd.fmi.flexstor": "UTF-8",
|
||||
"text/vnd.graphviz": "UTF-8",
|
||||
"text/vnd.in3d.3dml": "UTF-8",
|
||||
"text/vnd.in3d.spot": "UTF-8",
|
||||
"text/vnd.sun.j2me.app-descriptor": "UTF-8",
|
||||
"text/vnd.wap.wml": "UTF-8",
|
||||
"text/vnd.wap.wmlscript": "UTF-8",
|
||||
"text/vtt": "UTF-8",
|
||||
"text/x-asm": "UTF-8",
|
||||
"text/x-c": "UTF-8",
|
||||
"text/x-component": "UTF-8",
|
||||
"text/x-fortran": "UTF-8",
|
||||
"text/x-handlebars-template": "UTF-8",
|
||||
"text/x-java-source": "UTF-8",
|
||||
"text/x-lua": "UTF-8",
|
||||
"text/x-markdown": "UTF-8",
|
||||
"text/x-nfo": "UTF-8",
|
||||
"text/x-opml": "UTF-8",
|
||||
"text/x-pascal": "UTF-8",
|
||||
"text/x-processing": "UTF-8",
|
||||
"text/x-sass": "UTF-8",
|
||||
"text/x-scss": "UTF-8",
|
||||
"text/x-setext": "UTF-8",
|
||||
"text/x-sfv": "UTF-8",
|
||||
"text/x-suse-ymp": "UTF-8",
|
||||
"text/x-uuencode": "UTF-8",
|
||||
"text/x-vcalendar": "UTF-8",
|
||||
"text/x-vcard": "UTF-8",
|
||||
"text/yaml": "UTF-8"
|
||||
}
|
||||
@@ -137,6 +137,7 @@ module Jekyll
|
||||
def initialize(server, root, callbacks)
|
||||
# So we can access them easily.
|
||||
@jekyll_opts = server.config[:JekyllOptions]
|
||||
@mime_types_charset = server.config[:MimeTypesCharset]
|
||||
set_defaults
|
||||
super
|
||||
end
|
||||
@@ -172,27 +173,28 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
validate_and_ensure_charset(req, res)
|
||||
conditionally_inject_charset(res)
|
||||
res.header.merge!(@headers)
|
||||
rtn
|
||||
end
|
||||
# rubocop:enable Naming/MethodName
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def validate_and_ensure_charset(_req, res)
|
||||
key = res.header.keys.grep(%r!content-type!i).first
|
||||
typ = res.header[key]
|
||||
|
||||
unless typ =~ %r!;\s*charset=!
|
||||
res.header[key] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
|
||||
end
|
||||
#
|
||||
# Inject charset based on Jekyll config only if our mime-types database contains
|
||||
# the charset metadata.
|
||||
#
|
||||
# Refer `script/vendor-mimes` in the repository for further details.
|
||||
def conditionally_inject_charset(res)
|
||||
typ = res.header["content-type"]
|
||||
return unless @mime_types_charset.key?(typ)
|
||||
return if %r!;\s*charset=!.match?(typ)
|
||||
|
||||
res.header["content-type"] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
private
|
||||
def set_defaults
|
||||
hash_ = @jekyll_opts.fetch("webrick", {}).fetch("headers", {})
|
||||
DEFAULTS.each_with_object(@headers = hash_) do |(key, val), hash|
|
||||
|
||||
@@ -70,6 +70,10 @@ module Jekyll
|
||||
"extensions" => [],
|
||||
},
|
||||
|
||||
"redcarpet" => {
|
||||
"extensions" => [],
|
||||
},
|
||||
|
||||
"kramdown" => {
|
||||
"auto_ids" => true,
|
||||
"toc_levels" => "1..6",
|
||||
@@ -77,6 +81,7 @@ module Jekyll
|
||||
"smart_quotes" => "lsquo,rsquo,ldquo,rdquo",
|
||||
"input" => "GFM",
|
||||
"hard_wrap" => false,
|
||||
"guess_lang" => true,
|
||||
"footnote_nr" => 1,
|
||||
"show_warnings" => false,
|
||||
},
|
||||
|
||||
@@ -30,6 +30,7 @@ module Jekyll
|
||||
# rubocop:disable Naming/AccessorMethodName
|
||||
def get_processor
|
||||
case @config["markdown"].downcase
|
||||
when "redcarpet" then return RedcarpetParser.new(@config)
|
||||
when "kramdown" then return KramdownParser.new(@config)
|
||||
when "rdiscount" then return RDiscountParser.new(@config)
|
||||
else
|
||||
@@ -43,7 +44,7 @@ module Jekyll
|
||||
# are not in safe mode.)
|
||||
|
||||
def valid_processors
|
||||
%w(rdiscount kramdown) + third_party_processors
|
||||
%w(rdiscount kramdown redcarpet) + third_party_processors
|
||||
end
|
||||
|
||||
# Public: A list of processors that you provide via plugins.
|
||||
@@ -52,7 +53,7 @@ module Jekyll
|
||||
|
||||
def third_party_processors
|
||||
self.class.constants - \
|
||||
%w(KramdownParser RDiscountParser PRIORITIES).map(
|
||||
%w(KramdownParser RDiscountParser RedcarpetParser PRIORITIES).map(
|
||||
&:to_sym
|
||||
)
|
||||
end
|
||||
|
||||
@@ -18,6 +18,7 @@ module Jekyll
|
||||
@config = config["kramdown"] || {}
|
||||
@highlighter = nil
|
||||
setup
|
||||
load_dependencies
|
||||
end
|
||||
|
||||
# Setup and normalize the configuration:
|
||||
@@ -30,6 +31,8 @@ module Jekyll
|
||||
def setup
|
||||
@config["syntax_highlighter"] ||= highlighter
|
||||
@config["syntax_highlighter_opts"] ||= {}
|
||||
@config["syntax_highlighter_opts"]["default_lang"] ||= "plaintext"
|
||||
@config["syntax_highlighter_opts"]["guess_lang"] = @config["guess_lang"]
|
||||
@config["coderay"] ||= {} # XXX: Legacy.
|
||||
modernize_coderay_config
|
||||
make_accessible
|
||||
@@ -47,6 +50,24 @@ module Jekyll
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_dependencies
|
||||
return if Kramdown::VERSION.to_i < 2
|
||||
if @config["input"] == "GFM"
|
||||
Jekyll::External.require_with_graceful_fail("kramdown-parser-gfm")
|
||||
end
|
||||
|
||||
if highlighter == "coderay"
|
||||
Jekyll::External.require_with_graceful_fail("kramdown-syntax-coderay")
|
||||
end
|
||||
|
||||
# `mathjax` emgine is bundled within kramdown-2.x and will be handled by
|
||||
# kramdown itself.
|
||||
if (math_engine = @config["math_engine"]) && math_engine != "mathjax"
|
||||
Jekyll::External.require_with_graceful_fail("kramdown-math-#{math_engine}")
|
||||
end
|
||||
end
|
||||
|
||||
def make_accessible(hash = @config)
|
||||
hash.keys.each do |key|
|
||||
hash[key.to_sym] = hash[key]
|
||||
|
||||
112
lib/jekyll/converters/markdown/redcarpet_parser.rb
Normal file
112
lib/jekyll/converters/markdown/redcarpet_parser.rb
Normal file
@@ -0,0 +1,112 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Jekyll::Converters::Markdown::RedcarpetParser
|
||||
module CommonMethods
|
||||
def add_code_tags(code, lang)
|
||||
code = code.to_s
|
||||
code = code.sub(
|
||||
%r!<pre>!,
|
||||
"<pre><code class=\"language-#{lang}\" data-lang=\"#{lang}\">"
|
||||
)
|
||||
code = code.sub(%r!</pre>!, "</code></pre>")
|
||||
code
|
||||
end
|
||||
end
|
||||
|
||||
module WithPygments
|
||||
include CommonMethods
|
||||
def block_code(code, lang)
|
||||
unless defined?(Pygments)
|
||||
Jekyll::External.require_with_graceful_fail("pygments")
|
||||
end
|
||||
lang = lang && lang.split.first || "text"
|
||||
add_code_tags(
|
||||
Pygments.highlight(
|
||||
code,
|
||||
{
|
||||
:lexer => lang,
|
||||
:options => { :encoding => "utf-8" },
|
||||
}
|
||||
),
|
||||
lang
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
module WithoutHighlighting
|
||||
require "cgi"
|
||||
|
||||
include CommonMethods
|
||||
|
||||
def code_wrap(code)
|
||||
"<figure class=\"highlight\"><pre>#{CGI.escapeHTML(code)}</pre></figure>"
|
||||
end
|
||||
|
||||
def block_code(code, lang)
|
||||
lang = lang && lang.split.first || "text"
|
||||
add_code_tags(code_wrap(code), lang)
|
||||
end
|
||||
end
|
||||
|
||||
module WithRouge
|
||||
def block_code(_code, lang)
|
||||
code = "<pre>#{super}</pre>"
|
||||
|
||||
"<div class=\"highlight\">#{add_code_tags(code, lang)}</div>"
|
||||
end
|
||||
|
||||
protected
|
||||
def rouge_formatter(_lexer)
|
||||
Jekyll::Utils::Rouge.html_formatter(:wrap => false)
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(config)
|
||||
unless defined?(Redcarpet)
|
||||
Jekyll::External.require_with_graceful_fail("redcarpet")
|
||||
end
|
||||
@config = config
|
||||
@redcarpet_extensions = {}
|
||||
@config["redcarpet"]["extensions"].each do |e|
|
||||
@redcarpet_extensions[e.to_sym] = true
|
||||
end
|
||||
|
||||
@renderer ||= class_with_proper_highlighter(@config["highlighter"])
|
||||
end
|
||||
|
||||
def class_with_proper_highlighter(highlighter)
|
||||
Class.new(Redcarpet::Render::HTML) do
|
||||
case highlighter
|
||||
when "pygments"
|
||||
include WithPygments
|
||||
when "rouge"
|
||||
Jekyll::External.require_with_graceful_fail(%w(
|
||||
rouge rouge/plugins/redcarpet
|
||||
))
|
||||
|
||||
unless Gem::Version.new(Rouge.version) > Gem::Version.new("1.3.0")
|
||||
abort "Please install Rouge 1.3.0 or greater and try running Jekyll again."
|
||||
end
|
||||
|
||||
include Rouge::Plugins::Redcarpet
|
||||
include CommonMethods
|
||||
include WithRouge
|
||||
else
|
||||
include WithoutHighlighting
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
@redcarpet_extensions[:fenced_code_blocks] = \
|
||||
!@redcarpet_extensions[:no_fenced_code_blocks]
|
||||
if @redcarpet_extensions[:smart]
|
||||
@renderer.send :include, Redcarpet::Render::SmartyPants
|
||||
end
|
||||
markdown = Redcarpet::Markdown.new(
|
||||
@renderer.new(@redcarpet_extensions),
|
||||
@redcarpet_extensions
|
||||
)
|
||||
markdown.render(content)
|
||||
end
|
||||
end
|
||||
@@ -39,7 +39,7 @@ module Jekyll
|
||||
|
||||
begin
|
||||
self.content = File.read(@path || site.in_source_dir(base, name),
|
||||
Utils.merged_file_read_opts(site, opts))
|
||||
**Utils.merged_file_read_opts(site, opts))
|
||||
if content =~ Document::YAML_FRONT_MATTER_REGEXP
|
||||
self.content = $POSTMATCH
|
||||
self.data = SafeYAML.load(Regexp.last_match(1))
|
||||
|
||||
@@ -266,7 +266,7 @@ module Jekyll
|
||||
else
|
||||
begin
|
||||
merge_defaults
|
||||
read_content(opts)
|
||||
read_content(**opts)
|
||||
read_post_data
|
||||
rescue StandardError => e
|
||||
handle_read_error(e)
|
||||
@@ -445,8 +445,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
private
|
||||
def read_content(opts)
|
||||
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
|
||||
def read_content(**opts)
|
||||
self.content = File.read(path, **Utils.merged_file_read_opts(site, opts))
|
||||
if content =~ YAML_FRONT_MATTER_REGEXP
|
||||
self.content = $POSTMATCH
|
||||
data_file = SafeYAML.load(Regexp.last_match(1))
|
||||
|
||||
@@ -8,8 +8,7 @@ module Jekyll
|
||||
mutable false
|
||||
|
||||
def_delegator :@obj, :site_data, :data
|
||||
def_delegators :@obj, :time, :pages, :static_files, :documents,
|
||||
:tags, :categories
|
||||
def_delegators :@obj, :time, :pages, :static_files, :tags, :categories
|
||||
|
||||
private def_delegator :@obj, :config, :fallback_data
|
||||
|
||||
@@ -39,6 +38,16 @@ module Jekyll
|
||||
@site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid)
|
||||
end
|
||||
|
||||
# `Site#documents` cannot be memoized so that `Site#docs_to_write` can access the
|
||||
# latest state of the attribute.
|
||||
#
|
||||
# Since this method will be called after `Site#pre_render` hook,
|
||||
# the `Site#documents` array shouldn't thereafter change and can therefore be
|
||||
# safely memoized to prevent additional computation of `Site#documents`.
|
||||
def documents
|
||||
@documents ||= @obj.documents
|
||||
end
|
||||
|
||||
# `{{ site.related_posts }}` is how posts can get posts related to
|
||||
# them, either through LSI if it's enabled, or through the most
|
||||
# recent posts.
|
||||
|
||||
@@ -31,9 +31,12 @@ module Jekyll
|
||||
|
||||
def filter(entries)
|
||||
entries.reject do |e|
|
||||
unless included?(e)
|
||||
special?(e) || backup?(e) || excluded?(e) || symlink?(e)
|
||||
end
|
||||
# Reject this entry if it is a symlink.
|
||||
next true if symlink?(e)
|
||||
# Do not reject this entry if it is included.
|
||||
next false if included?(e)
|
||||
# Reject this entry if it is special, a backup file, or excluded.
|
||||
special?(e) || backup?(e) || excluded?(e)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ module Jekyll
|
||||
#
|
||||
# Returns the relative_path for the doc this excerpt belongs to with #excerpt appended
|
||||
def relative_path
|
||||
@relative_path ||= File.join(doc.relative_path, "#excerpt")
|
||||
File.join(doc.relative_path, "#excerpt")
|
||||
end
|
||||
|
||||
# Check if excerpt includes a string
|
||||
@@ -128,46 +128,63 @@ module Jekyll
|
||||
#
|
||||
# Returns excerpt String
|
||||
|
||||
LIQUID_TAG_REGEX = %r!{%\s*(\w+).+\s*%}!m
|
||||
LIQUID_TAG_REGEX = %r!{%-?\s*(\w+)\s*.*?-?%}!m
|
||||
MKDWN_LINK_REF_REGEX = %r!^ {0,3}\[[^\]]+\]:.+$!
|
||||
|
||||
def extract_excerpt(doc_content)
|
||||
head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)
|
||||
|
||||
# append appropriate closing tag (to a Liquid block), to the "head" if the
|
||||
# partitioning resulted in leaving the closing tag somewhere in the "tail"
|
||||
# partition.
|
||||
if head.include?("{%")
|
||||
head =~ LIQUID_TAG_REGEX
|
||||
tag_name = Regexp.last_match(1)
|
||||
# append appropriate closing tag(s) (for each Liquid block), to the `head`
|
||||
# if the partitioning resulted in leaving the closing tag somewhere
|
||||
# in the `tail` partition.
|
||||
|
||||
if liquid_block?(tag_name) && head.match(%r!{%\s*end#{tag_name}\s*%}!).nil?
|
||||
print_build_warning
|
||||
if head.include?("{%")
|
||||
modified = false
|
||||
tag_names = head.scan(LIQUID_TAG_REGEX)
|
||||
tag_names.flatten!
|
||||
tag_names.reverse_each do |tag_name|
|
||||
next unless liquid_block?(tag_name)
|
||||
next if head =~ endtag_regex_stash(tag_name)
|
||||
|
||||
modified = true
|
||||
head << "\n{% end#{tag_name} %}"
|
||||
end
|
||||
print_build_warning if modified
|
||||
end
|
||||
|
||||
if tail.empty?
|
||||
head
|
||||
else
|
||||
head.to_s.dup << "\n\n" << tail.scan(MKDWN_LINK_REF_REGEX).join("\n")
|
||||
end
|
||||
return head if tail.empty?
|
||||
|
||||
head << "\n\n" << tail.scan(MKDWN_LINK_REF_REGEX).join("\n")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def endtag_regex_stash(tag_name)
|
||||
@endtag_regex_stash ||= {}
|
||||
@endtag_regex_stash[tag_name] ||= %r!{%-?\s*end#{tag_name}.*?\s*-?%}!m
|
||||
end
|
||||
|
||||
def liquid_block?(tag_name)
|
||||
Liquid::Template.tags[tag_name].superclass == Liquid::Block
|
||||
return false unless tag_name.is_a?(String)
|
||||
return false unless Liquid::Template.tags[tag_name]
|
||||
|
||||
Liquid::Template.tags[tag_name].ancestors.include?(Liquid::Block)
|
||||
rescue NoMethodError
|
||||
Jekyll.logger.error "Error:",
|
||||
"A Liquid tag in the excerpt of #{doc.relative_path} couldn't be " \
|
||||
"parsed."
|
||||
raise
|
||||
end
|
||||
|
||||
def print_build_warning
|
||||
Jekyll.logger.warn "Warning:", "Excerpt modified in #{doc.relative_path}!"
|
||||
Jekyll.logger.warn "",
|
||||
"Found a Liquid block containing separator '#{doc.excerpt_separator}' and has " \
|
||||
"been modified with the appropriate closing tag."
|
||||
Jekyll.logger.warn "",
|
||||
"Feel free to define a custom excerpt or excerpt_separator in the document's " \
|
||||
"Front Matter if the generated excerpt is unsatisfactory."
|
||||
Jekyll.logger.warn "", "Found a Liquid block containing the excerpt separator" \
|
||||
" #{doc.excerpt_separator.inspect}. "
|
||||
Jekyll.logger.warn "", "The block has been modified with the appropriate" \
|
||||
" closing tag."
|
||||
Jekyll.logger.warn "", "Feel free to define a custom excerpt or" \
|
||||
" excerpt_separator in the document's front matter" \
|
||||
" if the generated excerpt is unsatisfactory."
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,6 @@ module Jekyll
|
||||
#
|
||||
def blessed_gems
|
||||
%w(
|
||||
jekyll-compose
|
||||
jekyll-docs
|
||||
jekyll-import
|
||||
)
|
||||
|
||||
@@ -53,7 +53,9 @@ module Jekyll
|
||||
private
|
||||
|
||||
def filename_regex
|
||||
@filename_regex ||= %r!\A(#{source_dir}/|#{theme_dir}/|\W*)(.*)!i
|
||||
@filename_regex ||= begin
|
||||
%r!\A(#{Regexp.escape(source_dir)}/|#{Regexp.escape(theme_dir.to_s)}/|/*)(.*)!i
|
||||
end
|
||||
end
|
||||
|
||||
def new_profile_hash
|
||||
|
||||
@@ -29,9 +29,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def log_level=(level)
|
||||
writer.level = level if level.is_a?(Integer) && level.between?(0, 3)
|
||||
writer.level = LOG_LEVELS[level] ||
|
||||
raise(ArgumentError, "unknown log level")
|
||||
writer.level = LOG_LEVELS.fetch(level)
|
||||
@level = level
|
||||
end
|
||||
|
||||
|
||||
@@ -5,36 +5,47 @@ application/andrew-inset ez
|
||||
application/applixware aw
|
||||
application/atom+xml atom
|
||||
application/atomcat+xml atomcat
|
||||
application/atomdeleted+xml atomdeleted
|
||||
application/atomsvc+xml atomsvc
|
||||
application/atsc-dwd+xml dwd
|
||||
application/atsc-held+xml held
|
||||
application/atsc-rsat+xml rsat
|
||||
application/bdoc bdoc
|
||||
application/calendar+xml xcs
|
||||
application/ccxml+xml ccxml
|
||||
application/cdfx+xml cdfx
|
||||
application/cdmi-capability cdmia
|
||||
application/cdmi-container cdmic
|
||||
application/cdmi-domain cdmid
|
||||
application/cdmi-object cdmio
|
||||
application/cdmi-queue cdmiq
|
||||
application/cpl+xml cpl
|
||||
application/cu-seeme cu
|
||||
application/dash+xml mpd
|
||||
application/dash-patch+xml mpp
|
||||
application/davmount+xml davmount
|
||||
application/docbook+xml dbk
|
||||
application/dssc+der dssc
|
||||
application/dssc+xml xdssc
|
||||
application/ecmascript ecma
|
||||
application/ecmascript ecma es
|
||||
application/emma+xml emma
|
||||
application/emotionml+xml emotionml
|
||||
application/epub+zip epub
|
||||
application/exi exi
|
||||
application/express exp
|
||||
application/fdt+xml fdt
|
||||
application/font-tdpfr pfr
|
||||
application/font-woff woff
|
||||
application/font-woff2 woff2
|
||||
application/geo+json geojson
|
||||
application/gml+xml gml
|
||||
application/gpx+xml gpx
|
||||
application/gxf gxf
|
||||
application/gzip gz
|
||||
application/hjson hjson
|
||||
application/hyperstudio stk
|
||||
application/inkml+xml ink inkml
|
||||
application/ipfix ipfix
|
||||
application/java-archive jar war ear
|
||||
application/its+xml its
|
||||
application/java-archive ear jar war
|
||||
application/java-serialized-object ser
|
||||
application/java-vm class
|
||||
application/javascript js mjs
|
||||
@@ -42,6 +53,7 @@ application/json json m
|
||||
application/json5 json5
|
||||
application/jsonml+json jsonml
|
||||
application/ld+json jsonld
|
||||
application/lgr+xml lgr
|
||||
application/lost+xml lostxml
|
||||
application/mac-binhex40 hqx
|
||||
application/mac-compactpro cpt
|
||||
@@ -49,32 +61,40 @@ application/mads+xml mads
|
||||
application/manifest+json webmanifest
|
||||
application/marc mrc
|
||||
application/marcxml+xml mrcx
|
||||
application/mathematica ma nb mb
|
||||
application/mathematica ma mb nb
|
||||
application/mathml+xml mathml
|
||||
application/mbox mbox
|
||||
application/media-policy-dataset+xml mpf
|
||||
application/mediaservercontrol+xml mscml
|
||||
application/metalink+xml metalink
|
||||
application/metalink4+xml meta4
|
||||
application/mets+xml mets
|
||||
application/mmt-aei+xml maei
|
||||
application/mmt-usd+xml musd
|
||||
application/mods+xml mods
|
||||
application/mp21 m21 mp21
|
||||
application/mp4 mp4s m4p
|
||||
application/mp4 m4p mp4s
|
||||
application/msword doc dot
|
||||
application/mxf mxf
|
||||
application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy exe dll deb dmg iso img msi msp msm buffer
|
||||
application/n-quads nq
|
||||
application/n-triples nt
|
||||
application/node cjs
|
||||
application/octet-stream bin bpk buffer deb deploy dist distz dll dmg dms dump elc exe img iso lrf mar msi msm msp pkg so
|
||||
application/oda oda
|
||||
application/oebps-package+xml opf
|
||||
application/ogg ogx
|
||||
application/omdoc+xml omdoc
|
||||
application/onenote onetoc onetoc2 onetmp onepkg
|
||||
application/onenote onepkg onetmp onetoc onetoc2
|
||||
application/oxps oxps
|
||||
application/p2p-overlay+xml relo
|
||||
application/patch-ops-error+xml xer
|
||||
application/pdf pdf
|
||||
application/pgp-encrypted pgp
|
||||
application/pgp-signature asc sig
|
||||
application/pgp-keys asc
|
||||
application/pgp-signature sig
|
||||
application/pics-rules prf
|
||||
application/pkcs10 p10
|
||||
application/pkcs7-mime p7m p7c
|
||||
application/pkcs7-mime p7c p7m
|
||||
application/pkcs7-signature p7s
|
||||
application/pkcs8 p8
|
||||
application/pkix-attr-cert ac
|
||||
@@ -84,14 +104,19 @@ application/pkix-pkipath pkipat
|
||||
application/pkixcmp pki
|
||||
application/pls+xml pls
|
||||
application/postscript ai eps ps
|
||||
application/provenance+xml provx
|
||||
application/prs.cww cww
|
||||
application/pskc+xml pskcxml
|
||||
application/rdf+xml rdf
|
||||
application/raml+yaml raml
|
||||
application/rdf+xml owl rdf
|
||||
application/reginfo+xml rif
|
||||
application/relax-ng-compact-syntax rnc
|
||||
application/resource-lists+xml rl
|
||||
application/resource-lists-diff+xml rld
|
||||
application/rls-services+xml rs
|
||||
application/route-apd+xml rapd
|
||||
application/route-s-tsid+xml sls
|
||||
application/route-usd+xml rusd
|
||||
application/rpki-ghostbusters gbr
|
||||
application/rpki-manifest mft
|
||||
application/rpki-roa roa
|
||||
@@ -104,9 +129,12 @@ application/scvp-cv-response scs
|
||||
application/scvp-vp-request spq
|
||||
application/scvp-vp-response spp
|
||||
application/sdp sdp
|
||||
application/senml+xml senmlx
|
||||
application/sensml+xml sensmlx
|
||||
application/set-payment-initiation setpay
|
||||
application/set-registration-initiation setreg
|
||||
application/shf+xml shf
|
||||
application/sieve sieve siv
|
||||
application/smil+xml smi smil
|
||||
application/sparql-query rq
|
||||
application/sparql-results+xml srx
|
||||
@@ -115,9 +143,17 @@ application/srgs+xml grxml
|
||||
application/sru+xml sru
|
||||
application/ssdl+xml ssdl
|
||||
application/ssml+xml ssml
|
||||
application/swid+xml swidtag
|
||||
application/tei+xml tei teicorpus
|
||||
application/thraud+xml tfi
|
||||
application/timestamped-data tsd
|
||||
application/toml toml
|
||||
application/trig trig
|
||||
application/ttml+xml ttml
|
||||
application/ubjson ubj
|
||||
application/urc-ressheet+xml rsheet
|
||||
application/urc-targetdesc+xml td
|
||||
application/vnd.1000minds.decision-model+xml 1km
|
||||
application/vnd.3gpp.pic-bw-large plb
|
||||
application/vnd.3gpp.pic-bw-small psb
|
||||
application/vnd.3gpp.pic-bw-var pvb
|
||||
@@ -126,12 +162,13 @@ application/vnd.3m.post-it-notes pwn
|
||||
application/vnd.accpac.simply.aso aso
|
||||
application/vnd.accpac.simply.imp imp
|
||||
application/vnd.acucobol acu
|
||||
application/vnd.acucorp atc acutc
|
||||
application/vnd.acucorp acutc atc
|
||||
application/vnd.adobe.air-application-installer-package+zip air
|
||||
application/vnd.adobe.formscentral.fcdt fcdt
|
||||
application/vnd.adobe.fxp fxp fxpl
|
||||
application/vnd.adobe.xdp+xml xdp
|
||||
application/vnd.adobe.xfdf xfdf
|
||||
application/vnd.age age
|
||||
application/vnd.ahead.space ahead
|
||||
application/vnd.airzip.filesecure.azf azf
|
||||
application/vnd.airzip.filesecure.azs azs
|
||||
@@ -143,20 +180,25 @@ application/vnd.anser-web-certificate-issue-initiation cii
|
||||
application/vnd.anser-web-funds-transfer-initiation fti
|
||||
application/vnd.antix.game-component atx
|
||||
application/vnd.apple.installer+xml mpkg
|
||||
application/vnd.apple.keynote key
|
||||
application/vnd.apple.mpegurl m3u8
|
||||
application/vnd.apple.numbers numbers
|
||||
application/vnd.apple.pages pages
|
||||
application/vnd.apple.pkpass pkpass
|
||||
application/vnd.aristanetworks.swi swi
|
||||
application/vnd.astraea-software.iota iota
|
||||
application/vnd.audiograph aep
|
||||
application/vnd.balsamiq.bmml+xml bmml
|
||||
application/vnd.blueice.multipass mpm
|
||||
application/vnd.bmi bmi
|
||||
application/vnd.businessobjects rep
|
||||
application/vnd.chemdraw+xml cdxml
|
||||
application/vnd.chipnuts.karaoke-mmd mmd
|
||||
application/vnd.cinderella cdy
|
||||
application/vnd.citationstyles.style+xml csl
|
||||
application/vnd.claymore cla
|
||||
application/vnd.cloanto.rp9 rp9
|
||||
application/vnd.clonk.c4group c4g c4d c4f c4p c4u
|
||||
application/vnd.clonk.c4group c4d c4f c4g c4p c4u
|
||||
application/vnd.cluetrust.cartomobile-config c11amc
|
||||
application/vnd.cluetrust.cartomobile-config-pkg c11amz
|
||||
application/vnd.commonspace csp
|
||||
@@ -174,10 +216,11 @@ application/vnd.curl.car car
|
||||
application/vnd.curl.pcurl pcurl
|
||||
application/vnd.dart dart
|
||||
application/vnd.data-vision.rdz rdz
|
||||
application/vnd.dece.data uvf uvvf uvd uvvd
|
||||
application/vnd.dbf dbf
|
||||
application/vnd.dece.data uvd uvf uvvd uvvf
|
||||
application/vnd.dece.ttml+xml uvt uvvt
|
||||
application/vnd.dece.unspecified uvx uvvx
|
||||
application/vnd.dece.zip uvz uvvz
|
||||
application/vnd.dece.unspecified uvvx uvx
|
||||
application/vnd.dece.zip uvvz uvz
|
||||
application/vnd.denovo.fcselayout-link fe_launch
|
||||
application/vnd.dna dna
|
||||
application/vnd.dolby.mlp mlp
|
||||
@@ -199,10 +242,10 @@ application/vnd.ezpix-album ez2
|
||||
application/vnd.ezpix-package ez3
|
||||
application/vnd.fdf fdf
|
||||
application/vnd.fdsn.mseed mseed
|
||||
application/vnd.fdsn.seed seed dataless
|
||||
application/vnd.fdsn.seed dataless seed
|
||||
application/vnd.flographit gph
|
||||
application/vnd.fluxtime.clip ftc
|
||||
application/vnd.framemaker fm frame maker book
|
||||
application/vnd.framemaker book fm frame maker
|
||||
application/vnd.frogans.fnc fnc
|
||||
application/vnd.frogans.ltf ltf
|
||||
application/vnd.fsc.weblaunch fsc
|
||||
@@ -248,7 +291,7 @@ application/vnd.hp-pcl pcl
|
||||
application/vnd.hp-pclxl pclxl
|
||||
application/vnd.hydrostatix.sof-data sfd-hdstx
|
||||
application/vnd.ibm.minipay mpy
|
||||
application/vnd.ibm.modcap afp listafp list3820
|
||||
application/vnd.ibm.modcap afp list3820 listafp
|
||||
application/vnd.ibm.rights-management irm
|
||||
application/vnd.ibm.secure-container sc
|
||||
application/vnd.iccprofile icc icm
|
||||
@@ -268,7 +311,7 @@ application/vnd.jam jam
|
||||
application/vnd.jcp.javame.midlet-rms rms
|
||||
application/vnd.jisp jisp
|
||||
application/vnd.joost.joda-archive joda
|
||||
application/vnd.kahootz ktz ktr
|
||||
application/vnd.kahootz ktr ktz
|
||||
application/vnd.kde.karbon karbon
|
||||
application/vnd.kde.kchart chrt
|
||||
application/vnd.kde.kformula kfo
|
||||
@@ -280,7 +323,7 @@ application/vnd.kde.kword kwd kw
|
||||
application/vnd.kenameaapp htke
|
||||
application/vnd.kidspiration kia
|
||||
application/vnd.kinar kne knp
|
||||
application/vnd.koan skp skd skt skm
|
||||
application/vnd.koan skd skm skp skt
|
||||
application/vnd.kodak-descriptor sse
|
||||
application/vnd.las.las+xml lasxml
|
||||
application/vnd.llamagraphics.life-balance.desktop lbd
|
||||
@@ -293,6 +336,7 @@ application/vnd.lotus-organizer org
|
||||
application/vnd.lotus-screencam scm
|
||||
application/vnd.lotus-wordpro lwp
|
||||
application/vnd.macports.portpkg portpkg
|
||||
application/vnd.mapbox-vector-tile mvt
|
||||
application/vnd.mcd mcd
|
||||
application/vnd.medcalcdata mc1
|
||||
application/vnd.mediastation.cdkey cdkey
|
||||
@@ -313,7 +357,7 @@ application/vnd.mophun.certificate mpc
|
||||
application/vnd.mozilla.xul+xml xul
|
||||
application/vnd.ms-artgalry cil
|
||||
application/vnd.ms-cab-compressed cab
|
||||
application/vnd.ms-excel xls xlm xla xlc xlt xlw
|
||||
application/vnd.ms-excel xla xlc xlm xls xlt xlw
|
||||
application/vnd.ms-excel.addin.macroenabled.12 xlam
|
||||
application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb
|
||||
application/vnd.ms-excel.sheet.macroenabled.12 xlsm
|
||||
@@ -326,16 +370,16 @@ application/vnd.ms-officetheme thmx
|
||||
application/vnd.ms-outlook msg
|
||||
application/vnd.ms-pki.seccat cat
|
||||
application/vnd.ms-pki.stl stl
|
||||
application/vnd.ms-powerpoint ppt pps pot
|
||||
application/vnd.ms-powerpoint pot pps ppt
|
||||
application/vnd.ms-powerpoint.addin.macroenabled.12 ppam
|
||||
application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm
|
||||
application/vnd.ms-powerpoint.slide.macroenabled.12 sldm
|
||||
application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm
|
||||
application/vnd.ms-powerpoint.template.macroenabled.12 potm
|
||||
application/vnd.ms-project mpp mpt
|
||||
application/vnd.ms-project mpt
|
||||
application/vnd.ms-word.document.macroenabled.12 docm
|
||||
application/vnd.ms-word.template.macroenabled.12 dotm
|
||||
application/vnd.ms-works wps wks wcm wdb
|
||||
application/vnd.ms-works wcm wdb wks wps
|
||||
application/vnd.ms-wpl wpl
|
||||
application/vnd.ms-xpsdocument xps
|
||||
application/vnd.mseq mseq
|
||||
@@ -343,7 +387,7 @@ application/vnd.musician mus
|
||||
application/vnd.muvee.style msty
|
||||
application/vnd.mynfc taglet
|
||||
application/vnd.neurolanguage.nlu nlu
|
||||
application/vnd.nitf ntf nitf
|
||||
application/vnd.nitf nitf ntf
|
||||
application/vnd.noblenet-directory nnd
|
||||
application/vnd.noblenet-sealer nns
|
||||
application/vnd.noblenet-web nnw
|
||||
@@ -373,7 +417,9 @@ application/vnd.oasis.opendocument.text-template ott
|
||||
application/vnd.oasis.opendocument.text-web oth
|
||||
application/vnd.olpc-sugar xo
|
||||
application/vnd.oma.dd2+xml dd2
|
||||
application/vnd.openblox.game+xml obgx
|
||||
application/vnd.openofficeorg.extension oxt
|
||||
application/vnd.openstreetmap.data+xml osm
|
||||
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
|
||||
application/vnd.openxmlformats-officedocument.presentationml.slide sldx
|
||||
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
|
||||
@@ -385,7 +431,7 @@ application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
|
||||
application/vnd.osgeo.mapguide.package mgp
|
||||
application/vnd.osgi.dp dp
|
||||
application/vnd.osgi.subsystem esa
|
||||
application/vnd.palm pdb pqa oprc
|
||||
application/vnd.palm oprc pdb pqa
|
||||
application/vnd.pawaafile paw
|
||||
application/vnd.pg.format str
|
||||
application/vnd.pg.osasli ei6
|
||||
@@ -397,7 +443,8 @@ application/vnd.previewsystems.box box
|
||||
application/vnd.proteus.magazine mgz
|
||||
application/vnd.publishare-delta-tree qps
|
||||
application/vnd.pvi.ptid1 ptid
|
||||
application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb
|
||||
application/vnd.quark.quarkxpress qwd qwt qxb qxd qxl qxt
|
||||
application/vnd.rar rar
|
||||
application/vnd.realvnc.bed bed
|
||||
application/vnd.recordare.musicxml mxl
|
||||
application/vnd.recordare.musicxml+xml musicxml
|
||||
@@ -418,7 +465,8 @@ application/vnd.shana.informed.package ipk
|
||||
application/vnd.simtech-mindmapper twd twds
|
||||
application/vnd.smaf mmf
|
||||
application/vnd.smart.teacher teacher
|
||||
application/vnd.solent.sdkm+xml sdkm sdkd
|
||||
application/vnd.software602.filler.form+xml fo
|
||||
application/vnd.solent.sdkm+xml sdkd sdkm
|
||||
application/vnd.spotfire.dxp dxp
|
||||
application/vnd.spotfire.sfs sfs
|
||||
application/vnd.stardivision.calc sdc
|
||||
@@ -446,8 +494,9 @@ application/vnd.symbian.install sis si
|
||||
application/vnd.syncml+xml xsm
|
||||
application/vnd.syncml.dm+wbxml bdm
|
||||
application/vnd.syncml.dm+xml xdm
|
||||
application/vnd.syncml.dmddf+xml ddf
|
||||
application/vnd.tao.intent-module-archive tao
|
||||
application/vnd.tcpdump.pcap pcap cap dmp
|
||||
application/vnd.tcpdump.pcap cap dmp pcap
|
||||
application/vnd.tmobile-livetv tmo
|
||||
application/vnd.trid.tpt tpt
|
||||
application/vnd.triscape.mxs mxs
|
||||
@@ -458,7 +507,7 @@ application/vnd.umajin umj
|
||||
application/vnd.unity unityweb
|
||||
application/vnd.uoml+xml uoml
|
||||
application/vnd.vcx vcx
|
||||
application/vnd.visio vsd vst vss vsw
|
||||
application/vnd.visio vsd vss vst vsw
|
||||
application/vnd.visionary vis
|
||||
application/vnd.vsf vsf
|
||||
application/vnd.wap.wbxml wbxml
|
||||
@@ -482,6 +531,8 @@ application/vnd.yellowriver-custom-menu cmp
|
||||
application/vnd.zul zir zirz
|
||||
application/vnd.zzazz.deck+xml zaz
|
||||
application/voicexml+xml vxml
|
||||
application/wasm wasm
|
||||
application/watcherinfo+xml wif
|
||||
application/widget wgt
|
||||
application/winhlp hlp
|
||||
application/wsdl+xml wsdl
|
||||
@@ -490,15 +541,15 @@ application/x-7z-compressed 7z
|
||||
application/x-abiword abw
|
||||
application/x-ace-compressed ace
|
||||
application/x-arj arj
|
||||
application/x-authorware-bin aab x32 u32 vox
|
||||
application/x-authorware-bin aab u32 vox x32
|
||||
application/x-authorware-map aam
|
||||
application/x-authorware-seg aas
|
||||
application/x-bcpio bcpio
|
||||
application/x-bittorrent torrent
|
||||
application/x-blorb blb blorb
|
||||
application/x-bzip bz
|
||||
application/x-bzip2 bz2 boz
|
||||
application/x-cbr cbr cba cbt cbz cb7
|
||||
application/x-bzip2 boz bz2
|
||||
application/x-cbr cb7 cba cbr cbt cbz
|
||||
application/x-cdlink vcd
|
||||
application/x-cfs-compressed cfs
|
||||
application/x-chat chat
|
||||
@@ -510,7 +561,7 @@ application/x-cpio cpio
|
||||
application/x-csh csh
|
||||
application/x-debian-package udeb
|
||||
application/x-dgc-compressed dgc
|
||||
application/x-director dir dcr dxr cst cct cxt w3d fgd swa
|
||||
application/x-director cct cst cxt dcr dir dxr fgd swa w3d
|
||||
application/x-doom wad
|
||||
application/x-dtbncx+xml ncx
|
||||
application/x-dtbook+xml dtb
|
||||
@@ -521,11 +572,9 @@ application/x-eva eva
|
||||
application/x-font-bdf bdf
|
||||
application/x-font-ghostscript gsf
|
||||
application/x-font-linux-psf psf
|
||||
application/x-font-otf otf
|
||||
application/x-font-pcf pcf
|
||||
application/x-font-snf snf
|
||||
application/x-font-ttf ttf ttc
|
||||
application/x-font-type1 pfa pfb pfm afm
|
||||
application/x-font-type1 afm pfa pfb pfm
|
||||
application/x-freearc arc
|
||||
application/x-futuresplash spl
|
||||
application/x-gca-compressed gca
|
||||
@@ -538,12 +587,13 @@ application/x-httpd-php php
|
||||
application/x-install-instructions install
|
||||
application/x-java-archive-diff jardiff
|
||||
application/x-java-jnlp-file jnlp
|
||||
application/x-keepass2 kdbx
|
||||
application/x-latex latex
|
||||
application/x-lua-bytecode luac
|
||||
application/x-lzh-compressed lzh lha
|
||||
application/x-lzh-compressed lha lzh
|
||||
application/x-makeself run
|
||||
application/x-mie mie
|
||||
application/x-mobipocket-ebook prc mobi
|
||||
application/x-mobipocket-ebook mobi prc
|
||||
application/x-ms-application application
|
||||
application/x-ms-shortcut lnk
|
||||
application/x-ms-wmd wmd
|
||||
@@ -553,22 +603,21 @@ application/x-msaccess mdb
|
||||
application/x-msbinder obd
|
||||
application/x-mscardfile crd
|
||||
application/x-msclip clp
|
||||
application/x-msdownload com bat
|
||||
application/x-msmediaview mvb m13 m14
|
||||
application/x-msmetafile wmf emf emz
|
||||
application/x-msdownload bat com
|
||||
application/x-msmediaview m13 m14 mvb
|
||||
application/x-msmetafile emf emz wmf
|
||||
application/x-msmoney mny
|
||||
application/x-mspublisher pub
|
||||
application/x-msschedule scd
|
||||
application/x-msterminal trm
|
||||
application/x-mswrite wri
|
||||
application/x-netcdf nc cdf
|
||||
application/x-netcdf cdf nc
|
||||
application/x-ns-proxy-autoconfig pac
|
||||
application/x-nzb nzb
|
||||
application/x-perl pl pm
|
||||
application/x-pkcs12 p12 pfx
|
||||
application/x-pkcs7-certificates p7b spc
|
||||
application/x-pkcs7-certreqresp p7r
|
||||
application/x-rar-compressed rar
|
||||
application/x-redhat-package-manager rpm
|
||||
application/x-research-info-systems ris
|
||||
application/x-sea sea
|
||||
@@ -588,7 +637,7 @@ application/x-tar tar
|
||||
application/x-tcl tcl tk
|
||||
application/x-tex tex
|
||||
application/x-tex-tfm tfm
|
||||
application/x-texinfo texinfo texi
|
||||
application/x-texinfo texi texinfo
|
||||
application/x-tgif obj
|
||||
application/x-ustar ustar
|
||||
application/x-virtualbox-hdd hdd
|
||||
@@ -601,34 +650,40 @@ application/x-virtualbox-vhd vhd
|
||||
application/x-virtualbox-vmdk vmdk
|
||||
application/x-wais-source src
|
||||
application/x-web-app-manifest+json webapp
|
||||
application/x-x509-ca-cert der crt pem
|
||||
application/x-x509-ca-cert crt der pem
|
||||
application/x-xfig fig
|
||||
application/x-xliff+xml xlf
|
||||
application/x-xpinstall xpi
|
||||
application/x-xz xz
|
||||
application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8
|
||||
application/xaml+xml xaml
|
||||
application/xcap-att+xml xav
|
||||
application/xcap-caps+xml xca
|
||||
application/xcap-diff+xml xdf
|
||||
application/xcap-el+xml xel
|
||||
application/xcap-ns+xml xns
|
||||
application/xenc+xml xenc
|
||||
application/xhtml+xml xhtml xht
|
||||
application/xml xml xsl xsd rng
|
||||
application/xhtml+xml xht xhtml
|
||||
application/xml rng xml xsd xsl
|
||||
application/xml-dtd dtd
|
||||
application/xop+xml xop
|
||||
application/xproc+xml xpl
|
||||
application/xslt+xml xslt
|
||||
application/xspf+xml xspf
|
||||
application/xv+xml mxml xhvml xvml xvm
|
||||
application/xv+xml mxml xhvml xvm xvml
|
||||
application/yang yang
|
||||
application/yin+xml yin
|
||||
application/zip zip
|
||||
audio/3gpp 3gpp
|
||||
audio/adpcm adp
|
||||
audio/amr amr
|
||||
audio/basic au snd
|
||||
audio/midi mid midi kar rmi
|
||||
audio/midi kar mid midi rmi
|
||||
audio/mobile-xmf mxmf
|
||||
audio/mp3 mp3
|
||||
audio/mp4 m4a mp4a
|
||||
audio/mpeg mpga mp2 mp2a m2a m3a
|
||||
audio/ogg oga ogg spx
|
||||
audio/mpeg m2a m3a mp2 mp2a mpga
|
||||
audio/ogg oga ogg opus spx
|
||||
audio/s3m s3m
|
||||
audio/silk sil
|
||||
audio/vnd.dece.audio uva uvva
|
||||
@@ -645,14 +700,14 @@ audio/vnd.rip rip
|
||||
audio/wav wav
|
||||
audio/webm weba
|
||||
audio/x-aac aac
|
||||
audio/x-aiff aif aiff aifc
|
||||
audio/x-aiff aif aifc aiff
|
||||
audio/x-caf caf
|
||||
audio/x-flac flac
|
||||
audio/x-matroska mka
|
||||
audio/x-mpegurl m3u
|
||||
audio/x-ms-wax wax
|
||||
audio/x-ms-wma wma
|
||||
audio/x-pn-realaudio ram ra
|
||||
audio/x-pn-realaudio ra ram
|
||||
audio/x-pn-realaudio-plugin rmp
|
||||
audio/xm xm
|
||||
chemical/x-cdx cdx
|
||||
@@ -661,22 +716,57 @@ chemical/x-cmdf cmdf
|
||||
chemical/x-cml cml
|
||||
chemical/x-csml csml
|
||||
chemical/x-xyz xyz
|
||||
font/collection ttc
|
||||
font/otf otf
|
||||
font/ttf ttf
|
||||
font/woff woff
|
||||
font/woff2 woff2
|
||||
image/aces exr
|
||||
image/apng apng
|
||||
image/avci avci
|
||||
image/avcs avcs
|
||||
image/avif avif
|
||||
image/bmp bmp
|
||||
image/cgm cgm
|
||||
image/dicom-rle drle
|
||||
image/fits fits
|
||||
image/g3fax g3
|
||||
image/gif gif
|
||||
image/heic heic
|
||||
image/heic-sequence heics
|
||||
image/heif heif
|
||||
image/heif-sequence heifs
|
||||
image/hej2k hej2
|
||||
image/hsj2 hsj2
|
||||
image/ief ief
|
||||
image/jpeg jpeg jpg jpe
|
||||
image/jls jls
|
||||
image/jp2 jp2 jpg2
|
||||
image/jpeg jpe jpeg jpg
|
||||
image/jph jph
|
||||
image/jphc jhc
|
||||
image/jpm jpm
|
||||
image/jpx jpf jpx
|
||||
image/jxr jxr
|
||||
image/jxra jxra
|
||||
image/jxrs jxrs
|
||||
image/jxs jxs
|
||||
image/jxsc jxsc
|
||||
image/jxsi jxsi
|
||||
image/jxss jxss
|
||||
image/ktx ktx
|
||||
image/ktx2 ktx2
|
||||
image/png png
|
||||
image/prs.btif btif
|
||||
image/prs.pti pti
|
||||
image/sgi sgi
|
||||
image/svg+xml svg svgz
|
||||
image/tiff tiff tif
|
||||
image/t38 t38
|
||||
image/tiff tif tiff
|
||||
image/tiff-fx tfx
|
||||
image/vnd.adobe.photoshop psd
|
||||
image/vnd.dece.graphic uvi uvvi uvg uvvg
|
||||
image/vnd.djvu djvu djv
|
||||
image/vnd.airzip.accelerator.azv azv
|
||||
image/vnd.dece.graphic uvg uvi uvvg uvvi
|
||||
image/vnd.djvu djv djvu
|
||||
image/vnd.dvb.subtitle sub
|
||||
image/vnd.dwg dwg
|
||||
image/vnd.dxf dxf
|
||||
@@ -685,21 +775,25 @@ image/vnd.fpx fpx
|
||||
image/vnd.fst fst
|
||||
image/vnd.fujixerox.edmics-mmr mmr
|
||||
image/vnd.fujixerox.edmics-rlc rlc
|
||||
image/vnd.microsoft.icon ico
|
||||
image/vnd.ms-dds dds
|
||||
image/vnd.ms-modi mdi
|
||||
image/vnd.ms-photo wdp
|
||||
image/vnd.net-fpx npx
|
||||
image/vnd.pco.b16 b16
|
||||
image/vnd.tencent.tap tap
|
||||
image/vnd.valve.source.texture vtf
|
||||
image/vnd.wap.wbmp wbmp
|
||||
image/vnd.xiff xif
|
||||
image/vnd.zbrush.pcx pcx
|
||||
image/webp webp
|
||||
image/x-3ds 3ds
|
||||
image/x-cmu-raster ras
|
||||
image/x-cmx cmx
|
||||
image/x-freehand fh fhc fh4 fh5 fh7
|
||||
image/x-icon ico
|
||||
image/x-freehand fh fh4 fh5 fh7 fhc
|
||||
image/x-jng jng
|
||||
image/x-mrsid-image sid
|
||||
image/x-pcx pcx
|
||||
image/x-pict pic pct
|
||||
image/x-pict pct pic
|
||||
image/x-portable-anymap pnm
|
||||
image/x-portable-bitmap pbm
|
||||
image/x-portable-graymap pgm
|
||||
@@ -709,18 +803,35 @@ image/x-tga tga
|
||||
image/x-xbitmap xbm
|
||||
image/x-xpixmap xpm
|
||||
image/x-xwindowdump xwd
|
||||
message/disposition-notification disposition-notification
|
||||
message/global u8msg
|
||||
message/global-delivery-status u8dsn
|
||||
message/global-disposition-notification u8mdn
|
||||
message/global-headers u8hdr
|
||||
message/rfc822 eml mime
|
||||
message/vnd.wfa.wsc wsc
|
||||
model/3mf 3mf
|
||||
model/gltf+json gltf
|
||||
model/gltf-binary glb
|
||||
model/iges igs iges
|
||||
model/mesh msh mesh silo
|
||||
model/iges iges igs
|
||||
model/mesh mesh msh silo
|
||||
model/mtl mtl
|
||||
model/step+xml stpx
|
||||
model/step+zip stpz
|
||||
model/step-xml+zip stpxz
|
||||
model/vnd.collada+xml dae
|
||||
model/vnd.dwf dwf
|
||||
model/vnd.gdl gdl
|
||||
model/vnd.gtw gtw
|
||||
model/vnd.mts mts
|
||||
model/vnd.opengex ogex
|
||||
model/vnd.parasolid.transmit.binary x_b
|
||||
model/vnd.parasolid.transmit.text x_t
|
||||
model/vnd.sap.vds vds
|
||||
model/vnd.usdz+zip usdz
|
||||
model/vnd.valve.source.compiled-map bsp
|
||||
model/vnd.vtu vtu
|
||||
model/vrml wrl vrml
|
||||
model/vrml vrml wrl
|
||||
model/x3d+binary x3db x3dbz
|
||||
model/x3d+vrml x3dv x3dvz
|
||||
model/x3d+xml x3d x3dz
|
||||
@@ -729,22 +840,24 @@ text/calendar ics if
|
||||
text/coffeescript coffee litcoffee
|
||||
text/css css
|
||||
text/csv csv
|
||||
text/hjson hjson
|
||||
text/html html htm shtml
|
||||
text/html htm html shtml
|
||||
text/jade jade
|
||||
text/jsx jsx
|
||||
text/less less
|
||||
text/markdown markdown md
|
||||
text/mathml mml
|
||||
text/mdx mdx
|
||||
text/n3 n3
|
||||
text/plain txt text conf def list log in ini
|
||||
text/plain conf def in ini list log text txt
|
||||
text/prs.lines.tag dsc
|
||||
text/richtext rtx
|
||||
text/sgml sgml sgm
|
||||
text/sgml sgm sgml
|
||||
text/shex shex
|
||||
text/slim slim slm
|
||||
text/stylus stylus styl
|
||||
text/spdx spdx
|
||||
text/stylus styl stylus
|
||||
text/tab-separated-values tsv
|
||||
text/troff t tr roff man me ms
|
||||
text/troff man me ms roff t tr
|
||||
text/turtle ttl
|
||||
text/uri-list uri uris urls
|
||||
text/vcard vcard
|
||||
@@ -752,6 +865,7 @@ text/vnd.curl curl
|
||||
text/vnd.curl.dcurl dcurl
|
||||
text/vnd.curl.mcurl mcurl
|
||||
text/vnd.curl.scurl scurl
|
||||
text/vnd.familysearch.gedcom ged
|
||||
text/vnd.fly fly
|
||||
text/vnd.fmi.flexstor flx
|
||||
text/vnd.graphviz gv
|
||||
@@ -761,10 +875,10 @@ text/vnd.sun.j2me.app-descriptor jad
|
||||
text/vnd.wap.wml wml
|
||||
text/vnd.wap.wmlscript wmls
|
||||
text/vtt vtt
|
||||
text/x-asm s asm
|
||||
text/x-c c cc cxx cpp h hh dic
|
||||
text/x-asm asm s
|
||||
text/x-c c cc cpp cxx dic h hh
|
||||
text/x-component htc
|
||||
text/x-fortran f for f77 f90
|
||||
text/x-fortran f f77 f90 for
|
||||
text/x-handlebars-template hbs
|
||||
text/x-java-source java
|
||||
text/x-lua lua
|
||||
@@ -787,14 +901,15 @@ video/3gpp2 3g2
|
||||
video/h261 h261
|
||||
video/h263 h263
|
||||
video/h264 h264
|
||||
video/iso.segment m4s
|
||||
video/jpeg jpgv
|
||||
video/jpm jpm jpgm
|
||||
video/jpm jpgm
|
||||
video/mj2 mj2 mjp2
|
||||
video/mp2t ts
|
||||
video/mp4 mp4 mp4v mpg4
|
||||
video/mpeg mpeg mpg mpe m1v m2v
|
||||
video/mpeg m1v m2v mpe mpeg mpg
|
||||
video/ogg ogv
|
||||
video/quicktime qt mov
|
||||
video/quicktime mov qt
|
||||
video/vnd.dece.hd uvh uvvh
|
||||
video/vnd.dece.mobile uvm uvvm
|
||||
video/vnd.dece.pd uvp uvvp
|
||||
@@ -802,7 +917,7 @@ video/vnd.dece.sd uvs uv
|
||||
video/vnd.dece.video uvv uvvv
|
||||
video/vnd.dvb.file dvb
|
||||
video/vnd.fvt fvt
|
||||
video/vnd.mpegurl mxu m4u
|
||||
video/vnd.mpegurl m4u mxu
|
||||
video/vnd.ms-playready.media.pyv pyv
|
||||
video/vnd.uvvu.mp4 uvu uvvu
|
||||
video/vnd.vivo viv
|
||||
@@ -811,7 +926,7 @@ video/x-f4v f4v
|
||||
video/x-fli fli
|
||||
video/x-flv flv
|
||||
video/x-m4v m4v
|
||||
video/x-matroska mkv mk3d mks
|
||||
video/x-matroska mk3d mks mkv
|
||||
video/x-mng mng
|
||||
video/x-ms-asf asf asx
|
||||
video/x-ms-vob vob
|
||||
|
||||
@@ -11,6 +11,8 @@ module Jekyll
|
||||
|
||||
alias_method :extname, :ext
|
||||
|
||||
FORWARD_SLASH = "/".freeze
|
||||
|
||||
# Attributes for Liquid templates
|
||||
ATTRIBUTES_FOR_LIQUID = %w(
|
||||
content
|
||||
@@ -62,11 +64,11 @@ module Jekyll
|
||||
#
|
||||
# Returns the String destination directory.
|
||||
def dir
|
||||
if url.end_with?("/")
|
||||
if url.end_with?(FORWARD_SLASH)
|
||||
url
|
||||
else
|
||||
url_dir = File.dirname(url)
|
||||
url_dir.end_with?("/") ? url_dir : "#{url_dir}/"
|
||||
url_dir.end_with?(FORWARD_SLASH) ? url_dir : "#{url_dir}/"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -54,16 +54,14 @@ module Jekyll
|
||||
def read_data_file(path)
|
||||
case File.extname(path).downcase
|
||||
when ".csv"
|
||||
CSV.read(path, {
|
||||
CSV.read(path,
|
||||
:headers => true,
|
||||
:encoding => site.config["encoding"],
|
||||
}).map(&:to_hash)
|
||||
:encoding => site.config["encoding"]).map(&:to_hash)
|
||||
when ".tsv"
|
||||
CSV.read(path, {
|
||||
CSV.read(path,
|
||||
:col_sep => "\t",
|
||||
:headers => true,
|
||||
:encoding => site.config["encoding"],
|
||||
}).map(&:to_hash)
|
||||
:encoding => site.config["encoding"]).map(&:to_hash)
|
||||
else
|
||||
SafeYAML.load_file(path)
|
||||
end
|
||||
|
||||
@@ -314,15 +314,15 @@ module Jekyll
|
||||
#
|
||||
# Returns an Array of Documents which should be written
|
||||
def docs_to_write
|
||||
@docs_to_write ||= documents.select(&:write?)
|
||||
documents.select(&:write?)
|
||||
end
|
||||
|
||||
# Get all the documents
|
||||
#
|
||||
# Returns an Array of all Documents
|
||||
def documents
|
||||
collections.reduce(Set.new) do |docs, (_, collection)|
|
||||
docs + collection.docs + collection.files
|
||||
collections.each_with_object(Set.new) do |(_, collection), set|
|
||||
set.merge(collection.docs).merge(collection.files)
|
||||
end.to_a
|
||||
end
|
||||
|
||||
|
||||
@@ -112,8 +112,7 @@ MSG
|
||||
end
|
||||
|
||||
def render_rouge(code)
|
||||
require "rouge"
|
||||
formatter = ::Rouge::Formatters::HTMLLegacy.new(
|
||||
formatter = Jekyll::Utils::Rouge.html_formatter(
|
||||
:line_numbers => @highlight_options[:linenos],
|
||||
:wrap => false,
|
||||
:css_class => "highlight",
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
module Jekyll
|
||||
module Tags
|
||||
class IncludeTagError < StandardError
|
||||
attr_accessor :path
|
||||
|
||||
def initialize(msg, path)
|
||||
super(msg)
|
||||
@path = path
|
||||
end
|
||||
end
|
||||
|
||||
class IncludeTag < Liquid::Tag
|
||||
VALID_SYNTAX = %r!
|
||||
([\w-]+)\s*=\s*
|
||||
@@ -13,7 +22,7 @@ module Jekyll
|
||||
!mx
|
||||
|
||||
FULL_VALID_SYNTAX = %r!\A\s*(?:#{VALID_SYNTAX}(?=\s|\z)\s*)*\z!
|
||||
VALID_FILENAME_CHARS = %r!^[\w/\.-]+$!
|
||||
VALID_FILENAME_CHARS = %r!^[\w/.\-()+~\#@]+$!
|
||||
INVALID_SEQUENCES = %r![./]{2,}!
|
||||
|
||||
def initialize(tag_name, markup, tokens)
|
||||
@@ -138,12 +147,17 @@ MSG
|
||||
end
|
||||
|
||||
def add_include_to_dependency(site, path, context)
|
||||
if context.registers[:page] && context.registers[:page].key?("path")
|
||||
site.regenerator.add_dependency(
|
||||
site.in_source_dir(context.registers[:page]["path"]),
|
||||
path
|
||||
)
|
||||
end
|
||||
page = context.registers[:page]
|
||||
return unless page
|
||||
return unless page.key?("path")
|
||||
|
||||
absolute_path = \
|
||||
if page["collection"]
|
||||
site.in_source_dir(site.config["collections_dir"], page["path"])
|
||||
else
|
||||
site.in_source_dir(page["path"])
|
||||
end
|
||||
site.regenerator.add_dependency(absolute_path, path)
|
||||
end
|
||||
|
||||
def load_cached_partial(path, context)
|
||||
@@ -182,7 +196,7 @@ MSG
|
||||
|
||||
# This method allows to modify the file content by inheriting from the class.
|
||||
def read_file(file, context)
|
||||
File.read(file, file_read_opts(context))
|
||||
File.read(file, **file_read_opts(context))
|
||||
end
|
||||
|
||||
private
|
||||
@@ -215,6 +229,7 @@ MSG
|
||||
else
|
||||
File.join(site.config["collections_dir"], page_payload["path"])
|
||||
end
|
||||
resource_path.sub!(%r!/#excerpt\z!, "")
|
||||
site.in_source_dir File.dirname(resource_path)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,17 +18,14 @@ module Jekyll
|
||||
def render(context)
|
||||
site = context.registers[:site]
|
||||
|
||||
liquid = site.liquid_renderer.file("(jekyll:link)")
|
||||
relative_path = liquid.parse(@relative_path).render(context)
|
||||
|
||||
site.each_site_file do |item|
|
||||
return item.url if item.relative_path == relative_path
|
||||
return item.url if item.relative_path == @relative_path
|
||||
# This takes care of the case for static files that have a leading /
|
||||
return item.url if item.relative_path == "/#{relative_path}"
|
||||
return item.url if item.relative_path == "/#{@relative_path}"
|
||||
end
|
||||
|
||||
raise ArgumentError, <<-MSG
|
||||
Could not find document '#{relative_path}' in tag '#{self.class.tag_name}'.
|
||||
Could not find document '#{@relative_path}' in tag '#{self.class.tag_name}'.
|
||||
|
||||
Make sure the document exists and the path is correct.
|
||||
MSG
|
||||
|
||||
@@ -56,12 +56,28 @@ module Jekyll
|
||||
end
|
||||
|
||||
def realpath_for(folder)
|
||||
File.realpath(Jekyll.sanitized_path(root, folder.to_s))
|
||||
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
|
||||
Jekyll.logger.warn "Invalid theme folder:", folder
|
||||
# This resolves all symlinks for the theme subfolder and then ensures
|
||||
# that the directory remains inside the theme root. This prevents the
|
||||
# use of symlinks for theme subfolders to escape the theme root.
|
||||
# However, symlinks are allowed to point to other directories within the theme.
|
||||
Jekyll.sanitized_path(root, File.realpath(Jekyll.sanitized_path(root, folder.to_s)))
|
||||
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP => e
|
||||
log_realpath_exception(e, folder)
|
||||
nil
|
||||
end
|
||||
|
||||
def log_realpath_exception(err, folder)
|
||||
return if err.is_a?(Errno::ENOENT)
|
||||
|
||||
case err
|
||||
when Errno::EACCES
|
||||
Jekyll.logger.error "Theme error:", "Directory '#{folder}' is not accessible."
|
||||
when Errno::ELOOP
|
||||
Jekyll.logger.error "Theme error:",
|
||||
"Directory '#{folder}' includes a symbolic link loop."
|
||||
end
|
||||
end
|
||||
|
||||
def gemspec
|
||||
@gemspec ||= Gem::Specification.find_by_name(name)
|
||||
rescue Gem::LoadError
|
||||
|
||||
@@ -7,6 +7,7 @@ module Jekyll
|
||||
autoload :Exec, "jekyll/utils/exec"
|
||||
autoload :Internet, "jekyll/utils/internet"
|
||||
autoload :Platforms, "jekyll/utils/platforms"
|
||||
autoload :Rouge, "jekyll/utils/rouge"
|
||||
autoload :ThreadEvent, "jekyll/utils/thread_event"
|
||||
autoload :WinTZ, "jekyll/utils/win_tz"
|
||||
|
||||
|
||||
@@ -70,9 +70,9 @@ module Jekyll
|
||||
private
|
||||
def proc_version
|
||||
@proc_version ||= begin
|
||||
Pathutil.new(
|
||||
File.read(
|
||||
"/proc/version"
|
||||
).read
|
||||
).downcase
|
||||
rescue Errno::ENOENT
|
||||
nil
|
||||
end
|
||||
|
||||
22
lib/jekyll/utils/rouge.rb
Normal file
22
lib/jekyll/utils/rouge.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Jekyll::External.require_with_graceful_fail("rouge")
|
||||
|
||||
module Jekyll
|
||||
module Utils
|
||||
module Rouge
|
||||
|
||||
def self.html_formatter(*args)
|
||||
if old_api?
|
||||
::Rouge::Formatters::HTML.new(*args)
|
||||
else
|
||||
::Rouge::Formatters::HTMLLegacy.new(*args)
|
||||
end
|
||||
end
|
||||
|
||||
def self.old_api?
|
||||
::Rouge.version.to_s < "2"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -11,64 +11,35 @@ module Jekyll
|
||||
# timezone - the IANA Time Zone specified in "_config.yml"
|
||||
#
|
||||
# Returns a string that ultimately re-defines ENV["TZ"] in Windows
|
||||
def calculate(timezone)
|
||||
def calculate(timezone, now = Time.now)
|
||||
External.require_with_graceful_fail("tzinfo") unless defined?(TZInfo)
|
||||
tz = TZInfo::Timezone.get(timezone)
|
||||
difference = Time.now.to_i - tz.now.to_i
|
||||
|
||||
#
|
||||
# Use period_for_utc and utc_total_offset instead of
|
||||
# period_for and observed_utc_offset for compatibility with tzinfo v1.
|
||||
offset = tz.period_for_utc(now.getutc).utc_total_offset
|
||||
|
||||
#
|
||||
# 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"
|
||||
# Reference: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
|
||||
sign = offset.positive? ? "-" : "+"
|
||||
|
||||
Jekyll.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}"
|
||||
rational_hours = offset.abs.to_r / 3600
|
||||
hours = rational_hours.to_i
|
||||
minutes = ((rational_hours - hours) * 60).to_i
|
||||
|
||||
#
|
||||
# Format the hours and minutes as two-digit numbers.
|
||||
time = format("%<hours>02d:%<minutes>02d", :hours => hours, :minutes => minutes)
|
||||
|
||||
Jekyll.logger.debug "Timezone:", "#{timezone} #{sign}#{time}"
|
||||
#
|
||||
# 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
|
||||
"WTZ#{sign}#{time}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Jekyll
|
||||
VERSION = "3.8.1".freeze
|
||||
VERSION = "3.9.3".freeze
|
||||
end
|
||||
|
||||
1
lib/site_template/.gitignore
vendored
1
lib/site_template/.gitignore
vendored
@@ -1,4 +1,3 @@
|
||||
_site
|
||||
.sass-cache
|
||||
.jekyll-metadata
|
||||
vendor
|
||||
|
||||
25
rake/docs.rake
Normal file
25
rake/docs.rake
Normal file
@@ -0,0 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
#############################################################################
|
||||
#
|
||||
# Packaging tasks for jekyll-docs
|
||||
#
|
||||
#############################################################################
|
||||
|
||||
namespace :docs do
|
||||
desc "Release #{docs_name} v#{version}"
|
||||
task :release => :build do
|
||||
unless `git branch` =~ %r!^\* master$!
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
sh "gem push pkg/#{docs_name}-#{version}.gem"
|
||||
end
|
||||
|
||||
desc "Build #{docs_name} v#{version} into pkg/"
|
||||
task :build do
|
||||
mkdir_p "pkg"
|
||||
sh "gem build #{docs_name}.gemspec"
|
||||
sh "mv #{docs_name}-#{version}.gem pkg"
|
||||
end
|
||||
end
|
||||
@@ -13,6 +13,15 @@ pushd tmp/default-site
|
||||
|
||||
echo "$0: respecifying the jekyll install location"
|
||||
ruby -e "contents = File.read('Gemfile'); File.write('Gemfile', contents.sub(/gem \"jekyll\".*\\n/, 'gem \"jekyll\", path: \"../../\"'))"
|
||||
if [ -n "$KRAMDOWN_VERSION" ]; then
|
||||
echo "$0: respecifying the kramdown version"
|
||||
ruby -e "contents = File.read('Gemfile'); File.write('Gemfile', contents.sub(/gem \"kramdown-parser-gfm\".*\\n/, ''))"
|
||||
echo "gem 'kramdown', '~> $KRAMDOWN_VERSION'" >> Gemfile
|
||||
fi
|
||||
if [ -n "$ROUGE_VERSION" ]; then
|
||||
echo "$0: respecifying the rouge version"
|
||||
echo "gem 'rouge', '~> $ROUGE_VERSION'" >> Gemfile
|
||||
fi
|
||||
echo "$0: installing default site dependencies"
|
||||
BUNDLE_GEMFILE=Gemfile bundle install
|
||||
echo "$0: building the default site"
|
||||
|
||||
10
script/profile-docs
Executable file
10
script/profile-docs
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build Jekyll's Documentation site in 'debug' mode and outputs the site's profile stats.
|
||||
# Helps detecting *hard* breaking-changes (`jekyll build` aborts) and optimizations
|
||||
# in the `build` process.
|
||||
#
|
||||
# Usage: bash script/profile-docs
|
||||
|
||||
SOURCE_DIR=$PWD/docs
|
||||
bundle exec jekyll build -s $SOURCE_DIR -d $SOURCE_DIR/_site --profile --trace --verbose
|
||||
@@ -2,16 +2,41 @@
|
||||
# Vendors the MIME type config from the mime-db list
|
||||
# usage: script/vendor-mimes
|
||||
|
||||
require 'colorator'
|
||||
require 'json'
|
||||
require 'open-uri'
|
||||
|
||||
config = File.expand_path "../lib/jekyll/mime.types", __dir__
|
||||
# ---- Helpers ----
|
||||
|
||||
# Create an array of vendored mimetype => [extensions]
|
||||
mimes = {}
|
||||
json = open('https://raw.githubusercontent.com/jshttp/mime-db/master/db.json').read
|
||||
{
|
||||
:info => :cyan,
|
||||
:success => :green,
|
||||
:error => :red,
|
||||
}.each do |type, color|
|
||||
define_method("log_#{type}") do |msg|
|
||||
puts " #{msg}".send(color)
|
||||
end
|
||||
end
|
||||
|
||||
# ----
|
||||
|
||||
json = begin
|
||||
log_info "Reading remote data.."
|
||||
URI.open("https://raw.githubusercontent.com/jshttp/mime-db/master/db.json").read
|
||||
rescue StandardError => e
|
||||
log_error "Error reading remote data!"
|
||||
log_error e.message
|
||||
log_error "Aborting."
|
||||
exit 1
|
||||
end
|
||||
|
||||
log_info "Parsing remote data.."
|
||||
data = JSON.parse(json)
|
||||
data.reject! { |mime, meta| meta["extensions"].nil? || meta["extensions"].empty? }
|
||||
|
||||
log_info "Generating interim mime data-hashes.."
|
||||
mimes = {}
|
||||
charset_data = {}
|
||||
data.each do |mime, meta|
|
||||
# Normalize extensions and mime-types
|
||||
mime = mime.downcase.strip
|
||||
@@ -23,8 +48,15 @@ data.each do |mime, meta|
|
||||
next if extensions.empty?
|
||||
mimes[mime] = [] if mimes[mime].nil?
|
||||
mimes[mime].concat extensions
|
||||
|
||||
# Extract mime-types with "charset" metadata
|
||||
charset_data[mime] = meta["charset"] if meta.key?("charset")
|
||||
|
||||
# Assign `UTF-8` charset for mime-types under the `text` domain if not already assigned upstream
|
||||
charset_data[mime] ||= "UTF-8" if mime.start_with?("text/")
|
||||
end
|
||||
|
||||
log_info "Formatting primary hash and writing to file.."
|
||||
strlen = mimes.keys.max_by(&:length).length
|
||||
output = ""
|
||||
output << "# Woah there. Do not edit this file directly.\n"
|
||||
@@ -32,4 +64,14 @@ output << "# This file is generated automatically by script/vendor-mimes.\n\n"
|
||||
mimes = mimes.sort_by { |k,v| k }
|
||||
output << mimes.map { |mime,extensions| "#{mime.ljust(strlen)} #{extensions.join(" ")}" }.join("\n")
|
||||
|
||||
config = File.expand_path "../lib/jekyll/mime.types", __dir__
|
||||
File.write(config, output)
|
||||
log_info "Done! See: #{config.inspect.white}"
|
||||
|
||||
# --- Generate JSON file from charset_data ----
|
||||
puts
|
||||
|
||||
log_info "Dumping mimetype-charset mapping as JSON.."
|
||||
json_file = File.expand_path "../lib/jekyll/commands/serve/mime_types_charset.json", __dir__
|
||||
File.write(json_file, JSON.pretty_generate(charset_data) + "\n")
|
||||
log_success "and done! See: #{json_file.inspect.white}"
|
||||
|
||||
11
test/fixtures/test-theme-skinny/_layouts/default.html
vendored
Normal file
11
test/fixtures/test-theme-skinny/_layouts/default.html
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Skinny</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World</h1>
|
||||
{{ content }}
|
||||
</body>
|
||||
</html>
|
||||
5
test/fixtures/test-theme-skinny/_layouts/home.html
vendored
Normal file
5
test/fixtures/test-theme-skinny/_layouts/home.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
Message: {{ content }}
|
||||
11
test/fixtures/test-theme-skinny/test-theme-skinny.gemspec
vendored
Normal file
11
test/fixtures/test-theme-skinny/test-theme-skinny.gemspec
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "test-theme-skinny"
|
||||
s.version = "0.1.0"
|
||||
s.licenses = ["MIT"]
|
||||
s.summary = "This is a theme with just layouts used to test Jekyll"
|
||||
s.authors = ["Jekyll"]
|
||||
s.files = ["lib/example.rb"]
|
||||
s.homepage = "https://github.com/jekyll/jekyll"
|
||||
end
|
||||
11
test/fixtures/test-theme-symlink/test-theme-symlink.gemspec
vendored
Normal file
11
test/fixtures/test-theme-symlink/test-theme-symlink.gemspec
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "test-theme-symlink"
|
||||
s.version = "0.1.0"
|
||||
s.licenses = ["MIT"]
|
||||
s.summary = "This is a theme with a symlink used to test Jekyll"
|
||||
s.authors = ["Jekyll"]
|
||||
s.files = ["lib/example.rb"]
|
||||
s.homepage = "https://github.com/jekyll/jekyll"
|
||||
end
|
||||
@@ -36,6 +36,7 @@ Jekyll.logger = Logger.new(StringIO.new, :error)
|
||||
|
||||
unless jruby?
|
||||
require "rdiscount"
|
||||
require "redcarpet"
|
||||
end
|
||||
|
||||
require "kramdown"
|
||||
@@ -194,6 +195,15 @@ class JekyllUnitTest < Minitest::Test
|
||||
skip msg.to_s.magenta
|
||||
end
|
||||
end
|
||||
|
||||
def symlink_if_allowed(target, sym_file)
|
||||
FileUtils.ln_sf(target, sym_file)
|
||||
rescue Errno::EACCES
|
||||
skip "Permission denied for creating a symlink to #{target.inspect} " \
|
||||
"on this machine".magenta
|
||||
rescue NotImplementedError => error
|
||||
skip error.to_s.magenta
|
||||
end
|
||||
end
|
||||
|
||||
class FakeLogger
|
||||
@@ -201,7 +211,6 @@ class FakeLogger
|
||||
end
|
||||
|
||||
module TestWEBrick
|
||||
|
||||
module_function
|
||||
|
||||
def mount_server(&block)
|
||||
@@ -230,6 +239,7 @@ module TestWEBrick
|
||||
:ServerType => Thread,
|
||||
:Logger => WEBrick::Log.new(logger),
|
||||
:AccessLog => [[logger, ""]],
|
||||
:MimeTypesCharset => Jekyll::Commands::Serve.send(:mime_types_charset),
|
||||
:JekyllOptions => {},
|
||||
}
|
||||
end
|
||||
|
||||
7
test/source/_includes/params@2.0.html
Normal file
7
test/source/_includes/params@2.0.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<span id='include-param'>{{include.param}}</span>
|
||||
|
||||
<ul id='param-list'>
|
||||
{% for param in include %}
|
||||
<li>{{param[0]}} = {{param[1]}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
14
test/source/_plugins/custom_block.rb
Normal file
14
test/source/_plugins/custom_block.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# For testing excerpt handling of custom tags
|
||||
|
||||
module Jekyll
|
||||
class DoNothingBlock < Liquid::Block
|
||||
end
|
||||
|
||||
class DoNothingOther < Liquid::Tag
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag("do_nothing", Jekyll::DoNothingBlock)
|
||||
Liquid::Template.register_tag("do_nothing_other", Jekyll::DoNothingOther)
|
||||
@@ -2,10 +2,23 @@
|
||||
layout: post
|
||||
---
|
||||
|
||||
{% if
|
||||
page.layout == "post" %}
|
||||
You’ll find this post in your `_posts` directory.
|
||||
To add new posts, simply add a file in the `_posts` directory.
|
||||
{% endif %}
|
||||
{%
|
||||
highlight
|
||||
ruby
|
||||
%}
|
||||
{% assign foo = 'foobar' %}
|
||||
{% raw
|
||||
%}
|
||||
def print_hi(name)
|
||||
puts "Hi, #{name}"
|
||||
end
|
||||
print_hi('Tom')
|
||||
#=> prints 'Hi, Tom' to STDOUT.
|
||||
{%
|
||||
endraw
|
||||
%}
|
||||
{%
|
||||
endhighlight
|
||||
%}
|
||||
|
||||
So let's talk business.
|
||||
|
||||
@@ -2,10 +2,20 @@
|
||||
layout: post
|
||||
---
|
||||
|
||||
{% if page.layout == "post" %}
|
||||
You’ll find this post in your `_posts` directory.
|
||||
{%
|
||||
highlight
|
||||
ruby
|
||||
%}
|
||||
{% assign foo = 'foobar' %}
|
||||
{% raw
|
||||
%}
|
||||
def print_hi(name)
|
||||
puts "Hi, #{name}"
|
||||
end
|
||||
|
||||
{% else %}
|
||||
print_hi('Tom')
|
||||
#=> prints 'Hi, Tom' to STDOUT.
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
To add new posts, simply add a file in the `_posts` directory.
|
||||
{% endif %}
|
||||
So let's talk business.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: LIQUID_TAG_REGEX excerpt whitespace control test
|
||||
layout: post
|
||||
---
|
||||
|
||||
{%- for post in site.posts -%}
|
||||
You are in a maze of twisty little passages, all alike.
|
||||
There's lots more to say about this, but that's enough for now.
|
||||
{%- endfor -%}
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: LIQUID_TAG_REGEX excerpt whitespace control test
|
||||
layout: post
|
||||
---
|
||||
|
||||
{%- assign xyzzy = 'You are in a maze of twisty little passages, all alike.' %}
|
||||
{{- xyzzy -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: LIQUID_TAG_REGEX excerpt whitespace control test
|
||||
layout: post
|
||||
---
|
||||
|
||||
{%- for post in site.posts -%}
|
||||
You are in a maze of twisty little passages, all alike.
|
||||
|
||||
There's lots more to say about this, but that's enough for now.
|
||||
{%- endfor -%}
|
||||
29
test/source/_posts/2018-11-15-excerpt-liquid-block.md
Normal file
29
test/source/_posts/2018-11-15-excerpt-liquid-block.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: liquid_block excerpt test with open tags in excerpt
|
||||
layout: post
|
||||
---
|
||||
|
||||
{% assign company = "Yoyodyne" %}
|
||||
{% do_nothing_other %}
|
||||
{% do_nothing %}
|
||||
{% unless false %}
|
||||
{% for i in (1..10) %}
|
||||
{% if true %}
|
||||
{% raw %}
|
||||
EVIL! PURE AND SIMPLE FROM THE EIGHTH DIMENSION!
|
||||
{% endraw %}
|
||||
{% elsif false %}
|
||||
No matter where you go, there you are.
|
||||
{% break %}
|
||||
{% else %}
|
||||
{% case company %}
|
||||
{% when "Yoyodyne" %}
|
||||
Buckaroo Banzai
|
||||
{% else %}
|
||||
{% continue %}
|
||||
|
||||
{% endcase %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endunless %}
|
||||
{% enddo_nothing %}
|
||||
1
test/source/symlink-test/symlinked-file-outside-source
Symbolic link
1
test/source/symlink-test/symlinked-file-outside-source
Symbolic link
@@ -0,0 +1 @@
|
||||
/etc/passwd
|
||||
@@ -5,7 +5,6 @@ require "mercenary"
|
||||
require "helper"
|
||||
require "httpclient"
|
||||
require "openssl"
|
||||
require "thread"
|
||||
require "tmpdir"
|
||||
|
||||
class TestCommandsServe < JekyllUnitTest
|
||||
@@ -44,6 +43,8 @@ class TestCommandsServe < JekyllUnitTest
|
||||
|
||||
context "using LiveReload" do
|
||||
setup do
|
||||
skip_if_windows "EventMachine support on Windows is limited"
|
||||
|
||||
@temp_dir = Dir.mktmpdir("jekyll_livereload_test")
|
||||
@destination = File.join(@temp_dir, "_site")
|
||||
Dir.mkdir(@destination) || flunk("Could not make directory #{@destination}")
|
||||
@@ -94,7 +95,6 @@ class TestCommandsServe < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "serve livereload.js over HTTP on the default LiveReload port" do
|
||||
skip_if_windows "EventMachine support on Windows is limited"
|
||||
opts = serve(@standard_options)
|
||||
content = @client.get_content(
|
||||
"http://#{opts["host"]}:#{opts["livereload_port"]}/livereload.js"
|
||||
@@ -103,7 +103,6 @@ class TestCommandsServe < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "serve nothing else over HTTP on the default LiveReload port" do
|
||||
skip_if_windows "EventMachine support on Windows is limited"
|
||||
opts = serve(@standard_options)
|
||||
res = @client.get("http://#{opts["host"]}:#{opts["livereload_port"]}/")
|
||||
assert_equal(400, res.status_code)
|
||||
@@ -111,7 +110,6 @@ class TestCommandsServe < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "insert the LiveReload script tags" do
|
||||
skip_if_windows "EventMachine support on Windows is limited"
|
||||
opts = serve(@standard_options)
|
||||
content = @client.get_content(
|
||||
"http://#{opts["host"]}:#{opts["port"]}/#{opts["baseurl"]}/hello.html"
|
||||
@@ -124,7 +122,6 @@ class TestCommandsServe < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "apply the max and min delay options" do
|
||||
skip_if_windows "EventMachine support on Windows is limited"
|
||||
opts = serve(@standard_options.merge(
|
||||
"livereload_max_delay" => "1066",
|
||||
"livereload_min_delay" => "3"
|
||||
@@ -155,9 +152,7 @@ class TestCommandsServe < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "label itself" do
|
||||
assert_equal(
|
||||
@merc.name, :serve
|
||||
)
|
||||
assert_equal :serve, @merc.name
|
||||
end
|
||||
|
||||
should "have aliases" do
|
||||
@@ -191,21 +186,21 @@ class TestCommandsServe < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "use user destinations" do
|
||||
assert_equal "foo", custom_opts({ "destination" => "foo" })[
|
||||
assert_equal "foo", custom_opts("destination" => "foo")[
|
||||
:DocumentRoot
|
||||
]
|
||||
end
|
||||
|
||||
should "use user port" do
|
||||
# WHAT?!?!1 Over 9000? That's impossible.
|
||||
assert_equal 9001, custom_opts({ "port" => 9001 })[
|
||||
assert_equal 9001, custom_opts("port" => 9001)[
|
||||
:Port
|
||||
]
|
||||
end
|
||||
|
||||
should "use empty directory index list when show_dir_listing is true" do
|
||||
opts = { "show_dir_listing" => true }
|
||||
assert custom_opts(opts)[:DirectoryIndex].empty?
|
||||
assert_empty custom_opts(opts)[:DirectoryIndex]
|
||||
end
|
||||
|
||||
should "keep config between build and serve" do
|
||||
@@ -237,21 +232,21 @@ class TestCommandsServe < JekyllUnitTest
|
||||
expect(Jekyll::Commands::Serve).to receive(:start_up_webrick)
|
||||
end
|
||||
should "set the site url by default to `http://localhost:4000`" do
|
||||
@merc.execute(:serve, { "watch" => false, "url" => "https://jekyllrb.com/" })
|
||||
@merc.execute(:serve, "watch" => false, "url" => "https://jekyllrb.com/")
|
||||
|
||||
assert_equal 1, Jekyll.sites.count
|
||||
assert_equal "http://localhost:4000", Jekyll.sites.first.config["url"]
|
||||
end
|
||||
|
||||
should "take `host`, `port` and `ssl` into consideration if set" do
|
||||
@merc.execute(:serve, {
|
||||
@merc.execute(:serve,
|
||||
"watch" => false,
|
||||
"host" => "example.com",
|
||||
"port" => "9999",
|
||||
"url" => "https://jekyllrb.com/",
|
||||
"ssl_cert" => "foo",
|
||||
"ssl_key" => "bar",
|
||||
})
|
||||
"ssl_key" => "bar"
|
||||
)
|
||||
|
||||
assert_equal 1, Jekyll.sites.count
|
||||
assert_equal "https://example.com:9999", Jekyll.sites.first.config["url"]
|
||||
@@ -262,7 +257,7 @@ class TestCommandsServe < JekyllUnitTest
|
||||
should "not update the site url" do
|
||||
expect(Jekyll).to receive(:env).and_return("production")
|
||||
expect(Jekyll::Commands::Serve).to receive(:start_up_webrick)
|
||||
@merc.execute(:serve, { "watch" => false, "url" => "https://jekyllrb.com/" })
|
||||
@merc.execute(:serve, "watch" => false, "url" => "https://jekyllrb.com/")
|
||||
|
||||
assert_equal 1, Jekyll.sites.count
|
||||
assert_equal "https://jekyllrb.com/", Jekyll.sites.first.config["url"]
|
||||
@@ -271,26 +266,26 @@ class TestCommandsServe < JekyllUnitTest
|
||||
|
||||
context "verbose" do
|
||||
should "debug when verbose" do
|
||||
assert_equal custom_opts({ "verbose" => true })[:Logger].level, 5
|
||||
assert_equal 5, custom_opts("verbose" => true)[:Logger].level
|
||||
end
|
||||
|
||||
should "warn when not verbose" do
|
||||
assert_equal custom_opts({})[:Logger].level, 3
|
||||
assert_equal 3, custom_opts({})[:Logger].level
|
||||
end
|
||||
end
|
||||
|
||||
context "enabling SSL" do
|
||||
should "raise if enabling without key or cert" do
|
||||
assert_raises RuntimeError do
|
||||
custom_opts({
|
||||
"ssl_key" => "foo",
|
||||
})
|
||||
custom_opts(
|
||||
"ssl_key" => "foo"
|
||||
)
|
||||
end
|
||||
|
||||
assert_raises RuntimeError do
|
||||
custom_opts({
|
||||
"ssl_key" => "foo",
|
||||
})
|
||||
custom_opts(
|
||||
"ssl_key" => "foo"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -299,16 +294,16 @@ class TestCommandsServe < JekyllUnitTest
|
||||
expect(OpenSSL::X509::Certificate).to receive(:new).and_return("c1")
|
||||
allow(File).to receive(:read).and_return("foo")
|
||||
|
||||
result = custom_opts({
|
||||
result = custom_opts(
|
||||
"ssl_cert" => "foo",
|
||||
"source" => "bar",
|
||||
"enable_ssl" => true,
|
||||
"ssl_key" => "bar",
|
||||
})
|
||||
"ssl_key" => "bar"
|
||||
)
|
||||
|
||||
assert result[:SSLEnable]
|
||||
assert_equal result[:SSLPrivateKey], "c2"
|
||||
assert_equal result[:SSLCertificate], "c1"
|
||||
assert_equal "c2", result[:SSLPrivateKey]
|
||||
assert_equal "c1", result[:SSLCertificate]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -317,7 +312,7 @@ class TestCommandsServe < JekyllUnitTest
|
||||
allow(Jekyll::Commands::Serve).to receive(:start_up_webrick)
|
||||
|
||||
expect(Jekyll).to receive(:configuration).once.and_call_original
|
||||
@merc.execute(:serve, { "watch" => false })
|
||||
@merc.execute(:serve, "watch" => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ require "helper"
|
||||
class TestEntryFilter < JekyllUnitTest
|
||||
context "Filtering entries" do
|
||||
setup do
|
||||
@site = Site.new(site_configuration)
|
||||
@site = fixture_site
|
||||
end
|
||||
|
||||
should "filter entries" do
|
||||
@@ -87,7 +87,7 @@ class TestEntryFilter < JekyllUnitTest
|
||||
# no support for symlinks on Windows
|
||||
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||
|
||||
site = Site.new(site_configuration("safe" => true))
|
||||
site = fixture_site("safe" => true)
|
||||
site.reader.read_directories("symlink-test")
|
||||
|
||||
assert_equal %w(main.scss symlinked-file).length, site.pages.length
|
||||
@@ -99,11 +99,22 @@ class TestEntryFilter < JekyllUnitTest
|
||||
# no support for symlinks on Windows
|
||||
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||
|
||||
site = Site.new(site_configuration)
|
||||
@site.reader.read_directories("symlink-test")
|
||||
refute_equal [], @site.pages
|
||||
refute_equal [], @site.static_files
|
||||
end
|
||||
|
||||
should "include only safe symlinks in safe mode even when included" do
|
||||
# no support for symlinks on Windows
|
||||
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||
|
||||
site = fixture_site("safe" => true, "include" => ["symlinked-file-outside-source"])
|
||||
site.reader.read_directories("symlink-test")
|
||||
refute_equal [], site.pages
|
||||
refute_equal [], site.static_files
|
||||
|
||||
# rubocop:disable Performance/FixedSize
|
||||
assert_equal %w(main.scss symlinked-file).length, site.pages.length
|
||||
refute_includes site.static_files.map(&:name), "symlinked-file-outside-source"
|
||||
# rubocop:enable Performance/FixedSize
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -185,12 +185,17 @@ class TestExcerpt < JekyllUnitTest
|
||||
@post = setup_post("2018-01-28-open-liquid-block-excerpt.markdown")
|
||||
@excerpt = @post.data["excerpt"]
|
||||
|
||||
assert_includes @post.content, "{% if"
|
||||
refute_includes @post.content.split("\n\n")[0], "{% endif %}"
|
||||
head = @post.content.split("\n\n")[0]
|
||||
|
||||
assert_includes @post.content, "{%\n highlight\n"
|
||||
assert_includes @post.content, "{% raw"
|
||||
refute_includes head, "{% endraw %}"
|
||||
refute_includes head, "{% endhighlight %}"
|
||||
end
|
||||
|
||||
should "be appended to as necessary and generated" do
|
||||
assert_includes @excerpt.content, "{% endif %}"
|
||||
assert_includes @excerpt.content, "{% endraw %}"
|
||||
assert_includes @excerpt.content, "{% endhighlight %}"
|
||||
assert_equal true, @excerpt.is_a?(Jekyll::Excerpt)
|
||||
end
|
||||
end
|
||||
@@ -202,13 +207,96 @@ class TestExcerpt < JekyllUnitTest
|
||||
@post = setup_post("2018-01-28-closed-liquid-block-excerpt.markdown")
|
||||
@excerpt = @post.data["excerpt"]
|
||||
|
||||
assert_includes @post.content, "{% if"
|
||||
assert_includes @post.content.split("\n\n")[0], "{% endif %}"
|
||||
head = @post.content.split("\n\n")[0]
|
||||
|
||||
assert_includes @post.content, "{%\n highlight\n"
|
||||
assert_includes @post.content, "{% raw"
|
||||
assert_includes head, "{%\n endraw\n%}"
|
||||
assert_includes head, "{%\n endhighlight\n%}"
|
||||
end
|
||||
|
||||
should "not be appended to but generated as is" do
|
||||
assert_includes @excerpt.content, "{%\n endraw\n%}"
|
||||
assert_includes @excerpt.content, "{%\n endhighlight\n%}"
|
||||
refute_includes @excerpt.content, "{%\n endraw\n%}\n\n{% endraw %}"
|
||||
refute_includes @excerpt.content, "{%\n endhighlight\n%}\n\n{% endhighlight %}"
|
||||
assert_equal true, @excerpt.is_a?(Jekyll::Excerpt)
|
||||
end
|
||||
end
|
||||
|
||||
context "An excerpt with non-closed but valid Liquid block tag with whitespace control" do
|
||||
setup do
|
||||
clear_dest
|
||||
@site = fixture_site
|
||||
@post = setup_post("2018-05-15-open-liquid-block-excerpt-whitespace-control.md")
|
||||
@excerpt = @post.data["excerpt"]
|
||||
|
||||
assert_includes @post.content, "{%- for"
|
||||
refute_includes @post.content.split("\n\n")[0], "{%- endfor -%}"
|
||||
end
|
||||
|
||||
should "be appended to as necessary and generated" do
|
||||
assert_includes @excerpt.content, "{% endfor %}"
|
||||
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
|
||||
assert_equal true, @excerpt.is_a?(Jekyll::Excerpt)
|
||||
end
|
||||
end
|
||||
|
||||
context "An excerpt with valid closed Liquid block tag with whitespace control" do
|
||||
setup do
|
||||
clear_dest
|
||||
@site = fixture_site
|
||||
@post = setup_post("2018-05-15-closed-liquid-block-excerpt-whitespace-control.md")
|
||||
@excerpt = @post.data["excerpt"]
|
||||
|
||||
assert_includes @post.content, "{%- for"
|
||||
assert_includes @post.content.split("\n\n")[0], "{%- endfor -%}"
|
||||
end
|
||||
|
||||
should "not be appended to but generated as is" do
|
||||
assert_includes @excerpt.content, "{%- endfor -%}"
|
||||
refute_includes @excerpt.content, "{% endfor %}\n\n{% endfor %}"
|
||||
assert_equal true, @excerpt.is_a?(Jekyll::Excerpt)
|
||||
end
|
||||
end
|
||||
|
||||
context "An excerpt with valid Liquid variable with whitespace control" do
|
||||
setup do
|
||||
clear_dest
|
||||
@site = fixture_site
|
||||
@post = setup_post("2018-05-15-excerpt-whitespace-control-variable.md")
|
||||
@excerpt = @post.data["excerpt"]
|
||||
|
||||
assert_includes @post.content, "{%- assign"
|
||||
end
|
||||
|
||||
should "not be appended to but generated as is" do
|
||||
assert_includes @excerpt.content, "{{- xyzzy -}}"
|
||||
assert_equal true, @excerpt.is_a?(Jekyll::Excerpt)
|
||||
end
|
||||
end
|
||||
|
||||
context "An excerpt with Liquid tags" do
|
||||
setup do
|
||||
clear_dest
|
||||
@site = fixture_site
|
||||
@post = setup_post("2018-11-15-excerpt-liquid-block.md")
|
||||
@excerpt = @post.data["excerpt"]
|
||||
|
||||
assert_includes @post.content.split("\n\n")[0].strip, "{% continue %}"
|
||||
assert_equal true, Jekyll::DoNothingBlock.ancestors.include?(Liquid::Block)
|
||||
assert_equal false, Jekyll::DoNothingOther.ancestors.include?(Liquid::Block)
|
||||
assert_match "Jekyll::DoNothingBlock", Liquid::Template.tags["do_nothing"].name
|
||||
assert_match "Jekyll::DoNothingOther", Liquid::Template.tags["do_nothing_other"].name
|
||||
end
|
||||
|
||||
should "close open block tags, including custom tags, and ignore others" do
|
||||
assert_includes @excerpt.content, "{% endcase %}"
|
||||
assert_includes @excerpt.content, "{% endif %}"
|
||||
refute_includes @excerpt.content, "{% endif %}\n\n{% endif %}"
|
||||
assert_includes @excerpt.content, "{% endfor %}"
|
||||
assert_includes @excerpt.content, "{% endunless %}"
|
||||
assert_includes @excerpt.content, "{% enddo_nothing %}"
|
||||
refute_includes @excerpt.content, "{% enddo_nothing_other %}"
|
||||
assert_equal true, @excerpt.is_a?(Jekyll::Excerpt)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,12 +11,12 @@ class TestGeneratedSite < JekyllUnitTest
|
||||
@site.process
|
||||
@index = File.read(
|
||||
dest_dir("index.html"),
|
||||
Utils.merged_file_read_opts(@site, {})
|
||||
**Utils.merged_file_read_opts(@site, {})
|
||||
)
|
||||
end
|
||||
|
||||
should "ensure post count is as expected" do
|
||||
assert_equal 54, @site.posts.size
|
||||
assert_equal 58, @site.posts.size
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
|
||||
@@ -3,10 +3,17 @@
|
||||
require "helper"
|
||||
|
||||
class TestKramdown < JekyllUnitTest
|
||||
def fixture_converter(config)
|
||||
site_config = Utils.deep_merge_hashes({ "markdown" => "kramdown" }, config)
|
||||
site = fixture_site(site_config)
|
||||
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
|
||||
converter.setup
|
||||
converter
|
||||
end
|
||||
|
||||
context "kramdown" do
|
||||
setup do
|
||||
@config = {
|
||||
"markdown" => "kramdown",
|
||||
"kramdown" => {
|
||||
"smart_quotes" => "lsquo,rsquo,ldquo,rdquo",
|
||||
"entity_output" => "as_char",
|
||||
@@ -20,7 +27,7 @@ class TestKramdown < JekyllUnitTest
|
||||
"bold_every" => 8,
|
||||
"css" => :class,
|
||||
"css_class" => "highlight",
|
||||
"formatter" => ::Rouge::Formatters::HTMLLegacy,
|
||||
"formatter" => Jekyll::Utils::Rouge.html_formatter.class,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -29,12 +36,11 @@ class TestKramdown < JekyllUnitTest
|
||||
@config["kramdown"]["syntax_highlighter_opts"].keys
|
||||
|
||||
@config = Jekyll.configuration(@config)
|
||||
@markdown = Converters::Markdown.new(@config)
|
||||
@markdown.setup
|
||||
@converter = fixture_converter(@config)
|
||||
end
|
||||
|
||||
should "fill symbolized keys into config for compatibility with kramdown" do
|
||||
kramdown_config = @markdown.instance_variable_get(:@parser)
|
||||
kramdown_config = @converter.instance_variable_get(:@parser)
|
||||
.instance_variable_get(:@config)
|
||||
|
||||
@kramdown_config_keys.each do |key|
|
||||
@@ -54,20 +60,70 @@ class TestKramdown < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "run Kramdown" do
|
||||
assert_equal "<h1>Some Header</h1>", @markdown.convert("# Some Header #").strip
|
||||
assert_equal "<h1>Some Header</h1>", @converter.convert("# Some Header #").strip
|
||||
end
|
||||
|
||||
should "should log kramdown warnings" do
|
||||
allow_any_instance_of(Kramdown::Document).to receive(:warnings).and_return(["foo"])
|
||||
expect(Jekyll.logger).to receive(:warn).with("Kramdown warning:", "foo")
|
||||
@markdown.convert("Something")
|
||||
@converter.convert("Something")
|
||||
end
|
||||
|
||||
should "render fenced code blocks with syntax highlighting" do
|
||||
result = nokogiri_fragment(@converter.convert(<<~MARKDOWN))
|
||||
~~~ruby
|
||||
puts "Hello World"
|
||||
~~~
|
||||
MARKDOWN
|
||||
div_highlight = Rouge.version.to_i == 1 ? "" : ">div.highlight"
|
||||
selector = "div.highlighter-rouge#{div_highlight}>pre.highlight>code"
|
||||
refute(result.css(selector).empty?, result.to_html)
|
||||
end
|
||||
|
||||
context "when configured" do
|
||||
setup do
|
||||
@source = <<~TEXT
|
||||
## Code Sample
|
||||
|
||||
def ruby_fu
|
||||
"Hello"
|
||||
end
|
||||
TEXT
|
||||
end
|
||||
|
||||
should "have 'plaintext' as the default syntax_highlighter language" do
|
||||
converter = fixture_converter(@config)
|
||||
parser = converter.instance_variable_get(:@parser)
|
||||
parser_config = parser.instance_variable_get(:@config)
|
||||
|
||||
assert_equal "plaintext", parser_config.dig("syntax_highlighter_opts", "default_lang")
|
||||
end
|
||||
|
||||
should "accept the specified default syntax_highlighter language" do
|
||||
override = {
|
||||
"kramdown" => {
|
||||
"syntax_highlighter_opts" => {
|
||||
"default_lang" => "yaml",
|
||||
},
|
||||
},
|
||||
}
|
||||
converter = fixture_converter(Utils.deep_merge_hashes(@config, override))
|
||||
parser = converter.instance_variable_get(:@parser)
|
||||
parser_config = parser.instance_variable_get(:@config)
|
||||
|
||||
assert_equal "yaml", parser_config.dig("syntax_highlighter_opts", "default_lang")
|
||||
refute_match %r!<div class="language-plaintext!, converter.convert(@source)
|
||||
refute_match %r!<div class="language-html!, converter.convert(@source)
|
||||
assert_match %r!<div class="language-yaml!, converter.convert(@source)
|
||||
end
|
||||
end
|
||||
|
||||
context "when asked to convert smart quotes" do
|
||||
should "convert" do
|
||||
converter = fixture_converter(@config)
|
||||
assert_match(
|
||||
%r!<p>(“|“)Pit(’|’)hy(”|”)<\/p>!,
|
||||
@markdown.convert(%("Pit'hy")).strip
|
||||
converter.convert(%("Pit'hy")).strip
|
||||
)
|
||||
end
|
||||
|
||||
@@ -78,36 +134,23 @@ class TestKramdown < JekyllUnitTest
|
||||
"smart_quotes" => "lsaquo,rsaquo,laquo,raquo",
|
||||
},
|
||||
}
|
||||
|
||||
markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, override))
|
||||
converter = fixture_converter(Utils.deep_merge_hashes(@config, override))
|
||||
assert_match %r!<p>(«|«)Pit(›|›)hy(»|»)<\/p>!, \
|
||||
markdown.convert(%("Pit'hy")).strip
|
||||
converter.convert(%("Pit'hy")).strip
|
||||
end
|
||||
end
|
||||
|
||||
should "render fenced code blocks with syntax highlighting" do
|
||||
result = nokogiri_fragment(@markdown.convert(Utils.strip_heredoc(<<-MARKDOWN)))
|
||||
~~~ruby
|
||||
puts "Hello World"
|
||||
~~~
|
||||
MARKDOWN
|
||||
div_highlight = ">div.highlight"
|
||||
selector = "div.highlighter-rouge#{div_highlight}>pre.highlight>code"
|
||||
refute result.css(selector).empty?
|
||||
end
|
||||
|
||||
context "when a custom highlighter is chosen" do
|
||||
should "use the chosen highlighter if it's available" do
|
||||
override = {
|
||||
"highlighter" => nil,
|
||||
"markdown" => "kramdown",
|
||||
"kramdown" => {
|
||||
"syntax_highlighter" => :coderay,
|
||||
"syntax_highlighter" => "coderay",
|
||||
},
|
||||
}
|
||||
|
||||
markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, override))
|
||||
result = nokogiri_fragment(markdown.convert(Utils.strip_heredoc(<<-MARKDOWN)))
|
||||
converter = fixture_converter(Utils.deep_merge_hashes(@config, override))
|
||||
result = nokogiri_fragment(converter.convert(<<~MARKDOWN))
|
||||
~~~ruby
|
||||
puts "Hello World"
|
||||
~~~
|
||||
@@ -119,7 +162,6 @@ class TestKramdown < JekyllUnitTest
|
||||
|
||||
should "support legacy enable_coderay... for now" do
|
||||
override = {
|
||||
"markdown" => "kramdown",
|
||||
"kramdown" => {
|
||||
"enable_coderay" => true,
|
||||
},
|
||||
@@ -127,8 +169,9 @@ class TestKramdown < JekyllUnitTest
|
||||
|
||||
@config.delete("highlighter")
|
||||
@config["kramdown"].delete("syntax_highlighter")
|
||||
markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, override))
|
||||
result = nokogiri_fragment(markdown.convert(Utils.strip_heredoc(<<-MARKDOWN)))
|
||||
|
||||
converter = fixture_converter(Utils.deep_merge_hashes(@config, override))
|
||||
result = nokogiri_fragment(converter.convert(<<~MARKDOWN))
|
||||
~~~ruby
|
||||
puts "Hello World"
|
||||
~~~
|
||||
@@ -140,24 +183,26 @@ class TestKramdown < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "move coderay to syntax_highlighter_opts" do
|
||||
original = Kramdown::Document.method(:new)
|
||||
markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, {
|
||||
override = {
|
||||
"higlighter" => nil,
|
||||
"markdown" => "kramdown",
|
||||
"kramdown" => {
|
||||
"syntax_highlighter" => "coderay",
|
||||
"coderay" => {
|
||||
"hello" => "world",
|
||||
},
|
||||
},
|
||||
}))
|
||||
}
|
||||
original = Kramdown::Document.method(:new)
|
||||
converter = fixture_converter(
|
||||
Utils.deep_merge_hashes(@config, override)
|
||||
)
|
||||
|
||||
expect(Kramdown::Document).to receive(:new) do |arg1, hash|
|
||||
assert_equal hash["syntax_highlighter_opts"]["hello"], "world"
|
||||
original.call(arg1, hash)
|
||||
end
|
||||
|
||||
markdown.convert("hello world")
|
||||
converter.convert("hello world")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,5 +31,52 @@ class TestLayoutReader < JekyllUnitTest
|
||||
assert_equal LayoutReader.new(@site).layout_directory, source_dir("blah/_layouts")
|
||||
end
|
||||
end
|
||||
|
||||
context "when a layout is a symlink" do
|
||||
setup do
|
||||
symlink_if_allowed("/etc/passwd", source_dir("_layouts", "symlink.html"))
|
||||
|
||||
@site = fixture_site(
|
||||
"safe" => true,
|
||||
"include" => ["symlink.html"]
|
||||
)
|
||||
end
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_f(source_dir("_layouts", "symlink.html"))
|
||||
end
|
||||
|
||||
should "only read the layouts which are in the site" do
|
||||
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||
|
||||
layouts = LayoutReader.new(@site).read
|
||||
|
||||
refute layouts.key?("symlink"), "Should not read the symlinked layout"
|
||||
end
|
||||
end
|
||||
|
||||
context "with a theme" do
|
||||
setup do
|
||||
symlink_if_allowed("/etc/passwd", theme_dir("_layouts", "theme-symlink.html"))
|
||||
@site = fixture_site(
|
||||
"include" => ["theme-symlink.html"],
|
||||
"theme" => "test-theme",
|
||||
"safe" => true
|
||||
)
|
||||
end
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_f(theme_dir("_layouts", "theme-symlink.html"))
|
||||
end
|
||||
|
||||
should "not read a symlink'd theme" do
|
||||
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||
|
||||
layouts = LayoutReader.new(@site).read
|
||||
|
||||
refute layouts.key?("theme-symlink"), \
|
||||
"Should not read symlinked layout from theme"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,16 +28,16 @@ class TestRdiscount < JekyllUnitTest
|
||||
|
||||
should "render toc" do
|
||||
toc = <<-TOC
|
||||
<a name="Header.1"></a>
|
||||
<a name="Header-1"></a>
|
||||
<h1>Header 1</h1>
|
||||
|
||||
<a name="Header.2"></a>
|
||||
<a name="Header-2"></a>
|
||||
<h2>Header 2</h2>
|
||||
|
||||
<p><ul>
|
||||
<li><a href="#Header.1">Header 1</a>
|
||||
<li><a href="#Header-1">Header 1</a>
|
||||
<ul>
|
||||
<li><a href="#Header.2">Header 2</a></li>
|
||||
<li><a href="#Header-2">Header 2</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
97
test/test_redcarpet.rb
Normal file
97
test/test_redcarpet.rb
Normal file
@@ -0,0 +1,97 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "helper"
|
||||
|
||||
class TestRedcarpet < JekyllUnitTest
|
||||
context "redcarpet" do
|
||||
setup do
|
||||
if jruby?
|
||||
then skip(
|
||||
"JRuby does not perform well with CExt, test disabled."
|
||||
)
|
||||
end
|
||||
|
||||
@config = {
|
||||
"markdown" => "redcarpet",
|
||||
"redcarpet" => {
|
||||
"extensions" => %w(smart strikethrough filter_html),
|
||||
},
|
||||
}
|
||||
|
||||
@markdown = Converters::Markdown.new @config
|
||||
|
||||
@sample = Jekyll::Utils.strip_heredoc(<<-EOS
|
||||
```ruby
|
||||
puts "Hello world"
|
||||
```
|
||||
EOS
|
||||
)
|
||||
end
|
||||
|
||||
should "pass redcarpet options" do
|
||||
assert_equal "<h1>Some Header</h1>", @markdown.convert("# Some Header #").strip
|
||||
end
|
||||
|
||||
should "pass redcarpet SmartyPants options" do
|
||||
assert_equal "<p>“smart”</p>", @markdown.convert('"smart"').strip
|
||||
end
|
||||
|
||||
should "pass redcarpet extensions" do
|
||||
assert_equal "<p><del>deleted</del></p>", @markdown.convert("~~deleted~~").strip
|
||||
end
|
||||
|
||||
should "pass redcarpet render options" do
|
||||
assert_equal "<p><strong>bad code not here</strong>: i am bad</p>",
|
||||
@markdown.convert("**bad code not here**: <script>i am bad</script>").strip
|
||||
end
|
||||
|
||||
context "with pygments enabled" do
|
||||
setup do
|
||||
unless system("command", "-v", "python")
|
||||
skip "Skipping as 'python' is not available"
|
||||
end
|
||||
@markdown = Converters::Markdown.new @config.merge(
|
||||
{ "highlighter" => "pygments" }
|
||||
)
|
||||
end
|
||||
|
||||
should "render fenced code blocks with syntax highlighting" do
|
||||
assert_equal(
|
||||
%(<div class="highlight"><pre><code class="language-ruby" ) +
|
||||
%(data-lang="ruby"><span></span><span class="nb">puts</span> <span ) +
|
||||
%(class="s2">"Hello world"</span>\n</code></pre></div>),
|
||||
@markdown.convert(@sample).strip
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "with rouge enabled" do
|
||||
setup do
|
||||
@markdown = Converters::Markdown.new @config.merge({ "highlighter" => "rouge" })
|
||||
end
|
||||
|
||||
should "render fenced code blocks with syntax highlighting" do
|
||||
assert_equal(
|
||||
%(<div class="highlight"><pre><code class="language-ruby" ) +
|
||||
%(data-lang="ruby"><span class="nb">puts</span> <span ) +
|
||||
%(class="s2">"Hello world"</span>\n</code></pre></div>),
|
||||
@markdown.convert(@sample).strip
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "without any highlighter" do
|
||||
setup do
|
||||
@markdown = Converters::Markdown.new @config.merge({ "highlighter" => nil })
|
||||
end
|
||||
|
||||
should "render fenced code blocks without syntax highlighting" do
|
||||
assert_equal(
|
||||
%(<figure class="highlight"><pre><code class="language-ruby" ) +
|
||||
%(data-lang="ruby">puts "Hello world"\n</code></pre></figure>),
|
||||
@markdown.convert(@sample).strip
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -167,10 +167,10 @@ CONTENT
|
||||
|
||||
context "with the pygments highlighter" do
|
||||
setup do
|
||||
if jruby?
|
||||
then skip(
|
||||
"JRuby does not support Pygments."
|
||||
)
|
||||
skip("JRuby does not support Pygments.") if jruby?
|
||||
|
||||
unless system("command", "-v", "python")
|
||||
skip "Skipping as 'python' is not available"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -323,12 +323,25 @@ EOS
|
||||
)
|
||||
end
|
||||
|
||||
should "render markdown with rouge with line numbers" do
|
||||
should "render markdown with rouge 2 with line numbers" do
|
||||
skip "Skipped because using an older version of Rouge" if Utils::Rouge.old_api?
|
||||
assert_match(
|
||||
%(<table class="rouge-table"><tbody>) +
|
||||
%(<tr><td class="gutter gl">) +
|
||||
%(<pre class="lineno">1\n</pre></td>) +
|
||||
%(<td class="code"><pre>test</pre></td></tr>) +
|
||||
%(<td class="code"><pre>test\n</pre></td></tr>) +
|
||||
%(</tbody></table>),
|
||||
@result
|
||||
)
|
||||
end
|
||||
|
||||
should "render markdown with rouge 1 with line numbers" do
|
||||
skip "Skipped because using a newer version of Rouge" unless Utils::Rouge.old_api?
|
||||
assert_match(
|
||||
%(<table style="border-spacing: 0"><tbody>) +
|
||||
%(<tr><td class="gutter gl" style="text-align: right">) +
|
||||
%(<pre class="lineno">1</pre></td>) +
|
||||
%(<td class="code"><pre>test<span class="w">\n</span></pre></td></tr>) +
|
||||
%(</tbody></table>),
|
||||
@result
|
||||
)
|
||||
@@ -351,7 +364,18 @@ CONTENT
|
||||
create_post(content)
|
||||
end
|
||||
|
||||
should "render markdown with rouge" do
|
||||
should "render markdown with rouge 1" do
|
||||
skip "Skipped because using a newer version of Rouge" unless Utils::Rouge.old_api?
|
||||
|
||||
assert_match(
|
||||
%(<div class="language-liquid highlighter-rouge"><pre class="highlight"><code>),
|
||||
@result
|
||||
)
|
||||
end
|
||||
|
||||
should "render markdown with rouge 2" do
|
||||
skip "Skipped because using an older version of Rouge" if Utils::Rouge.old_api?
|
||||
|
||||
assert_match(
|
||||
%(<div class="language-liquid highlighter-rouge">) +
|
||||
%(<div class="highlight"><pre class="highlight"><code>),
|
||||
@@ -447,11 +471,23 @@ This should not be highlighted, right?
|
||||
EOS
|
||||
end
|
||||
|
||||
should "should stop highlighting at boundary with rouge" do
|
||||
should "should stop highlighting at boundary with rouge 2" do
|
||||
skip "Skipped because using an older version of Rouge" if Utils::Rouge.old_api?
|
||||
expected = <<-EOS
|
||||
<p>This is not yet highlighted</p>\n
|
||||
<figure class="highlight"><pre><code class="language-php" data-lang="php"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
|
||||
</pre></td><td class="code"><pre><span class="nx">test</span></pre></td></tr></tbody></table></code></pre></figure>\n
|
||||
</pre></td><td class="code"><pre><span class="n">test</span>\n</pre></td></tr></tbody></table></code></pre></figure>\n
|
||||
<p>This should not be highlighted, right?</p>
|
||||
EOS
|
||||
assert_match(expected, @result)
|
||||
end
|
||||
|
||||
should "should stop highlighting at boundary with rouge 1" do
|
||||
skip "Skipped because using a newer version of Rouge" unless Utils::Rouge.old_api?
|
||||
expected = <<-EOS
|
||||
<p>This is not yet highlighted</p>\n
|
||||
<figure class="highlight"><pre><code class="language-php" data-lang="php"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1</pre></td><td class="code"><pre>test<span class="w">
|
||||
</span></pre></td></tr></tbody></table></code></pre></figure>\n
|
||||
<p>This should not be highlighted, right?</p>
|
||||
EOS
|
||||
assert_match(expected, @result)
|
||||
@@ -494,7 +530,7 @@ EOS
|
||||
setup do
|
||||
@content = <<CONTENT
|
||||
---
|
||||
title: Kramdown vs. RDiscount
|
||||
title: Kramdown vs. RDiscount vs. Redcarpet
|
||||
---
|
||||
|
||||
_FIGHT!_
|
||||
@@ -536,6 +572,25 @@ CONTENT
|
||||
assert_match %r!<em>FINISH HIM</em>!, @result
|
||||
end
|
||||
end
|
||||
|
||||
context "using Redcarpet" do
|
||||
setup do
|
||||
if jruby?
|
||||
skip(
|
||||
"JRuby does not perform well with CExt, test disabled."
|
||||
)
|
||||
end
|
||||
|
||||
create_post(@content, {
|
||||
"markdown" => "redcarpet",
|
||||
})
|
||||
end
|
||||
|
||||
should "parse correctly" do
|
||||
assert_match %r{<em>FIGHT!</em>}, @result
|
||||
assert_match %r!<em>FINISH HIM</em>!, @result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with post linking" do
|
||||
@@ -734,45 +789,6 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with dynamic linking to a page" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
---
|
||||
title: linking
|
||||
---
|
||||
|
||||
{% assign contacts_filename = 'contacts' %}
|
||||
{% assign contacts_ext = 'html' %}
|
||||
{% link {{contacts_filename}}.{{contacts_ext}} %}
|
||||
{% assign info_path = 'info.md' %}
|
||||
{% link {{\ info_path\ }} %}
|
||||
{% assign screen_css_path = '/css' %}
|
||||
{% link {{ screen_css_path }}/screen.css %}
|
||||
CONTENT
|
||||
create_post(content, {
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_all" => true,
|
||||
})
|
||||
end
|
||||
|
||||
should "not cause an error" do
|
||||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the 'contacts' item" do
|
||||
assert_match(%r!/contacts\.html!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the 'info' item" do
|
||||
assert_match(%r!/info\.html!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the 'screen.css' item" do
|
||||
assert_match(%r!/css/screen\.css!, @result)
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with linking" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
@@ -799,33 +815,6 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with dynamic linking" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
---
|
||||
title: linking
|
||||
---
|
||||
|
||||
{% assign yaml_with_dots_path = '_methods/yaml_with_dots.md' %}
|
||||
{% link {{yaml_with_dots_path}} %}
|
||||
CONTENT
|
||||
create_post(content, {
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"collections" => { "methods" => { "output" => true } },
|
||||
"read_collections" => true,
|
||||
})
|
||||
end
|
||||
|
||||
should "not cause an error" do
|
||||
refute_match(%r!markdown\-html\-error!, @result)
|
||||
end
|
||||
|
||||
should "have the URL to the 'yaml_with_dots' item" do
|
||||
assert_match(%r!/methods/yaml_with_dots\.html!, @result)
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with nested linking" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
@@ -878,28 +867,6 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "simple page with invalid dynamic linking" do
|
||||
should "cause an error" do
|
||||
content = <<CONTENT
|
||||
---
|
||||
title: Invalid linking
|
||||
---
|
||||
|
||||
{% assign non_existent_path = 'non-existent-collection-item' %}
|
||||
{% link {{\ non_existent_path\ }} %}
|
||||
CONTENT
|
||||
|
||||
assert_raises ArgumentError do
|
||||
create_post(content, {
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"collections" => { "methods" => { "output" => true } },
|
||||
"read_collections" => true,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "include tag with parameters" do
|
||||
context "with symlink'd include" do
|
||||
should "not allow symlink includes" do
|
||||
@@ -1126,6 +1093,49 @@ CONTENT
|
||||
end
|
||||
end
|
||||
|
||||
context "with include file with special characters without params" do
|
||||
setup do
|
||||
content = <<~CONTENT
|
||||
---
|
||||
title: special characters
|
||||
---
|
||||
|
||||
{% include params@2.0.html %}
|
||||
CONTENT
|
||||
create_post(content,
|
||||
"permalink" => "pretty",
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_posts" => true)
|
||||
end
|
||||
|
||||
should "include file with empty parameters" do
|
||||
assert_match "<span id=\"include-param\"></span>", @result
|
||||
end
|
||||
end
|
||||
|
||||
context "with include file with special characters with params" do
|
||||
setup do
|
||||
content = <<~CONTENT
|
||||
---
|
||||
title: special characters
|
||||
---
|
||||
|
||||
{% include params@2.0.html param1="foobar" param2="bazbar" %}
|
||||
CONTENT
|
||||
create_post(content,
|
||||
"permalink" => "pretty",
|
||||
"source" => source_dir,
|
||||
"destination" => dest_dir,
|
||||
"read_posts" => true)
|
||||
end
|
||||
|
||||
should "include file with empty parameters" do
|
||||
assert_match "<li>param1 = foobar</li>", @result
|
||||
assert_match "<li>param2 = bazbar</li>", @result
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom includes directory" do
|
||||
setup do
|
||||
content = <<CONTENT
|
||||
|
||||
@@ -75,4 +75,29 @@ class TestThemeAssetsReader < JekyllUnitTest
|
||||
refute_file_with_relative_path site.pages, "assets/style.scss"
|
||||
end
|
||||
end
|
||||
|
||||
context "symlinked theme" do
|
||||
should "not read assets from symlinked theme" do
|
||||
skip_if_windows "Jekyll does not currently support symlinks on Windows."
|
||||
|
||||
begin
|
||||
tmp_dir = Dir.mktmpdir("jekyll-theme-test")
|
||||
File.open(File.join(tmp_dir, "test.txt"), "wb") { |f| f.write "content" }
|
||||
|
||||
theme_dir = File.join(__dir__, "fixtures", "test-theme-symlink")
|
||||
File.symlink(tmp_dir, File.join(theme_dir, "assets"))
|
||||
|
||||
site = fixture_site(
|
||||
"theme" => "test-theme-symlink",
|
||||
"theme-color" => "black"
|
||||
)
|
||||
ThemeAssetsReader.new(site).read
|
||||
|
||||
assert_empty site.static_files, "static file should not have been picked up"
|
||||
ensure
|
||||
FileUtils.rm_rf(tmp_dir)
|
||||
FileUtils.rm_rf(File.join(theme_dir, "assets"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
31
test/test_win_tz.rb
Normal file
31
test/test_win_tz.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "helper"
|
||||
|
||||
class TestWinTz < JekyllUnitTest
|
||||
[["America/New_York", "WTZ+05:00"], ["Europe/Paris", "WTZ-01:00"]].each do |tz, expected|
|
||||
should "use base offset in winter for #{tz}" do
|
||||
result = Jekyll::Utils::WinTZ.calculate(tz, Time.utc(2021, 1, 1))
|
||||
assert_equal expected, result
|
||||
end
|
||||
end
|
||||
|
||||
[["America/New_York", "WTZ+04:00"], ["Europe/Paris", "WTZ-02:00"]].each do |tz, expected|
|
||||
should "apply DST in summer for #{tz}" do
|
||||
result = Jekyll::Utils::WinTZ.calculate(tz, Time.utc(2021, 7, 1))
|
||||
assert_equal expected, result
|
||||
end
|
||||
end
|
||||
|
||||
[["Australia/Eucla", "WTZ-08:45"], ["Pacific/Marquesas", "WTZ+09:30"]].each do |tz, expected|
|
||||
should "handle non zero minutes for #{tz}" do
|
||||
result = Jekyll::Utils::WinTZ.calculate(tz, Time.utc(2021, 1, 1))
|
||||
assert_equal expected, result
|
||||
end
|
||||
end
|
||||
|
||||
should "return zero for UTC" do
|
||||
result = Jekyll::Utils::WinTZ.calculate("UTC")
|
||||
assert_equal "WTZ+00:00", result
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user