Compare commits

..

4 Commits

Author SHA1 Message Date
Alexey Pelykh
1898ced3c4 Added docs for enhanced link tag 2018-05-07 14:09:11 +05:30
Ashwin Maroli
5d924f6216 Merge branch 'master' into docs-40 2018-05-07 14:05:49 +05:30
Nikita Skalkin
2a6ec9788b Docs for remove support for Redcarpet (#6990)
Merge pull request 6990
2018-05-07 03:45:32 -04:00
Frank Taillandier
1d8d6be243 rdiscount is not supported anymore 2018-05-04 19:50:38 +02:00
131 changed files with 1854 additions and 2001 deletions

View File

@@ -11,7 +11,6 @@ AllCops:
TargetRubyVersion: 2.3
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/UnneededRequireStatement:
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
@@ -94,6 +107,8 @@ Naming/MemoizedInstanceVariableName:
Naming/UncommunicativeMethodParamName:
AllowedNames:
- _
Performance/UnfreezeString:
Enabled: false
Security/MarshalLoad:
Exclude:
- !ruby/regexp /test\/.*.rb$/
@@ -102,19 +117,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 +141,10 @@ Style/GuardClause:
Style/HashSyntax:
EnforcedStyle: hash_rockets
Severity: error
Style/IfUnlessModifier:
Enabled: false
Style/InverseMethods:
Enabled: false
Style/MixinUsage:
Exclude:
- test/helper.rb
@@ -132,6 +152,8 @@ Style/ModuleFunction:
Enabled: false
Style/MultilineTernaryOperator:
Severity: error
Style/NumericPredicate:
Enabled: false
Style/PercentLiteralDelimiters:
PreferredDelimiters:
"%q": "{}"
@@ -141,21 +163,28 @@ Style/PercentLiteralDelimiters:
"%w": "()"
"%W": "()"
"%x": "()"
Style/RedundantFreeze:
Enabled: false
Style/RedundantReturn:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/RegexpLiteral:
EnforcedStyle: percent_r
Style/RescueModifier:
Enabled: false
Style/SafeNavigation:
Exclude:
- lib/jekyll/document.rb
Enabled: false
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,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/

View File

@@ -25,7 +25,7 @@ group :test do
gem "nokogiri", "~> 1.7"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 0.57.2"
gem "rubocop", "~> 0.55.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__)
@@ -76,6 +76,7 @@ group :jekyll_optional_dependencies do
gem "classifier-reborn", "~> 2.2.0"
gem "liquid-c", "~> 3.0"
gem "pygments.rb", "~> 1.0"
gem "rdiscount", "~> 2.0"
gem "yajl-ruby", "~> 1.3"
end

View File

@@ -1,7 +1,5 @@
## HEAD
* Textile is only supported through a converter plugin (#7003)
### Documentation
* Release post for v3.8.0 (#6849)
@@ -15,25 +13,6 @@
* 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 'draft' (#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 "this is an example Gemfile" (#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)
### Minor Enhancements
@@ -41,9 +20,6 @@
* Memoize computing excerpt'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)
### Major Enhancements
@@ -54,7 +30,6 @@
* 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
@@ -62,40 +37,6 @@
* 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'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)
### Bug Fixes
* Add call to unused method `validate_options` in `commands/serve.rb` (#7122)
### feature
* Disable Liquid via front matter (#6824)
## 3.8.3 / 2018-06-05
### Bug Fixes
* Fix --unpublished not affecting collection documents (#7027)
## 3.8.2 / 2018-05-18
### Development Fixes
* Update rubocop version (#7016)
### Bug Fixes
* Add whitespace control to LIQUID_TAG_REGEX (#7015)
## 3.8.1 / 2018-05-01

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

@@ -1,5 +1,5 @@
---
version: 3.8.3
version: 3.8.1
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

@@ -689,11 +689,6 @@ liquid:
strict_variables: false
# Markdown Processors
rdiscount:
extensions: []
redcarpet:
extensions: []
kramdown:
auto_ids: true
@@ -728,50 +723,6 @@ mutually exclusive.
The various Markdown renderers supported by Jekyll sometimes have extra options
available.
### Redcarpet
Redcarpet can be configured by providing an `extensions` sub-setting, whose
value should be an array of strings. Each string should be the name of one of
the `Redcarpet::Markdown` class's extensions; if present in the array, it will
set the corresponding extension to `true`.
Jekyll handles two special Redcarpet extensions:
- `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
extension (for delimiting code blocks with triple tildes or triple backticks)
to `true`, probably because GitHub's eager adoption of them is starting to make
them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
when used with Jekyll; instead, you can use this inverted version of the
extension for disabling fenced code.
Note that you can also specify a language for highlighting after the first
delimiter:
```ruby
# ...ruby code
```
With both fenced code blocks and highlighter enabled, this will statically
highlight the code; without any syntax highlighter, it will add a
`class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
hint by various JavaScript code highlighting libraries.
- `smart` --- This pseudo-extension turns on SmartyPants, which converts
straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
All other extensions retain their usual names from Redcarpet, and no renderer
options aside from `smart` can be specified in Jekyll. [A list of available
extensions can be found in the Redcarpet README file.][redcarpet_extensions]
Make sure you're looking at the README for the right version of
Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
extensions are:
- `tables`
- `no_intra_emphasis`
- `autolink`
[redcarpet_extensions]: https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use
### Custom Markdown Processors
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:

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,29 +4,6 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 3.8.3 / 2018-06-05
{: #v3-8-3}
### Bug Fixes
{: #bug-fixes-v3-8-3}
- Fix --unpublished not affecting collection documents ([#7027]({{ site.repository }}/issues/7027))
## 3.8.2 / 2018-05-18
{: #v3-8-2}
### Development Fixes
{: #development-fixes-v3-8-2}
- Update rubocop version ([#7016]({{ site.repository }}/issues/7016))
### Bug Fixes
{: #bug-fixes-v3-8-2}
- Add whitespace control to LIQUID_TAG_REGEX ([#7015]({{ site.repository }}/issues/7015))
## 3.8.1 / 2018-05-01
{: #v3-8-1}

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
@@ -890,7 +887,6 @@ You can find a few useful plugins at the following locations:
- [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 +936,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

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

@@ -588,6 +588,23 @@ One major benefit of using the `link` or `post_url` tag is link validation. If t
Note you cannot add filters to `link` tags. For example, you cannot append a string using Liquid filters, such as `{% raw %}{% link mypage.html | append: "#section1" %} {% endraw %}`. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.
The name of the file you want to link can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's front matter like this:
```yaml
---
title: My page
my_variable: footer_company_a.html
---
```
You could then reference that variable in your link:
```liquid
{% raw %}{% link {{ page.my_variable }} %}{% endraw %}
```
In this example, the link would add link to the file `footer_company_a.html`.
### Linking to posts
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.

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

@@ -89,7 +89,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:

View File

@@ -1,19 +0,0 @@
---
title: 'Jekyll 3.8.2 Released'
date: 2018-05-19 10:30:00 -0500
author: pathawks
version: 3.8.2
categories: [release]
---
Hello Jekyllers!!
Today we are releasing `v3.8.2`, which fixes the way Jekyll generates excerpts
for posts when the first paragraph of the post contains Liquid tags that take
advantage of [Liquid's whitespace control feature][Liquid whitespace].
Big thanks to @kylebarbour, who first reported this issue and also very quickly
submitted a fix. Also thanks to @nickskalkin for making sure that we are using
the latest version of Rubocop to lint our code.
[Liquid whitespace]: https://shopify.github.io/liquid/basics/whitespace/

View File

@@ -1,13 +0,0 @@
---
title: 'Jekyll 3.8.3 Released'
date: 2018-06-05 09:00:00 -0500
author: pathawks
version: 3.8.3
categories: [release]
---
This release fixes a regression in 3.8 where collections with `published: false`
do not show when using the `--unpublished` flag.
Thanks to @philipbelesky for reporting and fixing this issue; collections with
`published: false` now behave the same way as Posts.

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

View File

@@ -1 +1 @@
3.8.3
3.8.1

View File

@@ -263,104 +263,6 @@ Feature: Collections
And the "_site/puppies/snowy.html" file should not exist
And the "_site/puppies/hardy.html" file should not exist
Scenario: Access rendered collection with future date and unpublished flag via Liquid
Given I have a _puppies directory
And I have the following documents under the puppies collection:
| title | date | content | published |
| Rover | 2007-12-31 | content for Rover. | true |
| Figor | 2007-12-31 | content for Figor. | false |
| Snowy | 2199-12-31 | content for Snowy. | true |
| Hardy | 2199-12-31 | content for Hardy. | false |
And I have a "_config.yml" file with content:
"""
collections:
puppies:
output: true
"""
And I have a "index.md" page that contains "{% for puppy in site.puppies %}<div>{{ puppy.title }}</div>{% endfor %}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<div>Rover</div>" in "_site/index.html"
But I should see "<div>Snowy</div>" in "_site/index.html"
And I should not see "<div>Figor</div>" in "_site/index.html"
And I should not see "<div>Hardy</div>" in "_site/index.html"
And the "_site/puppies/rover.html" file should exist
And the "_site/puppies/snowy.html" file should not exist
And the "_site/puppies/figor.html" file should not exist
And the "_site/puppies/hardy.html" file should not exist
When I run jekyll build --unpublished
Then I should get a zero exit status
And the _site directory should exist
And I should see "<div>Rover</div>" in "_site/index.html"
And I should see "<div>Snowy</div>" in "_site/index.html"
And I should see "<div>Figor</div>" in "_site/index.html"
But I should see "<div>Hardy</div>" in "_site/index.html"
And the "_site/puppies/rover.html" file should exist
And the "_site/puppies/snowy.html" file should not exist
And the "_site/puppies/figor.html" file should exist
And the "_site/puppies/hardy.html" file should not exist
When I run jekyll build --unpublished --future
Then I should get a zero exit status
And the _site directory should exist
And I should see "<div>Rover</div>" in "_site/index.html"
And I should see "<div>Snowy</div>" in "_site/index.html"
And I should see "<div>Figor</div>" in "_site/index.html"
But I should see "<div>Hardy</div>" in "_site/index.html"
And the "_site/puppies/rover.html" file should exist
And the "_site/puppies/snowy.html" file should exist
And the "_site/puppies/figor.html" file should exist
And the "_site/puppies/hardy.html" file should exist
Scenario: Access unrendered collection with future date and unpublished flag via Liquid
Given I have a _puppies directory
And I have the following documents under the puppies collection:
| title | date | content | published |
| Rover | 2007-12-31 | content for Rover. | true |
| Figor | 2007-12-31 | content for Figor. | false |
| Snowy | 2199-12-31 | content for Snowy. | true |
| Hardy | 2199-12-31 | content for Hardy. | false |
And I have a "_config.yml" file with content:
"""
collections:
puppies:
output: false
"""
And I have a "index.md" page that contains "{% for puppy in site.puppies %}<div>{{ puppy.title }}</div>{% endfor %}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<div>Rover</div>" in "_site/index.html"
But I should see "<div>Snowy</div>" in "_site/index.html"
And I should not see "<div>Figor</div>" in "_site/index.html"
And I should not see "<div>Hardy</div>" in "_site/index.html"
And the "_site/puppies/rover.html" file should not exist
And the "_site/puppies/snowy.html" file should not exist
And the "_site/puppies/figor.html" file should not exist
And the "_site/puppies/hardy.html" file should not exist
When I run jekyll build --unpublished
Then I should get a zero exit status
And the _site directory should exist
And I should see "<div>Rover</div>" in "_site/index.html"
And I should see "<div>Snowy</div>" in "_site/index.html"
And I should see "<div>Figor</div>" in "_site/index.html"
But I should see "<div>Hardy</div>" in "_site/index.html"
And the "_site/puppies/rover.html" file should not exist
And the "_site/puppies/snowy.html" file should not exist
And the "_site/puppies/figor.html" file should not exist
And the "_site/puppies/hardy.html" file should not exist
When I run jekyll build --unpublished --future
Then I should get a zero exit status
And the _site directory should exist
And I should see "<div>Rover</div>" in "_site/index.html"
And I should see "<div>Snowy</div>" in "_site/index.html"
And I should see "<div>Figor</div>" in "_site/index.html"
But I should see "<div>Hardy</div>" in "_site/index.html"
And the "_site/puppies/rover.html" file should not exist
And the "_site/puppies/snowy.html" file should not exist
And the "_site/puppies/figor.html" file should not exist
And the "_site/puppies/hardy.html" file should not exist
Scenario: All the documents
Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
And I have fixture collections

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

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

View File

@@ -33,7 +33,7 @@ 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", "~> 1.0")
s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0")
s.add_runtime_dependency("jekyll-watch", "~> 2.0")
s.add_runtime_dependency("kramdown", "~> 1.14")

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,16 @@ 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?
docs << doc unless doc.data["published"] == false
end
private
def read_static_file(file_path, full_path)
relative_dir = Jekyll.sanitized_path(
relative_directory,

View File

@@ -51,26 +51,26 @@ 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

View File

@@ -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,38 @@ 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 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
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(
@@ -91,10 +90,7 @@ module Jekyll
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 +103,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 +122,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 +171,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,6 +186,9 @@ module Jekyll
end
end
#
private
def webrick_opts(opts)
opts = {
:JekyllOptions => opts,
@@ -207,8 +209,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 +226,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 +249,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 +271,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 +286,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 +296,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 +305,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 +316,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 +333,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 +348,7 @@ module Jekyll
end
end
private
def stop_callback(detached)
unless detached
proc do
@@ -337,11 +364,13 @@ module Jekyll
end
end
private
def mime_types
file = File.expand_path("../mime.types", __dir__)
WEBrick::HTTPUtils.load_mime_types(file)
end
private
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

@@ -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
@@ -176,8 +178,9 @@ module Jekyll
end
# rubocop:enable Naming/MethodName
private
#
private
def validate_and_ensure_charset(_req, res)
key = res.header.keys.grep(%r!content-type!i).first
typ = res.header[key]
@@ -187,6 +190,9 @@ module Jekyll
end
end
#
private
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,10 @@ module Jekyll
"strict_variables" => false,
},
"rdiscount" => {
"extensions" => [],
},
"kramdown" => {
"auto_ids" => true,
"toc_levels" => "1..6",
@@ -278,7 +282,6 @@ module Jekyll
end
private
def style_to_permalink(permalink_style)
case permalink_style.to_sym
when :pretty
@@ -300,12 +303,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 +321,7 @@ module Jekyll
end
end
private
def check_server(config)
if config.key?("server")
Jekyll::Deprecator.deprecation_message "The 'server' configuration option" \
@@ -325,6 +331,7 @@ module Jekyll
end
end
private
def check_pygments(config)
if config.key?("pygments")
Jekyll::Deprecator.deprecation_message "The 'pygments' configuration option" \
@@ -337,6 +344,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 +354,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 +367,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 +384,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 +392,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,8 @@ module Jekyll
# rubocop:disable Naming/AccessorMethodName
def get_processor
case @config["markdown"].downcase
when "kramdown" then KramdownParser.new(@config)
when "kramdown" then return KramdownParser.new(@config)
when "rdiscount" then return RDiscountParser.new(@config)
else
custom_processor
end
@@ -40,7 +43,7 @@ module Jekyll
# are not in safe mode.)
def valid_processors
%w(kramdown) + third_party_processors
%w(rdiscount kramdown) + third_party_processors
end
# Public: A list of processors that you provide via plugins.
@@ -49,7 +52,7 @@ module Jekyll
def third_party_processors
self.class.constants - \
%w(KramdownParser PRIORITIES).map(
%w(KramdownParser RDiscountParser PRIORITIES).map(
&:to_sym
)
end
@@ -74,10 +77,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 +91,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

@@ -47,7 +47,6 @@ module Jekyll
end
private
def make_accessible(hash = @config)
hash.keys.each do |key|
hash[key.to_sym] = hash[key]
@@ -60,6 +59,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 +84,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 +102,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

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

@@ -46,10 +46,10 @@ module Jekyll
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)
@@ -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,6 +444,7 @@ module Jekyll
merge_data!(defaults, :source => "front matter defaults") unless defaults.empty?
end
private
def read_content(opts)
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
if content =~ YAML_FRONT_MATTER_REGEXP
@@ -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,8 @@ 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, :documents,
:tags, :categories
private def_delegator :@obj, :config, :fallback_data

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,9 @@ module Jekyll
def filter(entries)
entries.reject do |e|
special?(e) || backup?(e) || excluded?(e) || symlink?(e) unless included?(e)
unless included?(e)
special?(e) || backup?(e) || excluded?(e) || symlink?(e)
end
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?
@@ -56,7 +55,7 @@ module Jekyll
#
# 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,7 +128,7 @@ 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)
@@ -142,7 +141,7 @@ module Jekyll
head =~ LIQUID_TAG_REGEX
tag_name = Regexp.last_match(1)
if liquid_block?(tag_name) && head.match(%r!{%-?\s*end#{tag_name}\s*-?%}!).nil?
if liquid_block?(tag_name) && head.match(%r!{%\s*end#{tag_name}\s*%}!).nil?
print_build_warning
head << "\n{% end#{tag_name} %}"
end
@@ -159,20 +158,16 @@ module Jekyll
def liquid_block?(tag_name)
Liquid::Template.tags[tag_name].superclass == Liquid::Block
rescue NoMethodError
Jekyll.logger.error "Error:",
"A Liquid tag in the excerpt of #{doc.relative_path} couldn't be parsed."
raise
end
def print_build_warning
Jekyll.logger.warn "Warning:", "Excerpt modified in #{doc.relative_path}!"
Jekyll.logger.warn "",
"Found a Liquid block containing separator '#{doc.excerpt_separator}'" \
" and has been modified with the appropriate closing tag."
"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."
"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

@@ -58,13 +58,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

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

@@ -95,11 +95,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

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

@@ -54,14 +54,16 @@ module Jekyll
def read_data_file(path)
case File.extname(path).downcase
when ".csv"
CSV.read(path,
:headers => true,
:encoding => site.config["encoding"]).map(&:to_hash)
CSV.read(path, {
: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)
CSV.read(path, {
: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

View File

@@ -44,8 +44,8 @@ module Jekyll
@config = config.clone
%w(safe lsi highlighter baseurl exclude include future unpublished
show_drafts limit_posts keep_files).each do |opt|
send("#{opt}=", config[opt])
show_drafts limit_posts keep_files).each do |opt|
self.send("#{opt}=", config[opt])
end
# keep using `gems` to avoid breaking change
@@ -98,7 +98,9 @@ module Jekyll
@liquid_renderer.reset
@site_cleaner = nil
raise ArgumentError, "limit_posts must be a non-negative number" if limit_posts.negative?
if limit_posts < 0
raise ArgumentError, "limit_posts must be a non-negative number"
end
Jekyll::Hooks.trigger :site, :after_reset, self
end
@@ -122,7 +124,7 @@ module Jekyll
Pathname.new(source).ascend do |path|
if path == dest_pathname
raise Errors::FatalException,
"Destination directory cannot be or contain the Source directory."
"Destination directory cannot be or contain the Source directory."
end
end
end
@@ -172,7 +174,7 @@ module Jekyll
start = Time.now
generator.generate(self)
Jekyll.logger.debug "Generating:",
"#{generator.class} finished in #{Time.now - start} seconds."
"#{generator.class} finished in #{Time.now - start} seconds."
end
end
@@ -232,7 +234,7 @@ module Jekyll
# array of posts ) then sort each array in reverse order.
hash = Hash.new { |h, key| h[key] = [] }
posts.docs.each do |p|
p.data[post_attr]&.each { |t| hash[t] << p }
p.data[post_attr].each { |t| hash[t] << p } if p.data[post_attr]
end
hash.each_value { |posts| posts.sort!.reverse! }
hash
@@ -301,10 +303,10 @@ module Jekyll
def relative_permalinks_are_deprecated
if config["relative_permalinks"]
Jekyll.logger.abort_with "Since v3.0, permalinks for pages" \
" in subfolders must be relative to the" \
" site source directory, not the parent" \
" directory. Check https://jekyllrb.com/docs/upgrading/"\
" for more info."
" in subfolders must be relative to the" \
" site source directory, not the parent" \
" directory. Check https://jekyllrb.com/docs/upgrading/"\
" for more info."
end
end
@@ -401,15 +403,14 @@ module Jekyll
@collections_path ||= dir_str.empty? ? source : in_source_dir(dir_str)
end
private
# Limits the current posts; removes the posts which exceed the limit_posts
#
# Returns nothing
private
def limit_posts!
if limit_posts.positive?
if limit_posts > 0
limit = posts.docs.length < limit_posts ? posts.docs.length : limit_posts
posts.docs = posts.docs[-limit, limit]
self.posts.docs = posts.docs[-limit, limit]
end
end
@@ -417,15 +418,18 @@ module Jekyll
# already exist.
#
# Returns The Cleaner
private
def site_cleaner
@site_cleaner ||= Cleaner.new(self)
end
private
def configure_plugins
self.plugin_manager = Jekyll::PluginManager.new(self)
self.plugins = plugin_manager.plugins_path
end
private
def configure_theme
self.theme = nil
return if config["theme"].nil?
@@ -440,17 +444,20 @@ module Jekyll
end
end
private
def configure_include_paths
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
@includes_load_paths << theme.includes_path if theme&.includes_path
@includes_load_paths << theme.includes_path if theme && theme.includes_path
end
private
def configure_file_read_opts
self.file_read_opts = {}
file_read_opts[:encoding] = config["encoding"] if config["encoding"]
self.file_read_opts[:encoding] = config["encoding"] if config["encoding"]
self.file_read_opts = Jekyll::Utils.merged_file_read_opts(self, {})
end
private
def render_docs(payload)
collections.each_value do |collection|
collection.docs.each do |document|
@@ -459,12 +466,14 @@ module Jekyll
end
end
private
def render_pages(payload)
pages.flatten.each do |page|
render_regenerated(page, payload)
end
end
private
def render_regenerated(document, payload)
return unless regenerator.regenerate?(document)
document.output = Jekyll::Renderer.new(self, document, payload).run

View File

@@ -133,10 +133,10 @@ module Jekyll
@url ||= if @collection.nil?
relative_path
else
::Jekyll::URL.new(
::Jekyll::URL.new({
:template => @collection.url_template,
:placeholders => placeholders
)
:placeholders => placeholders,
})
end.to_s.chomp("/")
end
@@ -152,7 +152,6 @@ module Jekyll
end
private
def copy_file(dest_path)
if @site.safe || Jekyll.env == "production"
FileUtils.cp(path, dest_path)

View File

@@ -16,7 +16,9 @@ module Jekyll
severity ||= UNKNOWN
@logdev = logdevice(severity)
return true if @logdev.nil? || severity < @level
if @logdev.nil? || severity < @level
return true
end
progname ||= @progname
if message.nil?
if block_given?

View File

@@ -18,13 +18,13 @@ module Jekyll
@lang = Regexp.last_match(1).downcase
@highlight_options = parse_options(Regexp.last_match(2))
else
raise SyntaxError, <<~MSG
Syntax Error in tag 'highlight' while parsing the following markup:
raise SyntaxError, <<-MSG
Syntax Error in tag 'highlight' while parsing the following markup:
#{markup}
#{markup}
Valid syntax: highlight <lang> [linenos]
MSG
Valid syntax: highlight <lang> [linenos]
MSG
end
end
@@ -75,7 +75,7 @@ module Jekyll
input.scan(OPTIONS_REGEX) do |opt|
key, value = opt.split("=")
# If a quoted list, convert to array
if value&.include?('"')
if value && value.include?('"')
value.delete!('"')
value = value.split
end
@@ -96,14 +96,14 @@ module Jekyll
)
if highlighted_code.nil?
Jekyll.logger.error <<~MSG
There was an error highlighting your code:
Jekyll.logger.error <<-MSG
There was an error highlighting your code:
#{code}
#{code}
While attempting to convert the above code, Pygments.rb returned an unacceptable value.
This is usually a timeout problem solved by running `jekyll build` again.
MSG
While attempting to convert the above code, Pygments.rb returned an unacceptable value.
This is usually a timeout problem solved by running `jekyll build` again.
MSG
raise ArgumentError, "Pygments.rb returned an unacceptable value "\
"when attempting to highlight some code."
end

View File

@@ -55,31 +55,31 @@ module Jekyll
def validate_file_name(file)
if file =~ INVALID_SEQUENCES || file !~ VALID_FILENAME_CHARS
raise ArgumentError, <<~MSG
Invalid syntax for include tag. File contains invalid characters or sequences:
raise ArgumentError, <<-MSG
Invalid syntax for include tag. File contains invalid characters or sequences:
#{file}
#{file}
Valid syntax:
Valid syntax:
#{syntax_example}
#{syntax_example}
MSG
MSG
end
end
def validate_params
unless @params =~ FULL_VALID_SYNTAX
raise ArgumentError, <<~MSG
Invalid syntax for include tag:
raise ArgumentError, <<-MSG
Invalid syntax for include tag:
#{@params}
#{@params}
Valid syntax:
Valid syntax:
#{syntax_example}
#{syntax_example}
MSG
MSG
end
end
@@ -138,7 +138,7 @@ module Jekyll
end
def add_include_to_dependency(site, path, context)
if context.registers[:page]&.key?("path")
if context.registers[:page] && context.registers[:page].key?("path")
site.regenerator.add_dependency(
site.in_source_dir(context.registers[:page]["path"]),
path
@@ -151,10 +151,8 @@ module Jekyll
cached_partial = context.registers[:cached_partials]
if cached_partial.key?(path)
Jekyll.logger.info "Include cache hit: ", path.green
cached_partial[path]
else
Jekyll.logger.info "Include cache miss: ", path.yellow
unparsed_file = context.registers[:site]
.liquid_renderer
.file(path)

View File

@@ -5,7 +5,7 @@ module Jekyll
class Link < Liquid::Tag
class << self
def tag_name
name.split("::").last.downcase
self.name.split("::").last.downcase
end
end
@@ -27,11 +27,11 @@ module Jekyll
return item.url if item.relative_path == "/#{relative_path}"
end
raise ArgumentError, <<~MSG
Could not find document '#{relative_path}' in tag '#{self.class.tag_name}'.
raise ArgumentError, <<-MSG
Could not find document '#{relative_path}' in tag '#{self.class.tag_name}'.
Make sure the document exists and the path is correct.
MSG
Make sure the document exists and the path is correct.
MSG
end
end
end

View File

@@ -13,7 +13,7 @@ module Jekyll
all, @path, @date, @slug = *name.sub(%r!^/!, "").match(MATCHER)
unless all
raise Jekyll::Errors::InvalidPostNameError,
"'#{name}' does not contain valid date and/or title."
"'#{name}' does not contain valid date and/or title."
end
escaped_slug = Regexp.escape(slug)
@@ -22,10 +22,8 @@ module Jekyll
end
def post_date
@post_date ||= Utils.parse_date(
date,
"'#{date}' does not contain valid date and/or title."
)
@post_date ||= Utils.parse_date(date,
"\"#{date}\" does not contain valid date and/or title.")
end
def ==(other)
@@ -40,7 +38,6 @@ module Jekyll
end
private
# Construct the directory-aware post slug for a Jekyll::Post
#
# other - the Jekyll::Post
@@ -63,11 +60,13 @@ module Jekyll
begin
@post = PostComparer.new(@orig_post)
rescue StandardError => e
raise Jekyll::Errors::PostURLError, <<~MSG
Could not parse name of post "#{@orig_post}" in tag 'post_url'.
Make sure the post exists and the name is correct.
#{e.class}: #{e.message}
MSG
raise Jekyll::Errors::PostURLError, <<-MSG
Could not parse name of post "#{@orig_post}" in tag 'post_url'.
Make sure the post exists and the name is correct.
#{e.class}: #{e.message}
MSG
end
end
@@ -91,10 +90,11 @@ module Jekyll
return p.url
end
raise Jekyll::Errors::PostURLError, <<~MSG
Could not find post "#{@orig_post}" in tag 'post_url'.
Make sure the post exists and the name is correct.
MSG
raise Jekyll::Errors::PostURLError, <<-MSG
Could not find post "#{@orig_post}" in tag 'post_url'.
Make sure the post exists and the name is correct.
MSG
end
end
end

View File

@@ -3,7 +3,7 @@
module Jekyll
class Theme
extend Forwardable
attr_reader :name
attr_reader :name
def_delegator :gemspec, :version, :version
def initialize(name)
@@ -23,19 +23,19 @@ module Jekyll
end
def includes_path
@includes_path ||= path_for "_includes"
@includes_path ||= path_for "_includes".freeze
end
def layouts_path
@layouts_path ||= path_for "_layouts"
@layouts_path ||= path_for "_layouts".freeze
end
def sass_path
@sass_path ||= path_for "_sass"
@sass_path ||= path_for "_sass".freeze
end
def assets_path
@assets_path ||= path_for "assets"
@assets_path ||= path_for "assets".freeze
end
def configure_sass
@@ -66,7 +66,7 @@ module Jekyll
@gemspec ||= Gem::Specification.find_by_name(name)
rescue Gem::LoadError
raise Jekyll::Errors::MissingDependencyException,
"The #{name} theme could not be found."
"The #{name} theme could not be found."
end
end
end

View File

@@ -1,121 +1,119 @@
# frozen_string_literal: true
module Jekyll
class ThemeBuilder
SCAFFOLD_DIRECTORIES = %w(
assets _layouts _includes _sass
).freeze
class Jekyll::ThemeBuilder
SCAFFOLD_DIRECTORIES = %w(
assets _layouts _includes _sass
).freeze
attr_reader :name, :path, :code_of_conduct
attr_reader :name, :path, :code_of_conduct
def initialize(theme_name, opts)
@name = theme_name.to_s.tr(" ", "_").squeeze("_")
@path = Pathname.new(File.expand_path(name, Dir.pwd))
@code_of_conduct = !!opts["code_of_conduct"]
end
def initialize(theme_name, opts)
@name = theme_name.to_s.tr(" ", "_").squeeze("_")
@path = Pathname.new(File.expand_path(name, Dir.pwd))
@code_of_conduct = !!opts["code_of_conduct"]
end
def create!
create_directories
create_starter_files
create_gemspec
create_accessories
initialize_git_repo
end
def create!
create_directories
create_starter_files
create_gemspec
create_accessories
initialize_git_repo
end
def user_name
@user_name ||= `git config user.name`.chomp
end
def user_name
@user_name ||= `git config user.name`.chomp
end
def user_email
@user_email ||= `git config user.email`.chomp
end
def user_email
@user_email ||= `git config user.email`.chomp
end
private
private
def root
@root ||= Pathname.new(File.expand_path("../", __dir__))
end
def root
@root ||= Pathname.new(File.expand_path("../", __dir__))
end
def template_file(filename)
[
root.join("theme_template", "#{filename}.erb"),
root.join("theme_template", filename.to_s),
].find(&:exist?)
end
def template_file(filename)
[
root.join("theme_template", "#{filename}.erb"),
root.join("theme_template", filename.to_s),
].find(&:exist?)
end
def template(filename)
erb.render(template_file(filename).read)
end
def template(filename)
erb.render(template_file(filename).read)
end
def erb
@erb ||= ERBRenderer.new(self)
end
def erb
@erb ||= ERBRenderer.new(self)
end
def mkdir_p(directories)
Array(directories).each do |directory|
full_path = path.join(directory)
Jekyll.logger.info "create", full_path.to_s
FileUtils.mkdir_p(full_path)
end
end
def write_file(filename, contents)
full_path = path.join(filename)
def mkdir_p(directories)
Array(directories).each do |directory|
full_path = path.join(directory)
Jekyll.logger.info "create", full_path.to_s
File.write(full_path, contents)
FileUtils.mkdir_p(full_path)
end
end
def write_file(filename, contents)
full_path = path.join(filename)
Jekyll.logger.info "create", full_path.to_s
File.write(full_path, contents)
end
def create_directories
mkdir_p(SCAFFOLD_DIRECTORIES)
end
def create_starter_files
%w(page post default).each do |layout|
write_file("_layouts/#{layout}.html", template("_layouts/#{layout}.html"))
end
end
def create_gemspec
write_file("Gemfile", template("Gemfile"))
write_file("#{name}.gemspec", template("theme.gemspec"))
end
def create_accessories
accessories = %w(README.md LICENSE.txt)
accessories << "CODE_OF_CONDUCT.md" if code_of_conduct
accessories.each do |filename|
write_file(filename, template(filename))
end
end
def initialize_git_repo
Jekyll.logger.info "initialize", path.join(".git").to_s
Dir.chdir(path.to_s) { `git init` }
write_file(".gitignore", template("gitignore"))
end
class ERBRenderer
extend Forwardable
def_delegator :@theme_builder, :name, :theme_name
def_delegator :@theme_builder, :user_name, :user_name
def_delegator :@theme_builder, :user_email, :user_email
def initialize(theme_builder)
@theme_builder = theme_builder
end
def create_directories
mkdir_p(SCAFFOLD_DIRECTORIES)
def jekyll_version_with_minor
Jekyll::VERSION.split(".").take(2).join(".")
end
def create_starter_files
%w(page post default).each do |layout|
write_file("_layouts/#{layout}.html", template("_layouts/#{layout}.html"))
end
def theme_directories
SCAFFOLD_DIRECTORIES
end
def create_gemspec
write_file("Gemfile", template("Gemfile"))
write_file("#{name}.gemspec", template("theme.gemspec"))
end
def create_accessories
accessories = %w(README.md LICENSE.txt)
accessories << "CODE_OF_CONDUCT.md" if code_of_conduct
accessories.each do |filename|
write_file(filename, template(filename))
end
end
def initialize_git_repo
Jekyll.logger.info "initialize", path.join(".git").to_s
Dir.chdir(path.to_s) { `git init` }
write_file(".gitignore", template("gitignore"))
end
class ERBRenderer
extend Forwardable
def_delegator :@theme_builder, :name, :theme_name
def_delegator :@theme_builder, :user_name, :user_name
def_delegator :@theme_builder, :user_email, :user_email
def initialize(theme_builder)
@theme_builder = theme_builder
end
def jekyll_version_with_minor
Jekyll::VERSION.split(".").take(2).join(".")
end
def theme_directories
SCAFFOLD_DIRECTORIES
end
def render(contents)
ERB.new(contents).result binding
end
def render(contents)
ERB.new(contents).result binding
end
end
end

View File

@@ -98,8 +98,8 @@ module Jekyll
winner = pool.find { |key| @placeholders.key?(key) }
if winner.nil?
raise NoMethodError,
"The URL template doesn't have #{pool.join(" or ")} keys. "\
"Check your permalink template!"
"The URL template doesn't have #{pool.join(" or ")} keys. "\
"Check your permalink template!"
end
value = @placeholders[winner]

View File

@@ -313,7 +313,6 @@ module Jekyll
end
private
def merge_values(target, overwrite)
target.merge!(overwrite) do |_key, old_val, new_val|
if new_val.nil?
@@ -326,12 +325,14 @@ module Jekyll
end
end
private
def merge_default_proc(target, overwrite)
if target.is_a?(Hash) && overwrite.is_a?(Hash) && target.default_proc.nil?
target.default_proc = overwrite.default_proc
end
end
private
def duplicate_frozen_values(target)
target.each do |key, val|
target[key] = val.dup if val.frozen? && duplicable?(val)
@@ -342,6 +343,7 @@ module Jekyll
#
# See Utils#slugify for a description of the character sequence specified
# by each mode.
private
def replace_character_sequence_with_hyphen(string, mode: "default")
replaceable_char =
case mode

View File

@@ -21,6 +21,7 @@ module Jekyll
[stdin, stdout, stderr].each(&:close)
[process.value, out + err]
end
end
end
end

View File

@@ -3,6 +3,7 @@
module Jekyll
module Utils
module Internet
# Public: Determine whether the present device has a connection to
# the Internet. This allows plugin writers which require the outside
# world to have a neat fallback mechanism for offline building.
@@ -17,13 +18,13 @@ module Jekyll
# end
#
# Returns true if a DNS call can successfully be made, or false if not.
module_function
def connected?
!dns("example.com").nil?
end
private
module_function
def dns(domain)
require "resolv"
Resolv::DNS.open do |resolver|
@@ -32,6 +33,7 @@ module Jekyll
rescue Resolv::ResolvError, Resolv::ResolvTimeout
nil
end
end
end
end

View File

@@ -31,7 +31,7 @@ module Jekyll
# --
alias_method :really_windows?, \
:vanilla_windows?
:vanilla_windows?
#
@@ -68,7 +68,6 @@ module Jekyll
#
private
def proc_version
@proc_version ||= begin
Pathutil.new(

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "thread"
module Jekyll
module Utils
# Based on the pattern and code from
@@ -23,7 +25,9 @@ module Jekyll
def wait
@lock.synchronize do
@cond.wait(@lock) unless @flag
unless @flag
@cond.wait(@lock)
end
end
end
end

View File

@@ -21,7 +21,7 @@ module Jekyll
# is denoted as:
# EST+5 (or) EST+05:00
# Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
sign = difference.negative? ? "-" : "+"
sign = difference < 0 ? "-" : "+"
offset = sign == "-" ? "+" : "-" unless difference.zero?
#
# convert the difference (in seconds) to hours, as a rational number, and perform

View File

@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Jekyll
VERSION = "3.8.3"
VERSION = "3.8.1".freeze
end

View File

@@ -1,5 +1,4 @@
---
permalink: /404.html
layout: default
---

View File

@@ -18,8 +18,6 @@ task :release => :build do
sh "git push origin #{current_branch}"
sh "git push origin v#{version}"
sh "gem push pkg/#{name}-#{version}.gem"
puts "Do not forget to build and release the docs gem as well."
puts "https://github.com/jekyll/jekyll-docs#releasing"
end
desc "Build #{name} v#{version} into pkg/"

View File

@@ -1,4 +0,0 @@
---
render_with_liquid: false
---
{% raw %}{% endraw %}

View File

@@ -34,6 +34,10 @@ require_relative "../lib/jekyll.rb"
Jekyll.logger = Logger.new(StringIO.new, :error)
unless jruby?
require "rdiscount"
end
require "kramdown"
require "shoulda"
@@ -111,13 +115,13 @@ class JekyllUnitTest < Minitest::Test
end
def fixture_document(relative_path)
site = fixture_site(
site = fixture_site({
"collections" => {
"methods" => {
"output" => true,
},
}
)
},
})
site.read
matching_doc = site.collections["methods"].docs.find do |doc|
doc.relative_path == relative_path
@@ -138,13 +142,13 @@ class JekyllUnitTest < Minitest::Test
end
def site_configuration(overrides = {})
full_overrides = build_configs(overrides, build_configs(
"destination" => dest_dir,
"incremental" => false
))
Configuration.from(full_overrides.merge(
"source" => source_dir
))
full_overrides = build_configs(overrides, build_configs({
"destination" => dest_dir,
"incremental" => false,
}))
Configuration.from(full_overrides.merge({
"source" => source_dir,
}))
end
def clear_dest
@@ -197,6 +201,7 @@ class FakeLogger
end
module TestWEBrick
module_function
def mount_server(&block)
@@ -204,7 +209,7 @@ module TestWEBrick
begin
server.mount("/", Jekyll::Commands::Serve::Servlet, document_root,
document_root_options)
document_root_options)
server.start
addr = server.listeners[0].addr
@@ -234,11 +239,11 @@ module TestWEBrick
end
def document_root_options
WEBrick::Config::FileHandler.merge(
WEBrick::Config::FileHandler.merge({
:FancyIndexing => true,
:NondisclosureName => [
".ht*", "~*",
]
)
],
})
end
end

View File

@@ -1,9 +0,0 @@
---
title: LIQUID_TAG_REGEX excerpt whitespace control test
layout: post
---
{%- for post in site.posts -%}
You are in a maze of twisty little passages, all alike.
There's lots more to say about this, but that's enough for now.
{%- endfor -%}

View File

@@ -1,7 +0,0 @@
---
title: LIQUID_TAG_REGEX excerpt whitespace control test
layout: post
---
{%- assign xyzzy = 'You are in a maze of twisty little passages, all alike.' %}
{{- xyzzy -}}

View File

@@ -1,10 +0,0 @@
---
title: LIQUID_TAG_REGEX excerpt whitespace control test
layout: post
---
{%- for post in site.posts -%}
You are in a maze of twisty little passages, all alike.
There's lots more to say about this, but that's enough for now.
{%- endfor -%}

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