Compare commits

..

106 Commits

Author SHA1 Message Date
Parker Moore
f714b69e5e Merge pull request #9551 from jekyll/3.9.5-release-post 2024-02-12 21:37:32 -08:00
Parker Moore
3b62587def Release v3.9.5 2024-02-12 20:26:02 -08:00
Parker Moore
ee86ce5756 3.9-stable: allow Pages to be Excerpted (#9550)
Merge pull request 9550
2024-02-12 20:19:20 -08:00
Parker Moore
eb2c888698 Release 💎 v3.9.4 2023-12-28 14:47:09 -08:00
Parker Moore
c7424780af Merge pull request #9513 from jekyll/3.9-stable-backport-9392
Backport logger-1.4.3 from #9392 to 3.9-stable
2023-12-28 14:42:05 -08:00
Sutou Kouhei
dd32a1673d Backport logger-1.4.3 from #9392 to 3.9-stable 2023-12-27 22:48:36 -08:00
Parker Moore
82fd9f1dfb Merge pull request #9514 from jekyll/3.9-stable-update-ci
Add Ruby 3.3 to Jekyll 3.9.x test matrix
2023-12-27 22:47:52 -08:00
Parker Moore
57a58eb910 Add Ruby 3.3 to Jekyll 3.9.x test matrix 2023-12-27 22:06:02 -08:00
Parker Moore
42d92d1860 Merge pull request #9282 from jekyll/release-3-9-3
Release 💎 v3.9.3
2023-01-29 18:30:22 -08:00
Parker Moore
4a981a8a30 Rephrase v3.9.3 release notes. 2023-01-29 18:30:00 -08:00
Parker Moore
31ebf86fdb Release 💎 v3.9.3 2023-01-27 13:15:06 -08:00
Parker Moore
cd39dc962e Backport #8880 for v3.9.x: Support both tzinfo v1 and v2 alongwith non-half hour offsets (#9280)
This backports 9c9cf3e to 3.9-stable

Co-authored-by: Phil Ross <philr@users.noreply.github.com>
2023-01-27 17:47:17 +05:30
Parker Moore
fe12951090 Merge pull request #9269 from jekyll/3.9-stable-i18n
3.9.x: Support i18n 1.x
2023-01-25 15:53:08 -08:00
Parker Moore
2325123529 Allow 💎 i18n 1.x to be used 2023-01-25 15:44:03 -08:00
Parker Moore
e300f897ea Merge pull request #9272 from jekyll/3.9-add-ruby-3-2
v3.9.x: test under Ruby 3.2
2023-01-25 15:43:35 -08:00
Parker Moore
ce4363ca52 v3.9.x: test under Ruby 3.2 2023-01-25 15:21:31 -08:00
Parker Moore
155300f0e9 Merge pull request #9277 from jekyll/3.9-fix-rdiscount 2023-01-25 15:14:31 -08:00
Parker Moore
17ce428dc4 v3.9.x: fix test for the latest version of rdiscount 2023-01-25 14:54:24 -08:00
Parker Moore
42150e92e1 Merge pull request #9012 from jekyll/3-9-2
Release Jekyll v3.9.2
2022-03-27 13:24:01 -07:00
Parker Moore
37737b22ae 3.9.2 release post: fix time and mention adding webrick to gemfile 2022-03-27 13:23:49 -07:00
Parker Moore
3372a0bb85 Release Jekyll v3.9.2 2022-03-26 11:44:08 -07:00
Ashwin Maroli
18b0a5e8b0 Update history to reflect merge of #8976 [ci skip] 2022-02-28 11:16:30 +05:30
Ashwin Maroli
7e6769aab9 Merge pull request #8976 from jekyll/3.9-stable-backport-8965
Backport #8965 for v3.9.x: Fix response header for content served via `jekyll serve`
2022-02-28 11:13:06 +05:30
Ashwin Maroli
e7f53e68e6 Fix response header for content served via jekyll serve (#8965)
Merge pull request 8965
2022-02-27 08:44:34 -08:00
Ashwin Maroli
11b3d1e477 Bypass corrupted bundle-cache 2022-01-21 15:29:54 +05:30
Ashwin Maroli
76ef58e9e1 Update history to reflect merge of #8942 [ci skip] 2022-01-20 18:07:59 +05:30
Parker Moore
ee1d210e77 Update and fix CI for 3.9-stable on Ruby 3.x (#8942)
* Copy-paste CI workflow from `master`
* Copy-paste Release workflow from `master`
* Fix Ruby 3.0 and 3.1 compatibility issues
* Add webrick gem to bundle on Ruby 3.x
* Stop using `Kernel#exec` to check for python presence, since it replaces the current process
* Read `/proc/version` using `File.read` directly
* Fix some style offenses in touched files

Co-authored-by: Ashwin Maroli <ashmaroli@gmail.com>
2022-01-20 18:03:13 +05:30
Ashwin Maroli
01ea2471ee Update history to reflect merge of #8943 [ci skip] 2022-01-20 15:44:53 +05:30
Ashwin Maroli
4ea4f1499a Lock http_parser.rb gem to v0.6.x on JRuby (#8943)
since newer versions of the gem do not have a Java counterpart
2022-01-20 15:39:50 +05:30
Ashwin Maroli
070a4d421b Update history to reflect merge of #8795 [ci skip] 2021-09-01 10:50:46 +05:30
Parker Moore
0f46edd088 Merge pull request #8795 from ashmaroli/3.9-stable-backport-8756
Backport #8756 to 3.9-stable
2021-08-30 16:05:55 -04:00
Ashwin Maroli
5ab445a6d2 Backport #8756 to 3.9-stable
Respect collections_dir config within include tag
This backports and adapts aa9a416 and 1aea158 to 3.9-stable
2021-08-30 14:48:49 +05:30
Ashwin Maroli
bd95dbd7eb Update History.markdown [ci skip] 2021-08-30 12:13:43 +05:30
Parker Moore
acc0797126 Merge pull request #8788 from ashmaroli/ci-for-3.9-stable 2021-08-29 16:14:37 -04:00
Ashwin Maroli
433d449d14 Fix CI for commits to 3.9-stable branch 2021-08-29 18:04:17 +05:30
Parker Moore
c50821b69c Release 💎 3.9.1 2021-04-08 10:50:38 -04:00
Parker Moore
970f3a1d82 Merge pull request #8631 from jekyll/3.9-stable-3-9-1-release-post
v3.9.1: Release post
2021-04-08 10:48:36 -04:00
Parker Moore
7f118454b5 Release post for v3.9.1 2021-04-07 16:06:34 -04:00
Parker Moore
2b31497926 Remove calls to Regexp#freeze as it's an immutable object.
Rubocop offense introduced by #8629
2021-04-07 15:58:43 -04:00
Parker Moore
9bdb9c90db Merge pull request #8629 from jekyll/3.9-stable-backport-8618
Backport #8618 for v3.9.x: Update include tag to be more permissive
2021-04-07 15:57:40 -04:00
Parker Moore
672da32e7a Backport update-include-tag-to-be-more-permissive from #8618 to 3.9-stable 2021-04-06 10:12:25 -04:00
Parker Moore
8fe3a5d59b Release 💎 3.9.0 2020-08-05 14:48:04 -04:00
Parker Moore
331361aee6 Update jekyll 3.9.0 release post 2020-08-05 14:28:18 -04:00
Parker Moore
8681d67d76 Update history.markdown 2020-08-05 14:25:22 -04:00
Parker Moore
917c7b13ad [3.x] Add default language for kramdown syntax highlighting (#8325)
Merge pull request 8325
2020-08-05 14:19:26 -04:00
Parker Moore
a6e21936a5 [3.x] Add 3.9.0 release post (#8323)
Merge pull request 8323
2020-08-05 14:16:49 -04:00
Parker Moore
f98b2492fc Merge pull request #8322 from jekyll/3.9-kramdown-v2-upgrade
[3.x] kramdown v2 upgrade
2020-08-05 11:33:35 -04:00
Parker Moore
071913e350 Require kramdown-parser-gfm gracefully.
Co-authored-by: Ashwin Maroli <ashmaroli@users.noreply.github.com>
2020-08-05 10:49:56 -04:00
Frank Taillandier
82fc6ba01c Update features/collections.feature
Co-authored-by: Ashwin Maroli <ashmaroli@users.noreply.github.com>
2020-08-05 13:26:21 +02:00
Parker Moore
0ac94d7766 Rewrite kramdown and rouge versions in script/default-site 2020-08-04 11:46:35 -04:00
Parker Moore
5a2f8d7279 Skip this scenario when using Kramdown v1 since it doesn't support guess_lang 2020-08-04 10:59:35 -04:00
Ashwin Maroli
382002ae42 Rouge 1.x doesn't render a div wrapper 2020-08-04 13:02:53 +05:30
Parker Moore
5b90cecbc9 'jekyll new' should add kramdown-parser-gfm to its gemfile 2020-08-03 17:39:19 -04:00
Ashwin Maroli
9bfd37570b Update unit tests for Kramdown-based converter (#8014)
Merge pull request 8014

Co-authored-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 17:29:15 -04:00
Parker Moore
cbde121dc4 Don't bundle kramdown-parser-gfm by default. 2020-08-03 17:01:19 -04:00
Parker Moore
5db0b067be Fix rubocop offenses 2020-08-03 16:53:32 -04:00
Parker Moore
ae1d7c5aa2 By default, the kramdown version will be 2.x, so add the other gems by default in that case 2020-08-03 16:53:25 -04:00
Parker Moore
687785a00d Allow kramdown v1.17 and v2 and up. 2020-08-03 16:29:36 -04:00
Parker Moore
ac7b264112 Test on Ruby 2.5 and up, only 2020-08-03 16:04:21 -04:00
Ashwin Maroli
7683292976 mathjax engine is still bundled within kramdown
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:49:53 -04:00
Ashwin Maroli
24515914b4 Require at least kramdown-2.1
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:49:53 -04:00
Ashwin Maroli
d276dc2698 Appease RuboCop
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:46:52 -04:00
Ashwin Maroli
262d950b27 Add "kramdown-syntax-coderay" to Gemfile
gem "coderay" is a dependency of "kramdown-syntax-coderay". So there's no
need to list it separately

Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:46:52 -04:00
Ashwin Maroli
2ca200bc2d Remove kramdown listing from Gemfile
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:46:26 -04:00
Ashwin Maroli
56862cac6c load kramdown extensions based on configuration
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:46:06 -04:00
Ashwin Maroli
82128692f5 Add 'kramdown-parser-gfm' as a runtime dependency
Since we default `kramdown.input` config to "GFM"

Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:43:54 -04:00
Ashwin Maroli
fbc79f6605 Bump kramdown to v2.0
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2020-08-03 13:43:21 -04:00
Frank Taillandier
e894f830fa Release 💎 3.8.7 2020-05-08 16:55:07 +02:00
Frank Taillandier
51a65754bf chore(release): v3.8.7 💎
- Prevent console warnings with Ruby 2.7 (#8125)
2020-05-08 16:54:47 +02:00
Ashwin Maroli
ce68268aaa Update history to reflect merge of #8125 [ci skip] 2020-04-16 22:39:11 +05:30
Ashwin Maroli
9e4b4f2bd1 Backport #7948 for v3.8.x (#8125)
Attain Ruby 3.0 compatibility
This backports 389eb88 to 3.8-stable

Additionally backports 51d1366 for v3.8.x

Includes additional changes to appease RuboCop
Includes additional changes to CI configs
2020-04-16 22:33:17 +05:30
Parker Moore
7ff9a885b8 Release 💎 3.8.6 2019-07-02 16:53:35 -04:00
Parker Moore
5c4e125dad 3.8.6: add release note for 3c06609406 2019-07-02 16:52:01 -04:00
Frank Taillandier
cc5c850a03 Fix year 2019-07-02 21:37:14 +02:00
Frank Taillandier
72d853779f Update release date 2019-07-02 21:31:54 +02:00
Parker Moore
c945c48b79 Merge pull request #7735 from jekyll/3-8-6-release-notes
Create 3.8.6 release notes
2019-07-02 11:50:49 -04:00
Parker Moore
27e1433ee0 Create 3.8.6 release notes 2019-07-02 11:27:02 -04:00
Ashwin Maroli
9c574f779f Backport #7679 for v3.8.x (#7734)
Update log output for an invalid theme directory
2019-07-02 00:53:44 +05:30
Parker Moore
47b67f1222 Add all backports since 3.8.5 2019-06-27 11:50:41 -04:00
Ashwin Maroli
b8d5a04b57 Backport #7697 for v3.8.x (#7722)
Memoize SiteDrop#documents to reduce allocations
2019-06-27 00:25:10 +05:30
Ashwin Maroli
8701fdbc29 Backport #7709 to 3.8-stable branch
Update TestTags in sync with Rouge v3.4 (#7709)
2019-06-26 12:30:11 +05:30
Ashwin Maroli
f29c72e0b9 Backport #7213 and #7633 for v3.8.x (#7690)
Merge pull request 7690
2019-06-05 08:45:58 -04:00
Ashwin Maroli
fbeadab63f Backport #7684 for v3.8.x (#7689)
Merge pull request 7689
2019-05-31 11:31:45 -04:00
Ashwin Maroli
3c06609406 Install platform-specific gems as required 2019-03-18 11:25:31 +05:30
Ashwin Maroli
f3b6877a39 Backport regex-escape-site-path from #7568 to 3.8-stable (#7573) 2019-03-17 11:40:46 +05:30
Ashwin Maroli
c2dff2cd15 Fix CI builds on older Ruby versions (#7567)
* Fix CI builds on older Ruby versions
* Use Bundler available by default
* Remove deprecated Travis configuration
2019-03-13 22:59:13 +05:30
Parker Moore
cb11099394 Merge pull request #7467 from jekyll/3.8-stable-backport-7382
Backport #7382 for v3.8.x: Excerpt handling of custom and intermediate tags
2019-03-13 10:46:22 -04:00
Parker Moore
17efa2a485 Merge pull request #7424 from jekyll/3.8-stable-backport-7419
Backport #7419 for v3.8.x: Theme gems: ensure directories aren't symlinks
2019-03-13 10:18:07 -04:00
Kyle Barbour
02133f4e1f Backport excerpt-liquid from 7382 to 3.8-stable 2019-01-07 17:10:22 +05:30
Ashwin Maroli
77208fac2c Merge branch '3.8-stable' into 3.8-stable-backport-7419 2018-12-18 22:51:17 +05:30
Ashwin Maroli
f157093ab3 Backport c368fec to 3.8-stable
Create symlink only if target is accessible (#7429)
2018-12-18 22:47:46 +05:30
Parker Moore
a395dfe27c Skip theme dir symlink test if Windows. 2018-12-17 16:34:39 -05:00
Ashwin Maroli
889af57f03 Merge branch '3.8-stable' into this branch 2018-12-15 00:22:56 +05:30
Ashwin Maroli
b5772dc787 Backport e41c427 to 3.8-stable
CI: Build stable branches during backport
2018-12-15 00:03:59 +05:30
olivia hugger
21d8def9ed Backport 564f773 to 3.8-stable
test for stable and backport branches on travis
2018-12-14 23:35:16 +05:30
Parker Moore
f15804423e Fix linting issue with lines being too long. 2018-12-14 10:31:08 -05:00
Parker Moore
511ea72d05 Backport ensure-realpath-for-theme-dirs-is-in-theme-dir from #7419 to 3.8-stable 2018-12-14 10:12:56 -05:00
olivia
41c82448ae Release 💎 3.8.5 2018-11-04 21:19:54 +01:00
olivia
ee35322193 Prepare 3.8.5 release 2018-11-04 21:17:46 +01:00
olivia hugger
a7e8f08bea Merge pull request #7352 from jekyll/3.8-backport-7250
Backport #7250 to 3.8.x
2018-11-04 20:54:58 +01:00
Frank Taillandier
a4171db345 style: Metrics/LineLength 2018-11-04 20:52:35 +01:00
Frank Taillandier
aedb403afd style: fix offenses 2018-11-04 20:45:28 +01:00
Ashwin Maroli
924ca62bd2 Re-implement handling Liquid blocks in excerpts (#7250)
Merge pull request 7250
2018-11-04 20:08:01 +01:00
Frank Taillandier
cc52cac81a Release 💎 3.8.4 2018-09-18 23:50:26 +02:00
Frank Taillandier
91abe9f741 Release 💎 3.8.4 2018-09-18 23:49:03 +02:00
Parker Moore
d9a2758ff6 3.8.x: security: fix include bypass of EntryFilter#filter symlink check (#7228)
Merge pull request 7228
2018-09-18 12:24:15 -04:00
174 changed files with 3932 additions and 2330 deletions

77
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,77 @@
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: Ruby 3.3
ruby_version: "3.3"
- 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
View 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
View 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

View File

@@ -8,10 +8,9 @@ Jekyll/NoPutsAllowed:
- rake/*.rake
AllCops:
TargetRubyVersion: 2.3
TargetRubyVersion: 2.1
Include:
- lib/**/*.rb
- test/**/*.rb
Exclude:
- bin/**/*
- exe/**/*
@@ -19,14 +18,30 @@ AllCops:
- script/**/*
- vendor/**/*
- tmp/**/*
Layout/AlignArray:
Enabled: false
Layout/AlignHash:
EnforcedHashRocketStyle: table
Layout/AlignParameters:
Enabled: false
Layout/EmptyLinesAroundAccessModifier:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EndOfLine:
EnforcedStyle: native
Layout/ExtraSpacing:
AllowForAlignment: true
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
Layout/IndentationWidth:
Severity: error
Layout/IndentArray:
EnforcedStyle: consistent
Layout/IndentHash:
EnforcedStyle: consistent
Layout/IndentHeredoc:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
@@ -38,11 +53,14 @@ Layout/EmptyComment:
Enabled: false
Layout/EndAlignment:
Severity: error
Lint/SplatKeywordArguments:
Enabled: false
Lint/UnreachableCode:
Severity: error
Lint/UselessAccessModifier:
Enabled: false
Lint/Void:
Exclude:
- lib/jekyll/site.rb
Enabled: false
Metrics/AbcSize:
Max: 21
Metrics/BlockLength:
@@ -50,26 +68,22 @@ Metrics/BlockLength:
- test/**/*.rb
- lib/jekyll/configuration.rb
- rake/*.rake
- jekyll.gemspec
Metrics/ClassLength:
Exclude:
- !ruby/regexp /features\/.*.rb$/
- !ruby/regexp /test\/.*.rb$/
- lib/jekyll/document.rb
- lib/jekyll/site.rb
- lib/jekyll/commands/serve.rb
- lib/jekyll/configuration.rb
Max: 240
Max: 300
Metrics/CyclomaticComplexity:
Exclude:
- lib/jekyll/utils.rb
- lib/jekyll/commands/serve.rb
Max: 9
Metrics/LineLength:
Exclude:
- !ruby/regexp /features\/.*.rb/
- Rakefile
- rake/*.rake
- Gemfile
Max: 100
- jekyll.gemspec
Max: 90
Severity: warning
Metrics/MethodLength:
CountComments: false
@@ -84,8 +98,7 @@ Metrics/PerceivedComplexity:
Naming/FileName:
Enabled: false
Naming/HeredocDelimiterNaming:
Exclude:
- test/**/*.rb
Enabled: false
Naming/MemoizedInstanceVariableName:
Exclude:
- lib/jekyll/page_without_a_file.rb
@@ -102,19 +115,20 @@ Security/YAMLLoad:
Exclude:
- !ruby/regexp /features\/.*.rb/
- !ruby/regexp /test\/.*.rb$/
Style/AccessModifierDeclarations:
Enabled: false
Style/Alias:
EnforcedStyle: prefer_alias_method
Enabled: false
Style/AndOr:
Severity: error
Style/BracesAroundHashParameters:
Enabled: false
Style/ClassAndModuleChildren:
Exclude:
- test/**/*.rb
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Style/Documentation:
Enabled: false
Exclude:
- !ruby/regexp /features\/.*.rb$/
Style/DoubleNegation:
Enabled: false
Style/FormatStringToken:
@@ -125,6 +139,10 @@ Style/GuardClause:
Style/HashSyntax:
EnforcedStyle: hash_rockets
Severity: error
Style/IfUnlessModifier:
Enabled: false
Style/InverseMethods:
Enabled: false
Style/MixinUsage:
Exclude:
- test/helper.rb
@@ -141,21 +159,24 @@ Style/PercentLiteralDelimiters:
"%w": "()"
"%W": "()"
"%x": "()"
Style/RedundantReturn:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/RegexpLiteral:
EnforcedStyle: percent_r
Style/RescueModifier:
Enabled: false
Style/SafeNavigation:
Exclude:
- lib/jekyll/document.rb
Style/SignalException:
EnforcedStyle: only_raise
Style/SingleLineMethods:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/SymbolArray:
EnforcedStyle: brackets
Enabled: false
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:

View File

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

View File

@@ -1,46 +1,49 @@
# Code of Conduct
## Our Pledge
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
## Our Responsibilities
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
## Scope
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by opening an issue or contacting a project maintainer. All complaints
will be reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. Maintainers are obligated to
maintain confidentiality with regard to the reporter of an incident.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting a project maintainer. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version]
[homepage]: https://www.contributor-covenant.org/
[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/

67
Gemfile
View File

@@ -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.57.2"
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,35 +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 "yajl-ruby", "~> 1.3"
gem "rdiscount", "~> 2.0"
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"

View File

@@ -1,85 +1,87 @@
## HEAD
* Textile is only supported through a converter plugin (#7003)
### Documentation
* 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&#39;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)
* Updated nginx configuration for custom-404-page documentation (#6994)
* List all static files variables (#7002)
* Document that _drafts need to be contained within the custom collection directory (#6985)
* proposed change for passive voice. (#7005)
* added the CAT plugin to the plugin list (#7011)
* Updated to supported version (#7031)
* Clarify definition of &#39;draft&#39; (#7037)
* Listed the jekyll-target-blank plugin in plugins list. (#7046)
* Typo (#7058)
* Add Hints for some Improved Travis Config in Doc (#7049)
* Added plugin json-get. (#7086)
* Update travis-ci.md to point out &#34;this is an example Gemfile&#34; (#7089)
* Adding `jekyll-info` plugin (#7091)
* GitHub enables you to use themes from other repos (#7112)
* Updates to CODE OF CONDUCT (v1.4.0) (#7105)
* Instructions to view themes files under Linux (#7095)
* add jekyll-xml-source (#7114)
* Add the jekyll-firstimage filter plugin (#7127)
* Use a real theme in the example (#7125)
## 3.9.5 / 2024-02-12
### Minor Enhancements
* use jekyll-compose if installed (#6932)
* Memoize computing excerpt&#39;s relative_path (#6951)
* Liquefied link tag (#6269)
* Suggest re-running command with --trace on fail (#6551)
* Update item_property to return numbers as numbers instead of strings (#6608)
* Use .markdown for page templates (#7126)
* Fix custom 404 page for GitHub pages (#7132)
* 3.9-stable: allow Pages to be Excerpted (#9550)
### 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&#39;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)
* Remove support for rdiscount (#6988)
### 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)
* Load Rouge for TestKramdown (#7007)
* Useless privates removed (#6768)
* Allow i18n v0.9.5 and higher (#7044)
* Update Rubocop&#39;s config (#7050)
* Remember to release docs gem (#7066)
* Use assert_include (#7093)
* Update rubocop version to 0.57.x ### -docs (#7078)
* Example of CircleCI deployment through CircleCI v2 (#7024)
* Fix Rubocop offences in test files (#7128)
* fix up refute_equal call (#7133)
## 3.9.4 / 2023-12-28
### Bug Fixes
* Add call to unused method `validate_options` in `commands/serve.rb` (#7122)
* Backport #9392 for v3.9.x: Add support for Ruby 3.3 Logger (#9513)
### feature
## 3.9.3 / 2023-01-27
* Disable Liquid via front matter (#6824)
### Bug Fixes
* 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
* 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

View File

@@ -5,9 +5,11 @@
[![Windows Build status](https://img.shields.io/appveyor/ci/jekyll/jekyll/master.svg?label=Windows%20build)][appveyor]
[![Maintainability](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/maintainability)](codeclimate)
[![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)](coverage)
[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)][gemnasium]
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]
[ruby-gems]: https://rubygems.org/gems/jekyll
[gemnasium]: https://gemnasium.com/jekyll/jekyll
[codeclimate]: https://codeclimate.com/github/jekyll/jekyll
[coverage]: https://codeclimate.com/github/jekyll/jekyll/coverage
[hakiri]: https://hakiri.io/github/jekyll/jekyll/master
@@ -43,7 +45,7 @@ conduct.
Please adhere to this code of conduct in any interactions you have in the
Jekyll community. It is strictly enforced on all official Jekyll
repositories, websites, and resources. If you encounter someone violating
these terms, please let one of our [core team members](https://jekyllrb.com/team/#core-team) know and we will address it as soon as possible.
these terms, please let one of our core team members [Olivia](mailto:olivia@jekyllrb.com?subject=Jekyll%20CoC%20Violation), [Pat](mailto:pat@jekyllrb.com?subject=Jekyll%20CoC%20Violation), [Matt](mailto:matt@jekyllrb.com?subject=Jekyll%20CoC%20Violation) or [Parker](mailto:parker@jekyllrb.com?subject=Jekyll%20CoC%20Violation) know and we will address it as soon as possible.
## Diving In

View File

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

View File

@@ -1,5 +1,5 @@
---
version: 3.8.3
version: 3.9.4
name: Jekyll • Simple, blog-aware, static sites
description: Transform your plain text into static websites and blogs
url: https://jekyllrb.com

View File

@@ -56,9 +56,9 @@ defaults:
</div>
<div class="note warning">
<h5>Be sure to move drafts and posts into custom collections directory</h5>
<h5>Be sure to move posts into custom collections directory</h5>
<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_drafts</code> and <code>_posts</code> directory to <code>my_collections/_drafts</code> and <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p>
<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_posts</code> directory to <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p>
</div>
### Step 2: Add your content {#step2}

View File

@@ -61,7 +61,7 @@ test:
## Complete Example circle.yml File
When you put it all together, here's an example of what that `circle.yml` file could look like in v1:
When you put it all together, here's an example of what that `circle.yml` file could look like:
```yaml
machine:
@@ -83,75 +83,6 @@ deployment:
- rsync -va --delete ./_site username@my-website:/var/html
```
for CircleCI v2, a Docker-based system which new projects will follow, set the `S3_BUCKET_NAME` environment variable (an example of the required config file is shown below).
```yaml
defaults: &defaults
working_directory: ~/repo
version: 2
jobs:
build:
<<: *defaults
docker:
- image: circleci/ruby:2.5
environment:
BUNDLE_PATH: ~/repo/vendor/bundle
steps:
- checkout
- restore_cache:
keys:
- rubygems-v1-{% raw %}{{ checksum "Gemfile.lock" }}{% endraw %}
- rubygems-v1-fallback
- run:
name: Bundle Install
command: bundle check || bundle install
- run:
name: HTMLProofer tests
command: |
bundle exec htmlproofer ./_site \
--allow-hash-href \
--check-favicon \
--check-html \
--disable-external
- save_cache:
key: rubygems-v1-{% raw %}{{ checksum "Gemfile.lock" }}{% endraw %}
paths:
- vendor/bundle
- run:
name: Jekyll build
command: bundle exec jekyll build
- persist_to_workspace:
root: ./
paths:
- _site
deploy:
<<: *defaults
docker:
- image: circleci/python:3.6.3
environment:
S3_BUCKET_NAME: <<YOUR BUCKET NAME HERE>>
steps:
- attach_workspace:
at: ./
- run:
name: Install AWS CLI
command: pip install awscli --upgrade --user
- run:
name: Upload to s3
command: ~/.local/bin/aws s3 sync ./_site s3://$S3_BUCKET_NAME/ --delete --acl public-read
workflows:
version: 2
test-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
```
## Questions?
This entire guide is open-source. Go ahead and [edit it][7] if you have a fix or [ask for help][8] if you run into trouble and need some help. CircleCI also has an [online community][9] for help.

View File

@@ -76,7 +76,7 @@ with Ruby and requires RubyGems to install, we use the Ruby language build
environment. Below is a sample `.travis.yml` file, followed by
an explanation of each line.
**Note:** You will need a Gemfile as well, [Travis will automatically install](https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management) the dependencies based on the referenced gems. Here is an example `Gemfile` with two referenced gems, "jekyll" and "html-proofer":
**Note:** You will need a Gemfile as well, [Travis will automatically install](https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management) the dependencies based on the referenced gems:
```ruby
source "https://rubygems.org"
@@ -90,7 +90,7 @@ Your `.travis.yml` file should look like this:
```yaml
language: ruby
rvm:
- 2.4.1
- 2.3.3
before_script:
- chmod +x ./script/cibuild # or do this locally and commit
@@ -110,12 +110,6 @@ env:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
sudo: false # route your build to the container-based infrastructure for a faster build
cache: bundler # caching bundler gem packages will speed up build
# Optional: disable email notifications about the outcome of your builds
notifications:
email: false
```
Ok, now for an explanation of each line:
@@ -129,13 +123,12 @@ access to Bundler, RubyGems, and a Ruby runtime.
```yaml
rvm:
- 2.4.1
- 2.3.3
```
RVM is a popular Ruby Version Manager (like rbenv, chruby, etc). This
directive tells Travis the Ruby version to use when running your test
script. Use a [version which is pre-installed on the Travis build docker][5]
image to speed up the build.
script.
```yaml
before_script:
@@ -217,23 +210,6 @@ does need `sudo` access, modify the line to `sudo: required`.
sudo: false
```
To speed up the build, you should cache the gem packages created by `bundler`.
Travis has a pre-defined [cache strategy for this tool][6] which should have
all the default configs to do exactly that.
```yaml
cache: bundler
```
Optionally, if you are not interested in the build email notifications you
can disable them with this configuration. Travis supports a wide array of
notification services, you may find [another one more useful (e.g. slack)][7].
```yaml
notifications:
email: false
```
### Troubleshooting
**Travis error:** *"You are trying to install in deployment mode after changing
@@ -251,6 +227,3 @@ fix or [ask for help][4] if you run into trouble and need some help.
[3]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/travis-ci.md
[4]: https://jekyllrb.com/help/
[5]: https://docs.travis-ci.com/user/languages/ruby/#Specifying-Ruby-versions-and-implementations
[6]: https://docs.travis-ci.com/user/caching/#Caching-directories-(Bundler%2C-dependencies)
[7]: https://docs.travis-ci.com/user/notifications/

View File

@@ -16,7 +16,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
* Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion on how to improve something.
* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved.
* Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
* Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
* Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.

View File

@@ -3,7 +3,7 @@ title: Working with drafts
permalink: /docs/drafts/
---
Drafts are posts without a date in the filename. They're posts you're still working on and
Drafts are posts without a date. They're posts you're still working on and
don't want to publish yet. To get up and running with drafts, create a
`_drafts` folder in your site's root (as described in the [site structure](/docs/structure/) section) and create your
first draft:

View File

@@ -4,6 +4,124 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 3.9.5 / 2024-02-12
{: #v3-9-5}
### Minor Enhancements
{: #minor-enhancements-v3-9-5}
- 3.9-stable: allow Pages to be Excerpted ([#9550]({{ site.repository }}/issues/9550))
## 3.9.4 / 2023-12-28
{: #v3-9-4}
### Bug Fixes
{: #bug-fixes-v3-9-4}
- Backport [#9392]({{ site.repository }}/issues/9392) for v3.9.x: Add support for Ruby 3.3 Logger ([#9513]({{ site.repository }}/issues/9513))
## 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}

View File

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

View File

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

View File

@@ -14,7 +14,7 @@ your `_config.yml` under `plugins`. For Jekyll 2, this is standard.
<div class="note info">
<h5>Pagination only works within HTML files</h5>
<p>
Pagination does not work from within Markdown files from
Pagination does not work from within Markdown or Textile files from
your Jekyll site. Pagination works when called from within the HTML
file, named <code>index.html</code>, which optionally may reside in and
produce pagination from within a subdirectory, via the

View File

@@ -787,8 +787,6 @@ You can find a few useful plugins at the following locations:
- [Jekyll::Paginate::Content](https://github.com/ibrado/jekyll-paginate-content): Content paginator in the style of jekyll-paginator-v2 that splits pages, posts, and collection entries into several pages. Specify a separator or use HTML &lt;h1&gt; etc. headers. Automatic splitting, single-page view, pager/trail, self-adjusting links, multipage TOC, SEO support.
- [Premonition](https://github.com/amedia/premonition): Adds block-styled side content to your page. For example summary, notes, hints or warning boxes.
- [jekyll-fontello](https://github.com/ericcornelissen/jekyll-fontello): A Jekyll plugin that automatically downloads your webfont from Fontello.
- [Target Blank](https://github.com/keithmifsud/jekyll-target-blank): A Jekyll plugin to automatically open external links in a new browser tab or window.
- [jekyll-info](https://github.com/swestmoreland/jekyll-info): A plugin to provide information about your Jekyll sites configuration.
#### Converters
@@ -828,7 +826,6 @@ You can find a few useful plugins at the following locations:
- [replace_regex](https://github.com/sparanoid/replace_regex): A Liquid filter to perform regex replace.
- [Jekyll Money](https://rubygems.org/gems/jekyll-money): A Jekyll plugin for dealing with money. Because we all have to at some point.
- [jekyll-random](https://github.com/codecalm/jekyll-random) by [codecalm](https://nodecalm.net): A Jekyll plugin that generates pseudo-random data. Very useful when you want to generate a large amount of random data.
- [jekyll-firstimage](https://github.com/nhoizey/jekyll-firstimage) adds a Liquid filter finding the first image in a HTML content string, including responsive images srcset.
#### Tags
@@ -889,8 +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.
- [CAT](https://github.com/binfalse/jekyll-cat): Include the contents of any file (like the `include` command, but also for files outside of `_include`). Similar to Unix' `cat` tool; useful for including source code etc. in posts and pages.
#### Collections
@@ -940,8 +935,6 @@ You can find a few useful plugins at the following locations:
- [jekyll-pre-commit](https://github.com/mpchadwick/jekyll-pre-commit): A framework for running checks against your posts using a git pre-commit hook before you publish them.
- [jekyll-pwa-plugin](https://github.com/lavas-project/jekyll-pwa): A plugin provides PWA support for Jekyll. It generates a service worker in Jekyll build process and makes precache and runtime cache available in the runtime with Google Workbox.
- [jekyll-algolia](https://community.algolia.com/jekyll-algolia/): Add fast and relevant search to your Jekyll site through the Algolia API.
- [jekyll-get](https://github.com/18F/jekyll-get): Download data from external JSON API sources to use in generating a site.
- [jekyll-xml-source](https://github.com/mcred/jekyll-xml-source): Download XML and RSS from external sites for use in site data.
<div class="note info">
<h5>Submit your gem plugins</h5>

View File

@@ -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 &mdash; 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 &mdash; not every time you create a new Jekyll project. Here are some additional details:
* `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires.
* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your site. If your site doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`.
* When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts.
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:

View File

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

View File

@@ -5,8 +5,7 @@ permalink: /docs/structure/
Jekyll is, at its core, a text transformation engine. The concept behind the
system is this: you give it text written in your favorite markup language, be
that Markdown, [Textile](https://github.com/jekyll/jekyll-textile-converter)
, or just plain HTML, and it churns that through a layout
that Markdown, Textile, or just plain HTML, and it churns that through a layout
or a series of layout files. Throughout that process you can tweak how you want
the site URLs to look, what data gets displayed in the layout, and more. This
is all done through editing text files; the static web site is the final
@@ -186,7 +185,7 @@ An overview of what each of these does:
<tr>
<td>
<p><code>index.html</code> or <code>index.md</code> and other HTML,
Markdown files</p>
Markdown, Textile files</p>
</td>
<td>
<p>

View File

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

View File

@@ -19,8 +19,8 @@ In the case of Minima, you see only the following files in your Jekyll site dire
├── _config.yml
├── _posts
│ └── 2016-12-04-welcome-to-jekyll.markdown
├── about.markdown
└── index.markdown
├── about.md
└── index.md
```
The `Gemfile` and `Gemfile.lock` files are used by Bundler to keep track of the required gems and gem versions you need to build your Jekyll site.
@@ -52,8 +52,6 @@ To locate a theme's files on your computer:
open $(bundle show minima)
# On Windows
explorer /usr/local/lib/ruby/gems/2.3.0/gems/minima-2.1.0
# On Linux
xdg-open $(bundle show minima)
```
A Finder or Explorer window opens showing the theme's files and directories. The Minima theme gem contains these files:
@@ -166,21 +164,20 @@ For example, search for [jekyll theme on RubyGems](https://rubygems.org/search?u
To install a gem-based theme:
1. Add the theme gem to your site's `Gemfile`:
1. Add the theme to your site's `Gemfile`:
```ruby
# ./Gemfile
# This is an example, declare the theme gem you want to use here
gem "jekyll-theme-minimal"
gem "jekyll-theme-awesome"
```
Or if you've started with the `jekyll new` command, replace `gem "minima", "~> 2.0"` with the gem you want, e.g:
Or if you've started with the `jekyll new` command, replace `gem "minima", "~> 2.0"` with your theme-gem:
```diff
# ./Gemfile
- gem "minima", "~> 2.0"
+ gem "jekyll-theme-minimal"
+ gem "jekyll-theme-awesome"
```
2. Install the theme:
@@ -192,7 +189,7 @@ To install a gem-based theme:
3. Add the following to your site's `_config.yml` to activate the theme:
```yaml
theme: jekyll-theme-minimal
theme: jekyll-theme-awesome
```
4. Build your site:
@@ -204,7 +201,7 @@ To install a gem-based theme:
You can have multiple themes listed in your site's `Gemfile`, but only one theme can be selected in your site's `_config.yml`.
{: .note .info }
If you're publishing your Jekyll site on [GitHub Pages](https://pages.github.com/), note that GitHub Pages supports only [some gem-based themes](https://pages.github.com/themes/). GitHub Pages also supports [using any theme hosted on GitHub](https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site/#adding-a-jekyll-theme-in-your-sites-_configyml-file) using the `remote_theme` configuration as if it were a gem-based theme.
If you're publishing your Jekyll site on [GitHub Pages](https://pages.github.com/), note that GitHub Pages supports only some gem-based themes. See [Supported Themes](https://pages.github.com/themes/) in GitHub's documentation to see which themes are supported.
## Creating a gem-based theme

View File

@@ -44,10 +44,6 @@ For `site.collections.myCollection` in Jekyll 2, you now do:
This is a bit cumbersome at first, but is easier than a big `for` loop.
### Textile support
We dropped native support for Textile, from now on you have to install our [jekyll-textile-converter](https://github.com/jekyll/jekyll-textile-converter) plugin to work with Textile files.
### Dropped dependencies
We dropped a number of dependencies the Core Team felt were optional. As such, in 3.0, they must be explicitly installed and included if you use any of the features. They are:

View File

@@ -124,7 +124,8 @@ following is a reference of the available data.
A list of all <a href="/docs/static-files/">static files</a> (i.e.
files not processed by Jekyll's converters or the Liquid renderer).
Each file has five properties: <code>path</code>, <code>modified_time</code>, <code>name</code>, <code>basename</code> and <code>extname</code>.
Each file has three properties: <code>path</code>,
<code>modified_time</code> and <code>extname</code>.
</p></td>
</tr>

View File

@@ -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:
@@ -89,7 +30,7 @@ Now we can install Ruby. To do this we will use a repository from [BrightBox](ht
```sh
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.4 ruby2.4-dev build-essential dh-autoreconf
sudo apt-get install ruby2.3 ruby2.3-dev build-essential dh-autoreconf
```
Next let's update our Ruby gems:
@@ -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).

View File

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

View File

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

View 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!

View 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!

View 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!

View 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!

View 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!

View File

@@ -0,0 +1,14 @@
---
title: 'Jekyll 3.9.4 Released'
date: 2023-12-28 14:45:05 -0800
author: parkr
version: 3.9.4
categories: [release]
---
Hey Jekyllers!
This release, 3.9.4, is to bring Ruby 3.3 support to Jekyll. You can find
the details in [the changelog]({% link _docs/history.md %}#v3-9-4).
Happy Jekylling!

View File

@@ -0,0 +1,12 @@
---
title: 'Jekyll 3.9.5 Released'
date: 2024-02-12 20:24:21 -0800
author: parkr
version: 3.9.5
categories: [release]
---
This release allows `Jekyll::Page` objects to interact with
`Jekyll::Excerpt`. Previously, excerpts could only be generated for
documents (e.g. collection items like posts), so this brings Page objects
to parity.

View File

@@ -53,7 +53,7 @@ More info on configuring Apache Error Pages can found in [official documentation
The procedure is just as simple as configuring Apache servers, but slightly different.
The nginx configuration file depends on the system in which it is installed. In most systems, it is the `nginx.conf` file, which is usually located inside `/etc/nginx/` or `/etc/nginx/conf/`. However, in other systems like Ubuntu, you would have to look for a `default` nginx configuration file, containing server related information, which is usually located inside `/etc/nginx/sites-available/` or `/etc/nginx/sites-enabled/`. Add the following to your nginx configuration file, _i.e._ either to `nginx.conf` file or to `default` file:
Add the following to the nginx configuration file, `nginx.conf`, which is usually located inside `/etc/nginx/` or `/etc/nginx/conf/`:
```nginx
server {
@@ -63,11 +63,5 @@ server {
}
}
```
If the `server` block already exists, only add the code inside the `server` block given above.
The `location` directive prevents users from directly browsing the 404.html page.
More info on nginx error page can be found on [nginx official documentation](http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page).
<p class="note warning">
Proceed with caution while editing the configuration file.
</p>

View File

@@ -90,7 +90,7 @@ If you're storing your new site in version control, you'll want to ignore the
`./vendor/` and `./.bundle/` folders since they contain user- or
platform-specific information. New users will be able to install the correct
dependencies based on `Gemfile` and `Gemfile.lock`, which should both be checked
in. You can use this `.gitignore` to get started, if you want.
in. You can use this `.gitigonre` to get started, if you want.
**.gitignore**

View File

@@ -21,7 +21,7 @@ overview: true
</div>
<div class="unit one-third">
<h2>Static</h2>
<p><a href="https://daringfireball.net/projects/markdown/">Markdown</a>, <a href="https://github.com/Shopify/liquid/wiki">Liquid</a>, HTML <span class="amp">&amp;</span> CSS go in. Static sites come out ready for deployment.</p>
<p><a href="https://daringfireball.net/projects/markdown/">Markdown</a> (or <a href="http://redcloth.org/textile">Textile</a>), <a href="https://github.com/Shopify/liquid/wiki">Liquid</a>, HTML <span class="amp">&amp;</span> CSS go in. Static sites come out ready for deployment.</p>
<a href="/docs/templates/">Jekyll template guide &rarr;</a>
</div>
<div class="unit one-third">
@@ -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>

View File

@@ -1 +1 @@
3.8.3
3.9.4

View File

@@ -386,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 }}"

View File

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

View 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"

View File

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

View File

@@ -251,19 +251,6 @@ Feature: Post data
And I should see "Post categories: scifi and Movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
And I should see "Post categories: SciFi and movies" in "_site/scifi/movies/2013/03/17/star-trek.html"
Scenario: Use page.render_with_liquid variable
Given I have a _posts directory
And I have the following posts:
| title | render_with_liquid | date | content |
| Unrendered Post | false | 2017-07-06 | Hello {{ page.title }} |
| Rendered Post | true | 2017-07-06 | Hello {{ page.title }} |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should not see "Hello Unrendered Post" in "_site/2017/07/06/unrendered-post.html"
But I should see "Hello {{ page.title }}" in "_site/2017/07/06/unrendered-post.html"
And I should see "Hello Rendered Post" in "_site/2017/07/06/rendered-post.html"
Scenario Outline: Use page.path variable
Given I have a <dir>/_posts directory
And I have the following post in "<dir>":

View File

@@ -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 }}"

View File

@@ -65,6 +65,14 @@ Feature: Site configuration
And the "_site/Rakefile" file should not exist
And the "_site/README" file should not exist
Scenario: Use RDiscount for markup
Given I have an "index.markdown" page that contains "[Google](https://www.google.com)"
And I have a configuration file with "markdown" set to "rdiscount"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<a href=\"https://www.google.com\">Google</a>" in "_site/index.html"
Scenario: Use Kramdown 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 "kramdown"
@@ -73,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
@@ -187,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:

View File

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

View File

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

View File

@@ -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", ">= 0.9.5", "< 2")
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

View File

@@ -35,7 +35,7 @@ module Jekyll
def method_missing(method, *args, &blck)
if docs.respond_to?(method.to_sym)
Jekyll.logger.warn "Deprecation:",
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
Jekyll.logger.warn "", "Called by #{caller(0..0)}."
docs.public_send(method.to_sym, *args, &blck)
else
@@ -207,12 +207,18 @@ module Jekyll
@container ||= site.config["collections_dir"]
end
private
def read_document(full_path)
doc = Document.new(full_path, :site => site, :collection => self)
doc.read
docs << doc if site.unpublished || doc.published?
if site.unpublished || doc.published?
docs << doc
end
end
private
def read_static_file(file_path, full_path)
relative_dir = Jekyll.sanitized_path(
relative_directory,

View File

@@ -51,52 +51,28 @@ module Jekyll
# rubocop:disable Metrics/MethodLength
def add_build_options(cmd)
cmd.option "config", "--config CONFIG_FILE[,CONFIG_FILE2,...]",
Array, "Custom configuration file"
Array, "Custom configuration file"
cmd.option "destination", "-d", "--destination DESTINATION",
"The current folder will be generated into DESTINATION"
"The current folder will be generated into DESTINATION"
cmd.option "source", "-s", "--source SOURCE", "Custom source directory"
cmd.option "future", "--future", "Publishes posts with a future date"
cmd.option "limit_posts", "--limit_posts MAX_POSTS", Integer,
"Limits the number of posts to parse and publish"
"Limits the number of posts to parse and publish"
cmd.option "watch", "-w", "--[no-]watch", "Watch for changes and rebuild"
cmd.option "baseurl", "-b", "--baseurl URL",
"Serve the website from the given base URL"
"Serve the website from the given base URL"
cmd.option "force_polling", "--force_polling", "Force watch to use polling"
cmd.option "lsi", "--lsi", "Use LSI for improved related posts"
cmd.option "show_drafts", "-D", "--drafts", "Render posts in the _drafts folder"
cmd.option "unpublished", "--unpublished",
"Render posts that were marked as unpublished"
"Render posts that were marked as unpublished"
cmd.option "quiet", "-q", "--quiet", "Silence output."
cmd.option "verbose", "-V", "--verbose", "Print verbose output."
cmd.option "incremental", "-I", "--incremental", "Enable incremental rebuild."
cmd.option "strict_front_matter", "--strict_front_matter",
"Fail if errors are present in front matter"
"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

View File

@@ -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
@@ -31,14 +31,14 @@ module Jekyll
if options.fetch("skip_initial_build", false)
Jekyll.logger.warn "Build Warning:", "Skipping the initial build." \
" This may result in an out-of-date site."
" This may result in an out-of-date site."
else
build(site, options)
end
if options.fetch("detach", false)
Jekyll.logger.info "Auto-regeneration:",
"disabled when running server detached."
"disabled when running server detached."
elsif options.fetch("watch", false)
watch(site, options)
else
@@ -60,7 +60,7 @@ module Jekyll
Jekyll.logger.info "Source:", source
Jekyll.logger.info "Destination:", destination
Jekyll.logger.info "Incremental build:",
(incremental ? "enabled" : "disabled. Enable with --incremental")
(incremental ? "enabled" : "disabled. Enable with --incremental")
Jekyll.logger.info "Generating..."
process_site(site)
Jekyll.logger.info "", "done in #{(Time.now - t).round(3)} seconds."
@@ -76,12 +76,12 @@ module Jekyll
# Warn Windows users that they might need to upgrade.
if Utils::Platforms.bash_on_windows?
Jekyll.logger.warn "",
"Auto-regeneration may not work on some Windows versions."
"Auto-regeneration may not work on some Windows versions."
Jekyll.logger.warn "",
"Please see: https://github.com/Microsoft/BashOnWindows/issues/216"
"Please see: https://github.com/Microsoft/BashOnWindows/issues/216"
Jekyll.logger.warn "",
"If it does not work, please upgrade Bash on Windows or "\
"run Jekyll with --no-watch."
"If it does not work, please upgrade Bash on Windows or "\
"run Jekyll with --no-watch."
end
External.require_with_graceful_fail "jekyll-watch"

View File

@@ -11,7 +11,7 @@ module Jekyll
c.alias(:hyde)
c.option "config", "--config CONFIG_FILE[,CONFIG_FILE2,...]", Array,
"Custom configuration file"
"Custom configuration file"
c.action do |_, options|
Jekyll::Commands::Doctor.process(options)
@@ -48,18 +48,19 @@ module Jekyll
posts_at_root = site.in_source_dir("_posts")
return true unless File.directory?(posts_at_root)
Jekyll.logger.warn "Warning:",
"Detected '_posts' directory outside custom `collections_dir`!"
"Detected '_posts' directory outside custom `collections_dir`!"
Jekyll.logger.warn "",
"Please move '#{posts_at_root}' into the custom directory at " \
"Please move '#{posts_at_root}' into the custom directory at " \
"'#{site.in_source_dir(site.config["collections_dir"])}'"
false
end
def deprecated_relative_permalinks(site)
if site.config["relative_permalinks"]
Jekyll::Deprecator.deprecation_message "Your site still uses relative permalinks," \
" which was removed in Jekyll v3.0.0."
true
Jekyll::Deprecator.deprecation_message "Your site still uses relative" \
" permalinks, which was removed in" \
" Jekyll v3.0.0."
return true
end
end
@@ -116,7 +117,6 @@ module Jekyll
end
private
def collect_urls(urls, things, destination)
things.each do |thing|
dest = thing.destination(destination)

View File

@@ -25,7 +25,7 @@ module Jekyll
def invalid_command(prog, cmd)
Jekyll.logger.error "Error:",
"Hmm... we don't know what the '#{cmd}' command is."
"Hmm... we don't know what the '#{cmd}' command is."
Jekyll.logger.info "Valid commands:", prog.commands.keys.join(", ")
end
end

View File

@@ -62,32 +62,49 @@ module Jekyll
private
def gemfile_contents
<<~RUBY
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> #{Jekyll::VERSION}"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
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]
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
<<-RUBY
source "https://rubygems.org"
RUBY
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> #{Jekyll::VERSION}"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# 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", :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
def create_site(new_blog_path)

View File

@@ -2,41 +2,39 @@
require "erb"
module Jekyll
module Commands
class NewTheme < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:"new-theme") do |c|
c.syntax "new-theme NAME"
c.description "Creates a new Jekyll theme scaffold"
c.option "code_of_conduct", \
"-c", "--code-of-conduct", \
"Include a Code of Conduct. (defaults to false)"
class Jekyll::Commands::NewTheme < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:"new-theme") do |c|
c.syntax "new-theme NAME"
c.description "Creates a new Jekyll theme scaffold"
c.option "code_of_conduct", \
"-c", "--code-of-conduct", \
"Include a Code of Conduct. (defaults to false)"
c.action do |args, opts|
Jekyll::Commands::NewTheme.process(args, opts)
end
end
c.action do |args, opts|
Jekyll::Commands::NewTheme.process(args, opts)
end
# rubocop:disable Metrics/AbcSize
def process(args, opts)
if !args || args.empty?
raise Jekyll::Errors::InvalidThemeName, "You must specify a theme name."
end
new_theme_name = args.join("_")
theme = Jekyll::ThemeBuilder.new(new_theme_name, opts)
Jekyll.logger.abort_with "Conflict:", "#{theme.path} already exists." if theme.path.exist?
theme.create!
Jekyll.logger.info "Your new Jekyll theme, #{theme.name.cyan}," \
" is ready for you in #{theme.path.to_s.cyan}!"
Jekyll.logger.info "For help getting started, read #{theme.path}/README.md."
end
# rubocop:enable Metrics/AbcSize
end
end
# rubocop:disable Metrics/AbcSize
def process(args, opts)
if !args || args.empty?
raise Jekyll::Errors::InvalidThemeName, "You must specify a theme name."
end
new_theme_name = args.join("_")
theme = Jekyll::ThemeBuilder.new(new_theme_name, opts)
if theme.path.exist?
Jekyll.logger.abort_with "Conflict:", "#{theme.path} already exists."
end
theme.create!
Jekyll.logger.info "Your new Jekyll theme, #{theme.name.cyan}," \
" is ready for you in #{theme.path.to_s.cyan}!"
Jekyll.logger.info "For help getting started, read #{theme.path}/README.md."
end
# rubocop:enable Metrics/AbcSize
end
end

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "thread"
module Jekyll
module Commands
class Serve < Command
@@ -17,28 +19,25 @@ module Jekyll
"host" => ["host", "-H", "--host [HOST]", "Host to bind to"],
"open_url" => ["-o", "--open-url", "Launch your site in a browser"],
"detach" => ["-B", "--detach",
"Run the server in the background",],
"Run the server in the background",],
"ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."],
"port" => ["-P", "--port [PORT]", "Port to listen on"],
"show_dir_listing" => ["--show-dir-listing",
"Show a directory listing instead of loading" \
" your index file.",],
"Show a directory listing instead of loading your index file.",],
"skip_initial_build" => ["skip_initial_build", "--skip-initial-build",
"Skips the initial site build which occurs before" \
" the server is started.",],
"Skips the initial site build which occurs before the server is started.",],
"livereload" => ["-l", "--livereload",
"Use LiveReload to automatically refresh browsers",],
"Use LiveReload to automatically refresh browsers",],
"livereload_ignore" => ["--livereload-ignore ignore GLOB1[,GLOB2[,...]]",
Array,
"Files for LiveReload to ignore. " \
"Remember to quote the values so your shell " \
"won't expand them",],
Array,
"Files for LiveReload to ignore. Remember to quote the values so your shell "\
"won't expand them",],
"livereload_min_delay" => ["--livereload-min-delay [SECONDS]",
"Minimum reload delay",],
"Minimum reload delay",],
"livereload_max_delay" => ["--livereload-max-delay [SECONDS]",
"Maximum reload delay",],
"Maximum reload delay",],
"livereload_port" => ["--livereload-port [PORT]", Integer,
"Port for LiveReload to listen on",],
"Port for LiveReload to listen on",],
}.freeze
DIRECTORY_INDEX = %w(
@@ -73,28 +72,33 @@ 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"]
if opts["livereload"]
validate_options(opts)
register_reload_hooks(opts)
end
register_reload_hooks(opts) if opts["livereload"]
setup(destination)
start_up_webrick(opts, destination)
@@ -107,12 +111,11 @@ module Jekyll
# Perform logical validation of CLI options
private
def validate_options(opts)
if opts["livereload"]
if opts["detach"]
Jekyll.logger.warn "Warning:", "--detach and --livereload are mutually exclusive." \
" Choosing --livereload"
Jekyll.logger.warn "Warning:",
"--detach and --livereload are mutually exclusive. Choosing --livereload"
opts["detach"] = false
end
if opts["ssl_cert"] || opts["ssl_key"]
@@ -127,15 +130,18 @@ module Jekyll
opts["watch"] = true
end
elsif %w(livereload_min_delay
livereload_max_delay
livereload_ignore
livereload_port).any? { |o| opts[o] }
livereload_max_delay
livereload_ignore
livereload_port).any? { |o| opts[o] }
Jekyll.logger.abort_with "--livereload-min-delay, "\
"--livereload-max-delay, --livereload-ignore, and "\
"--livereload-port require the --livereload option."
end
end
#
private
# rubocop:disable Metrics/AbcSize
def register_reload_hooks(opts)
require_relative "serve/live_reload_reactor"
@@ -173,6 +179,7 @@ module Jekyll
# when we get ready to party, checking for an setting up an error page
# and making sure our destination exists.
private
def setup(destination)
require_relative "serve/servlet"
@@ -187,11 +194,15 @@ module Jekyll
end
end
#
private
def webrick_opts(opts)
opts = {
:JekyllOptions => opts,
:DoNotReverseLookup => true,
:MimeTypes => mime_types,
:MimeTypesCharset => mime_types_charset,
:DocumentRoot => opts["destination"],
:StartCallback => start_callback(opts["detach"]),
:StopCallback => stop_callback(opts["detach"]),
@@ -207,8 +218,13 @@ module Jekyll
opts
end
#
private
def start_up_webrick(opts, destination)
@reload_reactor.start(opts) if opts["livereload"]
if opts["livereload"]
@reload_reactor.start(opts)
end
@server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
@server.mount(opts["baseurl"].to_s, Servlet, destination, file_handler_opts)
@@ -219,15 +235,20 @@ module Jekyll
end
# Recreate NondisclosureName under utf-8 circumstance
private
def file_handler_opts
WEBrick::Config::FileHandler.merge(
WEBrick::Config::FileHandler.merge({
:FancyIndexing => true,
:NondisclosureName => [
".ht*", "~*",
]
)
],
})
end
#
private
def server_address(server, options = {})
format_url(
server.config[:SSLEnable],
@@ -237,14 +258,19 @@ module Jekyll
)
end
private
def format_url(ssl_enabled, address, port, baseurl = nil)
format("%<prefix>s://%<address>s:%<port>i%<baseurl>s",
:prefix => ssl_enabled ? "https" : "http",
:address => address,
:port => port,
:baseurl => baseurl ? "#{baseurl}/" : "")
format("%<prefix>s://%<address>s:%<port>i%<baseurl>s", {
:prefix => ssl_enabled ? "https" : "http",
:address => address,
:port => port,
:baseurl => baseurl ? "#{baseurl}/" : "",
})
end
#
private
def default_url(opts)
config = configuration_from_options(opts)
format_url(
@@ -254,6 +280,9 @@ module Jekyll
)
end
#
private
def launch_browser(server, opts)
address = server_address(server, opts)
return system "start", address if Utils::Platforms.windows?
@@ -266,6 +295,8 @@ module Jekyll
# Keep in our area with a thread or detach the server as requested
# by the user. This method determines what we do based on what you
# ask us to do.
private
def boot_or_detach(server, opts)
if opts["detach"]
pid = Process.fork do
@@ -274,8 +305,7 @@ module Jekyll
Process.detach(pid)
Jekyll.logger.info "Server detached with pid '#{pid}'.", \
"Run `pkill -f jekyll' or `kill -9 #{pid}'" \
" to stop the server."
"Run `pkill -f jekyll' or `kill -9 #{pid}' to stop the server."
else
t = Thread.new { server.start }
trap("INT") { server.shutdown }
@@ -284,6 +314,8 @@ module Jekyll
end
# Make the stack verbose if the user requests it.
private
def enable_logging(opts)
opts[:AccessLog] = []
level = WEBrick::Log.const_get(opts[:JekyllOptions]["verbose"] ? :DEBUG : :WARN)
@@ -293,6 +325,8 @@ module Jekyll
# Add SSL to the stack if the user triggers --enable-ssl and they
# provide both types of certificates commonly needed. Raise if they
# forget to add one of the certificates.
private
def enable_ssl(opts)
cert, key, src =
opts[:JekyllOptions].values_at("ssl_cert", "ssl_key", "source")
@@ -308,12 +342,13 @@ module Jekyll
opts[:SSLEnable] = true
end
private
def start_callback(detached)
unless detached
proc do
mutex.synchronize do
# Block until EventMachine reactor starts
@reload_reactor&.started_event&.wait
@reload_reactor.started_event.wait unless @reload_reactor.nil?
@running = true
Jekyll.logger.info("Server running...", "press ctrl-c to stop.")
@run_cond.broadcast
@@ -322,6 +357,7 @@ module Jekyll
end
end
private
def stop_callback(detached)
unless detached
proc do
@@ -337,11 +373,18 @@ module Jekyll
end
end
private
def mime_types
file = File.expand_path("../mime.types", __dir__)
WEBrick::HTTPUtils.load_mime_types(file)
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

View File

@@ -58,7 +58,7 @@ module Jekyll
EM.add_shutdown_hook { @stopped_event.set }
Jekyll.logger.info "LiveReload address:",
"http://#{opts["host"]}:#{opts["livereload_port"]}"
"http://#{opts["host"]}:#{opts["livereload_port"]}"
end
end
@thread.abort_on_exception = true
@@ -68,11 +68,11 @@ module Jekyll
# http://feedback.livereload.com/knowledgebase/articles/86174-livereload-protocol
def reload(pages)
pages.each do |p|
json_message = JSON.dump(
json_message = JSON.dump({
:command => "reload",
:path => p.url,
:liveCSS => true
)
:liveCSS => true,
})
Jekyll.logger.debug "LiveReload:", "Reloading #{p.url}"
Jekyll.logger.debug "", json_message
@@ -81,7 +81,6 @@ module Jekyll
end
private
def connect(websocket, handshake)
@connections_count += 1
if @connections_count == 1
@@ -100,17 +99,22 @@ module Jekyll
@websockets << websocket
end
private
def disconnect(websocket)
@websockets.delete(websocket)
end
private
def print_message(json_message)
msg = JSON.parse(json_message)
# Not sure what the 'url' command even does in LiveReload. The spec is silent
# on its purpose.
Jekyll.logger.info "LiveReload:", "Browser URL: #{msg["url"]}" if msg["command"] == "url"
if msg["command"] == "url"
Jekyll.logger.info "LiveReload:", "Browser URL: #{msg["url"]}"
end
end
private
def log_error(error)
Jekyll.logger.error "LiveReload experienced an error. " \
"Run with --trace for more information."

View 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"
}

View File

@@ -121,7 +121,9 @@ module Jekyll
if @options["livereload_max_delay"]
src += "&amp;maxdelay=#{@options["livereload_max_delay"]}"
end
src += "&amp;port=#{@options["livereload_port"]}" if @options["livereload_port"]
if @options["livereload_port"]
src += "&amp;port=#{@options["livereload_port"]}"
end
src
end
end
@@ -135,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
@@ -170,7 +173,7 @@ module Jekyll
end
end
validate_and_ensure_charset(req, res)
conditionally_inject_charset(res)
res.header.merge!(@headers)
rtn
end
@@ -178,15 +181,20 @@ module Jekyll
private
def validate_and_ensure_charset(_req, res)
key = res.header.keys.grep(%r!content-type!i).first
typ = res.header[key]
#
# 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)
unless typ =~ %r!;\s*charset=!
res.header[key] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
end
res.header["content-type"] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
end
#
def set_defaults
hash_ = @jekyll_opts.fetch("webrick", {}).fetch("headers", {})
DEFAULTS.each_with_object(@headers = hash_) do |(key, val), hash|

View File

@@ -66,6 +66,14 @@ module Jekyll
"strict_variables" => false,
},
"rdiscount" => {
"extensions" => [],
},
"redcarpet" => {
"extensions" => [],
},
"kramdown" => {
"auto_ids" => true,
"toc_levels" => "1..6",
@@ -73,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,
},
@@ -278,7 +287,6 @@ module Jekyll
end
private
def style_to_permalink(permalink_style)
case permalink_style.to_sym
when :pretty
@@ -300,12 +308,14 @@ module Jekyll
# file - the file from which the config was extracted
#
# Raises an ArgumentError if given config is not a hash
private
def check_config_is_hash!(extracted_config, file)
unless extracted_config.is_a?(Hash)
raise ArgumentError, "Configuration file: (INVALID) #{file}".yellow
end
end
private
def check_auto(config)
if config.key?("auto") || config.key?("watch")
Jekyll::Deprecator.deprecation_message "Auto-regeneration can no longer" \
@@ -316,6 +326,7 @@ module Jekyll
end
end
private
def check_server(config)
if config.key?("server")
Jekyll::Deprecator.deprecation_message "The 'server' configuration option" \
@@ -325,6 +336,7 @@ module Jekyll
end
end
private
def check_pygments(config)
if config.key?("pygments")
Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" \
@@ -337,6 +349,7 @@ module Jekyll
end
end
private
def check_include_exclude(config)
%w(include exclude).each do |option|
if config[option].is_a?(String)
@@ -346,10 +359,11 @@ module Jekyll
" as a list of comma-separated values."
config[option] = csv_to_array(config[option])
end
config[option]&.map!(&:to_s)
config[option].map!(&:to_s) if config[option]
end
end
private
def check_coderay(config)
if (config["kramdown"] || {}).key?("use_coderay")
Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" \
@@ -358,6 +372,7 @@ module Jekyll
end
end
private
def check_maruku(config)
if config.fetch("markdown", "kramdown").to_s.casecmp("maruku").zero?
Jekyll.logger.abort_with "Error:", "You're using the 'maruku' " \
@@ -374,6 +389,7 @@ module Jekyll
#
# Raises a Jekyll::Errors::InvalidConfigurationError if the config `plugins`
# is a string
private
def check_plugins(config)
if config.key?("plugins") && config["plugins"].is_a?(String)
Jekyll.logger.error "Configuration Error:", "You specified the" \
@@ -381,8 +397,8 @@ module Jekyll
" use an array instead. If you wanted to set the directory of your" \
" plugins, use the config key `plugins_dir` instead."
raise Jekyll::Errors::InvalidConfigurationError,
"'plugins' should not be a string, but was: " \
"#{config["plugins"].inspect}. Use 'plugins_dir' instead."
"'plugins' should not be a string, but was: " \
"#{config["plugins"].inspect}. Use 'plugins_dir' instead."
end
end
end

View File

@@ -11,7 +11,9 @@ module Jekyll
return if @setup ||= false
unless (@parser = get_processor)
Jekyll.logger.error "Invalid Markdown processor given:", @config["markdown"]
Jekyll.logger.info "", "Custom processors are not loaded in safe mode" if @config["safe"]
if @config["safe"]
Jekyll.logger.info "", "Custom processors are not loaded in safe mode"
end
Jekyll.logger.error(
"",
"Available processors are: #{valid_processors.join(", ")}"
@@ -28,7 +30,9 @@ module Jekyll
# rubocop:disable Naming/AccessorMethodName
def get_processor
case @config["markdown"].downcase
when "kramdown" then KramdownParser.new(@config)
when "redcarpet" then return RedcarpetParser.new(@config)
when "kramdown" then return KramdownParser.new(@config)
when "rdiscount" then return RDiscountParser.new(@config)
else
custom_processor
end
@@ -40,7 +44,7 @@ module Jekyll
# are not in safe mode.)
def valid_processors
%w(kramdown) + third_party_processors
%w(rdiscount kramdown redcarpet) + third_party_processors
end
# Public: A list of processors that you provide via plugins.
@@ -49,7 +53,7 @@ module Jekyll
def third_party_processors
self.class.constants - \
%w(KramdownParser PRIORITIES).map(
%w(KramdownParser RDiscountParser RedcarpetParser PRIORITIES).map(
&:to_sym
)
end
@@ -74,10 +78,11 @@ module Jekyll
end
private
def custom_processor
converter_name = @config["markdown"]
self.class.const_get(converter_name).new(@config) if custom_class_allowed?(converter_name)
if custom_class_allowed?(converter_name)
self.class.const_get(converter_name).new(@config)
end
end
# Private: Determine whether a class name is an allowed custom
@@ -87,6 +92,8 @@ module Jekyll
#
# Returns true if the parser name contains only alphanumeric
# characters and is defined within Jekyll::Converters::Markdown
private
def custom_class_allowed?(parser_name)
parser_name !~ %r![^A-Za-z0-9_]! && self.class.constants.include?(
parser_name.to_sym

View File

@@ -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
@@ -48,6 +51,23 @@ module Jekyll
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]
@@ -60,6 +80,8 @@ module Jekyll
# config[highlighter]
# Where `enable_coderay` is now deprecated because Kramdown
# supports Rouge now too.
private
def highlighter
return @highlighter if @highlighter
@@ -83,6 +105,7 @@ module Jekyll
end
end
private
def strip_coderay_prefix(hash)
hash.each_with_object({}) do |(key, val), hsh|
cleaned_key = key.to_s.gsub(%r!\Acoderay_!, "")
@@ -100,6 +123,8 @@ module Jekyll
# If our highlighter is CodeRay we go in to merge the CodeRay defaults
# with your "coderay" key if it's there, deprecating it in the
# process of you using it.
private
def modernize_coderay_config
unless @config["coderay"].empty?
Jekyll::Deprecator.deprecation_message(

View File

@@ -0,0 +1,37 @@
# frozen_string_literal: true
module Jekyll
module Converters
class Markdown
class RDiscountParser
def initialize(config)
unless defined?(RDiscount)
Jekyll::External.require_with_graceful_fail "rdiscount"
end
@config = config
@rdiscount_extensions = @config["rdiscount"]["extensions"].map(&:to_sym)
end
def convert(content)
rd = RDiscount.new(content, *@rdiscount_extensions)
html = rd.to_html
if @config["rdiscount"]["toc_token"]
html = replace_generated_toc(rd, html, @config["rdiscount"]["toc_token"])
end
html
end
private
def replace_generated_toc(rd_instance, html, toc_token)
if rd_instance.generate_toc && html.include?(toc_token)
utf8_toc = rd_instance.toc_content
utf8_toc.force_encoding("utf-8") if utf8_toc.respond_to?(:force_encoding)
html.gsub(toc_token, utf8_toc)
else
html
end
end
end
end
end
end

View 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

View File

@@ -1,20 +1,16 @@
# frozen_string_literal: true
module Kramdown
module Parser
class SmartyPants < Kramdown::Parser::Kramdown
def initialize(source, options)
super
@block_parsers = [:block_html, :content]
@span_parsers = [:smart_quotes, :html_entity, :typographic_syms, :span_html]
end
def parse_content
add_text @src.scan(%r!\A.*\n!)
end
define_parser(:content, %r!\A!)
end
class Kramdown::Parser::SmartyPants < Kramdown::Parser::Kramdown
def initialize(source, options)
super
@block_parsers = [:block_html, :content]
@span_parsers = [:smart_quotes, :html_entity, :typographic_syms, :span_html]
end
def parse_content
add_text @src.scan(%r!\A.*\n!)
end
define_parser(:content, %r!\A!)
end
module Jekyll
@@ -24,7 +20,9 @@ module Jekyll
priority :low
def initialize(config)
Jekyll::External.require_with_graceful_fail "kramdown" unless defined?(Kramdown)
unless defined?(Kramdown)
Jekyll::External.require_with_graceful_fail "kramdown"
end
@config = config["kramdown"].dup || {}
@config[:input] = :SmartyPants
end

View File

@@ -39,17 +39,17 @@ 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))
end
rescue Psych::SyntaxError => e
Jekyll.logger.warn "YAML Exception reading #{filename}: #{e.message}"
raise e if site.config["strict_front_matter"]
raise e if self.site.config["strict_front_matter"]
rescue StandardError => e
Jekyll.logger.warn "Error reading file #{filename}: #{e.message}"
raise e if site.config["strict_front_matter"]
raise e if self.site.config["strict_front_matter"]
end
self.data ||= {}
@@ -64,12 +64,12 @@ module Jekyll
def validate_data!(filename)
unless self.data.is_a?(Hash)
raise Errors::InvalidYAMLFrontMatterError,
"Invalid YAML front matter in #{filename}"
"Invalid YAML front matter in #{filename}"
end
end
def validate_permalink!(filename)
if self.data["permalink"]&.to_s&.empty?
if self.data["permalink"] && self.data["permalink"].to_s.empty?
raise Errors::InvalidPermalinkError, "Invalid permalink in #{filename}"
end
end
@@ -125,12 +125,16 @@ module Jekyll
#
# Returns the type of self.
def type
:pages if is_a?(Page)
if is_a?(Page)
:pages
end
end
# returns the owner symbol for hook triggering
def hook_owner
:pages if is_a?(Page)
if is_a?(Page)
:pages
end
end
# Determine whether the document is an asset file.
@@ -160,7 +164,6 @@ module Jekyll
#
# Returns true if the file has Liquid Tags or Variables, false otherwise.
def render_with_liquid?
return false if data["render_with_liquid"] == false
Jekyll::Utils.has_liquid_construct?(content)
end
@@ -178,7 +181,7 @@ module Jekyll
#
# Returns true if the layout is invalid, false if otherwise
def invalid_layout?(layout)
!data["layout"].nil? && layout.nil? && !(is_a? Jekyll::Excerpt)
!data["layout"].nil? && layout.nil? && !(self.is_a? Jekyll::Excerpt)
end
# Recursively render layouts
@@ -207,7 +210,7 @@ module Jekyll
renderer.payload = payload
end.run
Jekyll.logger.debug "Post-Render Hooks:", relative_path
Jekyll.logger.debug "Post-Render Hooks:", self.relative_path
Jekyll::Hooks.trigger hook_owner, :post_render, self
ensure
@_renderer = nil # this will allow the modifications above to disappear

View File

@@ -34,7 +34,9 @@ module Jekyll
end
def arg_is_present?(args, deprecated_argument, message)
deprecation_message(message) if args.include?(deprecated_argument)
if args.include?(deprecated_argument)
deprecation_message(message)
end
end
def deprecation_message(message)

View File

@@ -159,7 +159,6 @@ module Jekyll
# or if the document doesn't contain any Liquid Tags or Variables,
# true otherwise.
def render_with_liquid?
return false if data["render_with_liquid"] == false
!(coffeescript_file? || yaml_file? || !Utils.has_liquid_construct?(content))
end
@@ -205,11 +204,11 @@ module Jekyll
#
# Returns the computed URL for the document.
def url
@url ||= URL.new(
@url ||= URL.new({
:template => url_template,
:placeholders => url_placeholders,
:permalink => permalink
).to_s
:permalink => permalink,
}).to_s
end
def [](key)
@@ -267,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)
@@ -316,7 +315,7 @@ module Jekyll
# method returns true, and if the site's Publisher will publish the document.
# False otherwise.
def write?
collection&.write? && site.publisher.publish?(self)
collection && collection.write? && site.publisher.publish?(self)
end
# The Document excerpt_separator, from the YAML Front-Matter or site
@@ -336,12 +335,16 @@ module Jekyll
def next_doc
pos = collection.docs.index { |post| post.equal?(self) }
collection.docs[pos + 1] if pos && pos < collection.docs.length - 1
if pos && pos < collection.docs.length - 1
collection.docs[pos + 1]
end
end
def previous_doc
pos = collection.docs.index { |post| post.equal?(self) }
collection.docs[pos - 1] if pos && pos.positive?
if pos && pos > 0
collection.docs[pos - 1]
end
end
def trigger_hooks(hook_name, *args)
@@ -397,30 +400,32 @@ module Jekyll
end
def populate_categories
merge_data!(
merge_data!({
"categories" => (
Array(data["categories"]) + Utils.pluralized_array_from_hash(
data, "category", "categories"
)
).map(&:to_s).flatten.uniq
)
).map(&:to_s).flatten.uniq,
})
end
def populate_tags
merge_data!(
"tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten
)
merge_data!({
"tags" => Utils.pluralized_array_from_hash(data, "tag", "tags").flatten,
})
end
private
def merge_categories!(other)
if other.key?("categories") && !other["categories"].nil?
other["categories"] = other["categories"].split if other["categories"].is_a?(String)
if other["categories"].is_a?(String)
other["categories"] = other["categories"].split
end
other["categories"] = (data["categories"] || []) | other["categories"]
end
end
private
def merge_date!(source)
if data.key?("date")
data["date"] = Utils.parse_date(
@@ -430,6 +435,7 @@ module Jekyll
end
end
private
def merge_defaults
defaults = @site.frontmatter_defaults.all(
relative_path,
@@ -438,8 +444,9 @@ module Jekyll
merge_data!(defaults, :source => "front matter defaults") unless defaults.empty?
end
def read_content(opts)
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
private
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))
@@ -447,6 +454,7 @@ module Jekyll
end
end
private
def read_post_data
populate_title
populate_categories
@@ -454,6 +462,7 @@ module Jekyll
generate_excerpt
end
private
def handle_read_error(error)
if error.is_a? Psych::SyntaxError
Jekyll.logger.error "Error:", "YAML Exception reading #{path}: #{error.message}"
@@ -466,6 +475,7 @@ module Jekyll
end
end
private
def populate_title
if relative_path =~ DATE_FILENAME_MATCHER
date, slug, ext = Regexp.last_match.captures
@@ -481,14 +491,18 @@ module Jekyll
data["ext"] ||= ext
end
private
def modify_date(date)
if !data["date"] || data["date"].to_i == site.time.to_i
merge_data!({ "date" => date }, :source => "filename")
end
end
private
def generate_excerpt
data["excerpt"] ||= Jekyll::Excerpt.new(self) if generate_excerpt?
if generate_excerpt?
data["excerpt"] ||= Jekyll::Excerpt.new(self)
end
end
end
end

View File

@@ -7,8 +7,9 @@ module Jekyll
mutable false
def_delegator :@obj, :write?, :output
def_delegators :@obj, :label, :docs, :files, :directory, :relative_directory
def_delegator :@obj, :write?, :output
def_delegators :@obj, :label, :docs, :files, :directory,
:relative_directory
private def_delegator :@obj, :metadata, :fallback_data

View File

@@ -15,7 +15,11 @@ module Jekyll
#
# Returns the mutability of the class
def self.mutable(is_mutable = nil)
@is_mutable = is_mutable || false
@is_mutable = if is_mutable
is_mutable
else
false
end
end
def self.mutable?
@@ -169,7 +173,7 @@ module Jekyll
end
def merge(other, &block)
dup.tap do |me|
self.dup.tap do |me|
if block.nil?
me.merge!(other)
else

View File

@@ -8,7 +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
@@ -38,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.

View File

@@ -17,7 +17,6 @@ module Jekyll
end
private
def fallback_data
@fallback_data ||= {}
end

View File

@@ -80,7 +80,6 @@ module Jekyll
end
private
def fallback_data
{}
end

View File

@@ -31,7 +31,12 @@ module Jekyll
def filter(entries)
entries.reject do |e|
special?(e) || backup?(e) || excluded?(e) || symlink?(e) unless included?(e)
# 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

View File

@@ -8,11 +8,10 @@ module Jekyll
attr_accessor :content, :ext
attr_writer :output
def_delegators :@doc,
:site, :name, :ext, :extname,
:collection, :related_posts,
:coffeescript_file?, :yaml_file?,
:url, :next_doc, :previous_doc
def_delegators :@doc, :site, :name, :ext, :extname,
:collection, :related_posts,
:coffeescript_file?, :yaml_file?,
:url, :next_doc, :previous_doc
private :coffeescript_file?, :yaml_file?
@@ -49,14 +48,14 @@ 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
#
# Returns true if the string passed in
def include?(something)
(output&.include?(something)) || content.include?(something)
(output && output.include?(something)) || content.include?(something)
end
# The UID for this doc (useful in feeds).
@@ -77,7 +76,7 @@ module Jekyll
# Returns the shorthand String identifier of this doc.
def inspect
"<Excerpt: #{id}>"
"<Excerpt: #{self.id}>"
end
def output
@@ -129,50 +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."
"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

View File

@@ -9,7 +9,6 @@ module Jekyll
#
def blessed_gems
%w(
jekyll-compose
jekyll-docs
jekyll-import
)
@@ -58,13 +57,13 @@ module Jekyll
Jekyll.logger.debug "Requiring:", name.to_s
require name
rescue LoadError => e
Jekyll.logger.error "Dependency Error:", <<~MSG
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
In order to use Jekyll as currently configured, you'll need to install this gem.
Jekyll.logger.error "Dependency Error:", <<-MSG
Yikes! It looks like you don't have #{name} or one of its dependencies installed.
In order to use Jekyll as currently configured, you'll need to install this gem.
The full error message from Ruby is: '#{e.message}'
The full error message from Ruby is: '#{e.message}'
If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
MSG
raise Jekyll::Errors::MissingDependencyException, name
end

View File

@@ -225,7 +225,9 @@ module Jekyll
#
# Returns the filtered array of objects
def sort(input, property = nil, nils = "first")
raise ArgumentError, "Cannot sort a null object." if input.nil?
if input.nil?
raise ArgumentError, "Cannot sort a null object."
end
if property.nil?
input.sort
else
@@ -299,40 +301,35 @@ module Jekyll
# We also utilize the Schwartzian transform to make this more efficient.
def sort_input(input, property, order)
input.map { |item| [item_property(item, property), item] }
.sort! do |a_info, b_info|
a_property = a_info.first
b_property = b_info.first
.sort! do |apple_info, orange_info|
apple_property = apple_info.first
orange_property = orange_info.first
if !a_property.nil? && b_property.nil?
if !apple_property.nil? && orange_property.nil?
- order
elsif a_property.nil? && !b_property.nil?
elsif apple_property.nil? && !orange_property.nil?
+ order
else
a_property <=> b_property || a_property.to_s <=> b_property.to_s
apple_property <=> orange_property
end
end
.map!(&:last)
end
private
def item_property(item, property)
if item.respond_to?(:to_liquid)
property.to_s.split(".").reduce(item.to_liquid) do |subvalue, attribute|
parse_sort_input(subvalue[attribute])
subvalue[attribute]
end
elsif item.respond_to?(:data)
parse_sort_input(item.data[property.to_s])
item.data[property.to_s]
else
parse_sort_input(item[property.to_s])
item[property.to_s]
end
end
# return numeric values as numbers for proper sorting
def parse_sort_input(property)
number_like = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!
return property.to_f if property =~ number_like
property
end
private
def as_liquid(item)
case item
when Hash
@@ -356,6 +353,7 @@ module Jekyll
end
# Parse a string to a Liquid Condition
private
def parse_condition(exp)
parser = Liquid::Parser.new(exp)
left_expr = parser.expression
@@ -372,6 +370,7 @@ module Jekyll
condition
end
end
end

View File

@@ -64,7 +64,6 @@ module Jekyll
end
private
# month_type: Notations that evaluate to 'Month' via `Time#strftime` ("%b", "%B")
# type: nil (default) or "ordinal"
# style: nil (default) or "US"
@@ -82,6 +81,7 @@ module Jekyll
time.strftime("%d #{month_type} %Y")
end
private
def ordinal(number)
return "th" if (11..13).cover?(number)
@@ -93,11 +93,12 @@ module Jekyll
end
end
private
def time(input)
date = Liquid::Utils.to_date(input)
unless date.respond_to?(:to_time)
raise Errors::InvalidDateError,
"Invalid Date: '#{input.inspect}' is not a valid datetime."
"Invalid Date: '#{input.inspect}' is not a valid datetime."
end
date.to_time.dup.localtime
end

View File

@@ -41,15 +41,16 @@ module Jekyll
end
private
def parse_expression(str)
Liquid::Variable.new(str, Liquid::ParseContext.new)
end
private
def groupable?(element)
element.respond_to?(:group_by)
end
private
def grouped_array(groups)
groups.each_with_object([]) do |item, array|
array << {

View File

@@ -57,6 +57,7 @@ module Jekyll
return input if input.nil? || input.empty? || input.start_with?("/")
"/#{input}"
end
end
end
end

View File

@@ -122,7 +122,9 @@ module Jekyll
def path_is_subpath?(path, parent_path)
path.ascend do |ascended_path|
return true if ascended_path.to_s == parent_path.to_s
if ascended_path.to_s == parent_path.to_s
return true
end
end
false

View File

@@ -77,7 +77,9 @@ module Jekyll
"following hooks #{@registry[owner].keys.inspect}"
end
raise Uncallable, "Hooks must respond to :call" unless block.respond_to? :call
unless block.respond_to? :call
raise Uncallable, "Hooks must respond to :call"
end
insert_hook owner, event, priority, &block
end

View File

@@ -2,6 +2,7 @@
module Jekyll
module LiquidExtensions
# Lookup a Liquid variable in the given context.
#
# context - the Liquid context in question.
@@ -18,5 +19,6 @@ module Jekyll
lookup || variable
end
end
end

View File

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

View File

@@ -1,98 +1,96 @@
# frozen_string_literal: true
module Jekyll
class LiquidRenderer
class Table
def initialize(stats)
@stats = stats
class LiquidRenderer::Table
def initialize(stats)
@stats = stats
end
def to_s(num_of_rows = 50)
data = data_for_table(num_of_rows)
widths = table_widths(data)
generate_table(data, widths)
end
private
def generate_table(data, widths)
str = String.new("\n")
table_head = data.shift
str << generate_row(table_head, widths)
str << generate_table_head_border(table_head, widths)
data.each do |row_data|
str << generate_row(row_data, widths)
end
def to_s(num_of_rows = 50)
data = data_for_table(num_of_rows)
widths = table_widths(data)
generate_table(data, widths)
str << "\n"
str
end
def generate_table_head_border(row_data, widths)
str = String.new("")
row_data.each_index do |cell_index|
str << "-" * widths[cell_index]
str << "-+-" unless cell_index == row_data.length - 1
end
private
str << "\n"
str
end
def generate_table(data, widths)
str = +"\n"
def generate_row(row_data, widths)
str = String.new("")
table_head = data.shift
str << generate_row(table_head, widths)
str << generate_table_head_border(table_head, widths)
row_data.each_with_index do |cell_data, cell_index|
str << if cell_index.zero?
cell_data.ljust(widths[cell_index], " ")
else
cell_data.rjust(widths[cell_index], " ")
end
data.each do |row_data|
str << generate_row(row_data, widths)
str << " | " unless cell_index == row_data.length - 1
end
str << "\n"
str
end
def table_widths(data)
widths = []
data.each do |row|
row.each_with_index do |cell, index|
widths[index] = [cell.length, widths[index]].compact.max
end
str << "\n"
str
end
def generate_table_head_border(row_data, widths)
str = +""
widths
end
row_data.each_index do |cell_index|
str << "-" * widths[cell_index]
str << "-+-" unless cell_index == row_data.length - 1
end
def data_for_table(num_of_rows)
sorted = @stats.sort_by { |_, file_stats| -file_stats[:time] }
sorted = sorted.slice(0, num_of_rows)
str << "\n"
str
table = [%w(Filename Count Bytes Time)]
sorted.each do |filename, file_stats|
row = []
row << filename
row << file_stats[:count].to_s
row << format_bytes(file_stats[:bytes])
row << format("%.3f", file_stats[:time])
table << row
end
def generate_row(row_data, widths)
str = +""
table
end
row_data.each_with_index do |cell_data, cell_index|
str << if cell_index.zero?
cell_data.ljust(widths[cell_index], " ")
else
cell_data.rjust(widths[cell_index], " ")
end
str << " | " unless cell_index == row_data.length - 1
end
str << "\n"
str
end
def table_widths(data)
widths = []
data.each do |row|
row.each_with_index do |cell, index|
widths[index] = [cell.length, widths[index]].compact.max
end
end
widths
end
def data_for_table(num_of_rows)
sorted = @stats.sort_by { |_, file_stats| -file_stats[:time] }
sorted = sorted.slice(0, num_of_rows)
table = [%w(Filename Count Bytes Time)]
sorted.each do |filename, file_stats|
row = []
row << filename
row << file_stats[:count].to_s
row << format_bytes(file_stats[:bytes])
row << format("%.3f", file_stats[:time])
table << row
end
table
end
def format_bytes(bytes)
bytes /= 1024.0
format("%.2fK", bytes)
end
def format_bytes(bytes)
bytes /= 1024.0
format("%.2fK", bytes)
end
end
end

View File

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

View File

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

View File

@@ -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
@@ -95,11 +97,11 @@ module Jekyll
#
# Returns the String url.
def url
@url ||= URL.new(
@url ||= URL.new({
:template => template,
:placeholders => url_placeholders,
:permalink => permalink
).to_s
:permalink => permalink,
}).to_s
end
# Returns a hash of URL placeholder names (as symbols) mapping to the
@@ -181,5 +183,20 @@ module Jekyll
def write?
true
end
# The Page excerpt_separator, from the YAML Front-Matter or site
# default excerpt_separator value
#
# Returns the document excerpt_separator
def excerpt_separator
(data["excerpt_separator"] || site.config["excerpt_separator"]).to_s
end
# Whether to generate an excerpt
#
# Returns true if the excerpt separator is configured.
def generate_excerpt?
!excerpt_separator.empty?
end
end
end

View File

@@ -13,7 +13,7 @@ module Jekyll
#
def self.inherited(const)
catch_inheritance(const) do |const_|
return catch_inheritance(const) do |const_|
catch_inheritance(const_)
end
end
@@ -23,7 +23,9 @@ module Jekyll
def self.catch_inheritance(const)
const.define_singleton_method :inherited do |const_|
(@children ||= Set.new).add const_
yield const_ if block_given?
if block_given?
yield const_
end
end
end
@@ -46,7 +48,9 @@ module Jekyll
# Returns the Symbol priority.
def self.priority(priority = nil)
@priority ||= nil
@priority = priority if priority && PRIORITIES.key?(priority)
if priority && PRIORITIES.key?(priority)
@priority = priority
end
@priority || :normal
end
@@ -58,7 +62,9 @@ module Jekyll
#
# Returns the safety Boolean.
def self.safe(safe = nil)
@safe = safe unless defined?(@safe) && safe.nil?
unless defined?(@safe) && safe.nil?
@safe = safe
end
@safe || false
end
@@ -68,7 +74,7 @@ module Jekyll
#
# Returns -1, 0, 1.
def self.<=>(other)
PRIORITIES[other.priority] <=> PRIORITIES[priority]
PRIORITIES[other.priority] <=> PRIORITIES[self.priority]
end
# Spaceship is priority [higher -> lower]

View File

@@ -76,7 +76,9 @@ module Jekyll
dot_dirs.each do |file|
dir_path = site.in_source_dir(dir, file)
rel_path = File.join(dir, file)
@site.reader.read_directories(rel_path) unless @site.dest.chomp("/") == dir_path
unless @site.dest.chomp("/") == dir_path
@site.reader.read_directories(rel_path)
end
end
end

View File

@@ -55,13 +55,13 @@ module Jekyll
case File.extname(path).downcase
when ".csv"
CSV.read(path,
:headers => true,
:encoding => site.config["encoding"]).map(&:to_hash)
:headers => true,
:encoding => site.config["encoding"]).map(&:to_hash)
when ".tsv"
CSV.read(path,
:col_sep => "\t",
:headers => true,
:encoding => site.config["encoding"]).map(&:to_hash)
:col_sep => "\t",
:headers => true,
:encoding => site.config["encoding"]).map(&:to_hash)
else
SafeYAML.load_file(path)
end

View File

@@ -63,7 +63,9 @@ module Jekyll
def layout_directory_in_cwd
dir = Jekyll.sanitized_path(Dir.pwd, site.config["layouts_dir"])
dir if File.directory?(dir) && !site.safe
if File.directory?(dir) && !site.safe
dir
end
end
end
end

View File

@@ -62,9 +62,10 @@ module Jekyll
@site.reader.get_entries(dir, magic_dir).map do |entry|
next unless entry =~ matcher
path = @site.in_source_dir(File.join(dir, magic_dir, entry))
Document.new(path,
:site => @site,
:collection => @site.posts)
Document.new(path, {
:site => @site,
:collection => @site.posts,
})
end.reject(&:nil?)
end
end

View File

@@ -8,7 +8,7 @@ module Jekyll
end
def read
return unless site.theme&.assets_path
return unless site.theme && site.theme.assets_path
Find.find(site.theme.assets_path) do |path|
next if File.directory?(path)
@@ -21,7 +21,6 @@ module Jekyll
end
private
def read_theme_asset(path)
base = site.theme.root
dir = File.dirname(path.sub("#{site.theme.root}/", ""))
@@ -29,18 +28,18 @@ module Jekyll
if Utils.has_yaml_header?(path)
append_unless_exists site.pages,
Jekyll::Page.new(site, base, dir, name)
Jekyll::Page.new(site, base, dir, name)
else
append_unless_exists site.static_files,
Jekyll::StaticFile.new(site, base, "/#{dir}", name)
Jekyll::StaticFile.new(site, base, "/#{dir}", name)
end
end
def append_unless_exists(haystack, new_item)
if haystack.any? { |file| file.relative_path == new_item.relative_path }
Jekyll.logger.debug "Theme:",
"Ignoring #{new_item.relative_path} in theme due to existing file " \
"with that path in site."
"Ignoring #{new_item.relative_path} in theme due to existing file " \
"with that path in site."
return
end

View File

@@ -28,7 +28,9 @@ module Jekyll
regenerate_document?(document)
else
source_path = document.respond_to?(:path) ? document.path : nil
dest_path = document.destination(@site.dest) if document.respond_to?(:destination)
dest_path = if document.respond_to?(:destination)
document.destination(@site.dest)
end
source_modified_or_dest_missing?(source_path, dest_path)
end
end
@@ -87,7 +89,9 @@ module Jekyll
return true if path.nil?
# Check for path in cache
return cache[path] if cache.key? path
if cache.key? path
return cache[path]
end
if metadata[path]
# If we have seen this file before,
@@ -161,6 +165,7 @@ module Jekyll
end
end
private
def regenerate_page?(document)
document.asset_file? || document.data["regenerate"] ||
source_modified_or_dest_missing?(
@@ -168,6 +173,7 @@ module Jekyll
)
end
private
def regenerate_document?(document)
!document.write? || document.data["regenerate"] ||
source_modified_or_dest_missing?(
@@ -175,11 +181,14 @@ module Jekyll
)
end
private
def existing_file_modified?(path)
# If one of this file dependencies have been modified,
# set the regeneration bit for both the dependency and the file to true
metadata[path]["deps"].each do |dependency|
return cache[dependency] = cache[path] = true if modified?(dependency)
if modified?(dependency)
return cache[dependency] = cache[path] = true
end
end
if File.exist?(path) && metadata[path]["mtime"].eql?(File.mtime(path))

View File

@@ -101,8 +101,8 @@ module Jekyll
converter.convert output
rescue StandardError => e
Jekyll.logger.error "Conversion error:",
"#{converter.class} encountered an error while "\
"converting '#{document.relative_path}':"
"#{converter.class} encountered an error while "\
"converting '#{document.relative_path}':"
Jekyll.logger.error("", e.to_s)
raise e
end
@@ -121,13 +121,13 @@ module Jekyll
template = site.liquid_renderer.file(path).parse(content)
template.warnings.each do |e|
Jekyll.logger.warn "Liquid Warning:",
LiquidRenderer.format_error(e, path || document.relative_path)
LiquidRenderer.format_error(e, path || document.relative_path)
end
template.render!(payload, info)
# rubocop: disable RescueException
rescue Exception => e
Jekyll.logger.error "Liquid Exception:",
LiquidRenderer.format_error(e, path || document.relative_path)
LiquidRenderer.format_error(e, path || document.relative_path)
raise e
end
# rubocop: enable RescueException
@@ -166,12 +166,11 @@ module Jekyll
output
end
private
# Checks if the layout specified in the document actually exists
#
# layout - the layout to check
# Returns nothing
private
def validate_layout(layout)
if invalid_layout?(layout)
Jekyll.logger.warn(
@@ -188,6 +187,7 @@ module Jekyll
# Render layout content into document.output
#
# Returns String rendered content
private
def render_layout(output, layout, info)
payload["content"] = output
payload["layout"] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})
@@ -200,6 +200,7 @@ module Jekyll
)
end
private
def add_regenerator_dependencies(layout)
return unless document.write?
site.regenerator.add_dependency(
@@ -211,14 +212,18 @@ module Jekyll
# Set page content to payload and assign pager if document has one.
#
# Returns nothing
private
def assign_pages!
payload["page"] = document.to_liquid
payload["paginator"] = (document.pager.to_liquid if document.respond_to?(:pager))
payload["paginator"] = if document.respond_to?(:pager)
document.pager.to_liquid
end
end
# Set related posts to payload if document is a post.
#
# Returns nothing
private
def assign_current_document!
payload["site"].current_document = document
end
@@ -226,16 +231,21 @@ module Jekyll
# Set highlighter prefix and suffix
#
# Returns nothing
private
def assign_highlighter_options!
payload["highlighter_prefix"] = converters.first.highlighter_prefix
payload["highlighter_suffix"] = converters.first.highlighter_suffix
end
private
def assign_layout_data!
layout = layouts[document.data["layout"]]
payload["layout"] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {}) if layout
if layout
payload["layout"] = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})
end
end
private
def permalink_ext
document_permalink = document.permalink
if document_permalink && !document_permalink.end_with?("/")
@@ -244,6 +254,7 @@ module Jekyll
end
end
private
def converter_output_ext
if output_exts.size == 1
output_exts.last
@@ -252,12 +263,14 @@ module Jekyll
end
end
private
def output_exts
@output_exts ||= converters.map do |c|
c.output_ext(document.extname)
end.compact
end
private
def liquid_options
@liquid_options ||= site.config["liquid"]
end

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