mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
2 Commits
test/pathu
...
roadmap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb04d0db3b | ||
|
|
f9411bd362 |
2
.github/CONTRIBUTING.markdown
vendored
2
.github/CONTRIBUTING.markdown
vendored
@@ -49,7 +49,7 @@ That's it! You'll be automatically subscribed to receive updates as others revie
|
||||
### Submitting a pull request via Git command line
|
||||
|
||||
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
|
||||
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
|
||||
2. Clone the repository lcoally `git clone https://github.com/<you-username>/jekyll`.
|
||||
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
|
||||
4. Hack away, add tests. Not necessarily in that order.
|
||||
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
|
||||
|
||||
74
.github/ISSUE_TEMPLATE.md
vendored
74
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,78 +1,20 @@
|
||||
<!--
|
||||
Hi! Thanks for considering to file a bug with Jekyll. Please take the time to
|
||||
answer the basic questions. You can convert `[ ]` into `[x]` to check boxes (or submit
|
||||
and check.) If there is no need for certain fields like output and redirection, please delete
|
||||
those headers before submitting. We know not all tickets require those steps.
|
||||
Otherwise, please try to be as detailed as possible.
|
||||
|
||||
If you are unsure this is a bug in Jekyll, or this is a bug caused
|
||||
by a plugin that isn't directly related to Jekyll, or if this is just
|
||||
a generic usage question, please consider asking your question at
|
||||
https://talk.jekyllrb.com where non-bug questions go.
|
||||
|
||||
Thanks!
|
||||
-->
|
||||
###### What version of Jekyll are you using (`jekyll -v`)?
|
||||
|
||||
- [ ] I believe this to be a bug, not a question about using Jekyll.
|
||||
- [ ] I Updated to the latest Jekyll (or) if on Github Pages to the latest `github-pages`
|
||||
- [ ] I Read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
|
||||
- [ ] This is a feature request.
|
||||
|
||||
---
|
||||
|
||||
- [ ] I am on (or have tested on) ***Mac OS*** 10+
|
||||
- [ ] I am on (or have tested on) ***Debian/Ubuntu*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Fedora*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Arch*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Other*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Windows*** 10+
|
||||
###### What operating system are you using?
|
||||
|
||||
<!--
|
||||
Other GNU/Linux includes Scientific GNU/Linux, CentOS GNU/Linux, and others.
|
||||
If you are on a minor sub-distro (such as ElementaryOS which does not diverge from
|
||||
Ubuntu much, please check the parent distro. Kubuntu, Edubuntu, Lubuntu should
|
||||
also be flagged as Ubuntu as their packages come from upstream Ubuntu.
|
||||
-->
|
||||
|
||||
---
|
||||
|
||||
- [ ] I was trying to install.
|
||||
- [ ] There is a broken Plugin API.
|
||||
- [ ] I had an error on Github Pages, and I have not tested locally.
|
||||
- [ ] I had an error on Github Pages, and Github Support said it was a Jekyll Bug.
|
||||
- [ ] I had an error on Github Pages and I did not test it locally.
|
||||
- [ ] I was trying to build.
|
||||
- [ ] It was another bug.
|
||||
###### What did you do?
|
||||
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
|
||||
|
||||
## My Reproduction Steps
|
||||
|
||||
<!--
|
||||
If this error occured on Github Pages, please try to provide us with logs,
|
||||
and look at them yourself, to determine if this is an actual Jekyll bug. In
|
||||
the event you are unsure, file a ticket, however, when you do please provide
|
||||
the logs (strip them of personal information.)
|
||||
|
||||
If you have trouble finding your logs, please email support@github.com and
|
||||
they will happily help you. If you cannot find logs, please try your best to
|
||||
replicate it locally because we cannot fix a problem if we do not know
|
||||
exactly what caused it, or within a relatively close distance.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Insert the steps you took to for this problem to exist. Such as the
|
||||
directories you created and, the full command you ran, and include any
|
||||
plugins you have installed, this is very important.
|
||||
|
||||
If your steps are complicated, you can also submit a Github
|
||||
repository (please no zips, they will be removed and rejected by maintainers,)
|
||||
and just supply a command for us to reproduce it ourselves.
|
||||
-->
|
||||
###### What did you expect to see?
|
||||
|
||||
## The Output I Wanted
|
||||
|
||||
<!--
|
||||
Insert the output from the command. Alter it as little as you can.
|
||||
The minimum should be personal information. Though we normally don't log
|
||||
anything like that so there should be no need to alter it.
|
||||
-->
|
||||
|
||||
###### What did you see instead?
|
||||
|
||||
|
||||
|
||||
303
.rubocop.yml
303
.rubocop.yml
@@ -1,235 +1,80 @@
|
||||
---
|
||||
Metrics/MethodLength: { Max: 24 }
|
||||
Metrics/ClassLength: { Max: 240 }
|
||||
Metrics/ModuleLength: { Max: 240 }
|
||||
Metrics/LineLength: { Max: 112 }
|
||||
Metrics/CyclomaticComplexity: { Max: 8 }
|
||||
Metrics/PerceivedComplexity: { Max: 8 }
|
||||
Metrics/ParameterLists: { Max: 4 }
|
||||
Metrics/MethodLength: { Max: 24 }
|
||||
Metrics/AbcSize: { Max: 20 }
|
||||
|
||||
Style/IndentHash: { EnforcedStyle: consistent }
|
||||
Style/HashSyntax: { EnforcedStyle: hash_rockets }
|
||||
Style/SignalException: { EnforcedStyle: only_raise }
|
||||
Style/AlignParameters: { EnforcedStyle: with_fixed_indentation }
|
||||
Style/StringLiteralsInInterpolation: { EnforcedStyle: double_quotes }
|
||||
Style/MultilineMethodCallIndentation: { EnforcedStyle: indented }
|
||||
Style/MultilineOperationIndentation: { EnforcedStyle: indented }
|
||||
Style/FirstParameterIndentation: { EnforcedStyle: consistent }
|
||||
Style/StringLiterals: { EnforcedStyle: double_quotes }
|
||||
Style/RegexpLiteral: { EnforcedStyle: slashes }
|
||||
Style/IndentArray: { EnforcedStyle: consistent }
|
||||
Style/ExtraSpacing: { AllowForAlignment: true }
|
||||
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
'%q': '{}'
|
||||
'%Q': '{}'
|
||||
'%r': '!!'
|
||||
'%s': '()'
|
||||
'%w': '()'
|
||||
'%W': '()'
|
||||
'%x': '()'
|
||||
|
||||
Style/AlignArray: { Enabled: false }
|
||||
Style/StringLiterals: { Enabled: false }
|
||||
Style/Documentation: { Enabled: false }
|
||||
Style/DoubleNegation: { Enabled: false }
|
||||
Style/UnneededCapitalW: { Enabled: false }
|
||||
Style/EmptyLinesAroundModuleBody: { Enabled: false }
|
||||
Style/EmptyLinesAroundAccessModifier: { Enabled: false }
|
||||
Style/BracesAroundHashParameters: { Enabled: false }
|
||||
Style/SpaceInsideBrackets: { Enabled: false }
|
||||
Style/IfUnlessModifier: { Enabled: false }
|
||||
Style/ModuleFunction: { Enabled: false }
|
||||
Style/RescueModifier: { Enabled: false }
|
||||
Style/GuardClause: { Enabled: false }
|
||||
Style/FileName: { Enabled: false }
|
||||
Lint/UselessAccessModifier: { Enabled: false }
|
||||
Style/SpaceAroundOperators: { Enabled: false }
|
||||
Style/RedundantReturn: { Enabled: false }
|
||||
Style/SingleLineMethods: { Enabled: false }
|
||||
|
||||
AllCops:
|
||||
TargetRubyVersion: 2.0
|
||||
Include:
|
||||
- lib/**/*.rb
|
||||
|
||||
Exclude:
|
||||
- lib/jekyll/collection.rb
|
||||
- lib/jekyll/command.rb
|
||||
- lib/jekyll/commands/build.rb
|
||||
- lib/jekyll/commands/clean.rb
|
||||
- lib/jekyll/commands/doctor.rb
|
||||
- lib/jekyll/commands/help.rb
|
||||
- lib/jekyll/commands/new.rb
|
||||
- lib/jekyll/commands/serve
|
||||
- lib/jekyll/commands/serve/servlet.rb
|
||||
- lib/jekyll/commands/serve.rb
|
||||
- lib/jekyll/configuration.rb
|
||||
- lib/jekyll/converter.rb
|
||||
- lib/jekyll/converters/identity.rb
|
||||
- lib/jekyll/converters/markdown
|
||||
- lib/jekyll/converters/markdown/kramdown_parser.rb
|
||||
- lib/jekyll/converters/markdown/rdiscount_parser.rb
|
||||
- lib/jekyll/converters/markdown/redcarpet_parser.rb
|
||||
- lib/jekyll/converters/markdown.rb
|
||||
- lib/jekyll/converters/smartypants.rb
|
||||
- lib/jekyll/convertible.rb
|
||||
- lib/jekyll/deprecator.rb
|
||||
- lib/jekyll/document.rb
|
||||
- lib/jekyll/drops/collection_drop.rb
|
||||
- lib/jekyll/drops/document_drop.rb
|
||||
- lib/jekyll/drops/drop.rb
|
||||
- lib/jekyll/drops/jekyll_drop.rb
|
||||
- lib/jekyll/drops/site_drop.rb
|
||||
- lib/jekyll/drops/unified_payload_drop.rb
|
||||
- lib/jekyll/drops/url_drop.rb
|
||||
- lib/jekyll/entry_filter.rb
|
||||
- lib/jekyll/errors.rb
|
||||
- lib/jekyll/excerpt.rb
|
||||
- lib/jekyll/external.rb
|
||||
- lib/jekyll/filters.rb
|
||||
- lib/jekyll/frontmatter_defaults.rb
|
||||
- lib/jekyll/generator.rb
|
||||
- lib/jekyll/hooks.rb
|
||||
- lib/jekyll/layout.rb
|
||||
- lib/jekyll/liquid_extensions.rb
|
||||
- lib/jekyll/liquid_renderer/file.rb
|
||||
- lib/jekyll/liquid_renderer/table.rb
|
||||
- lib/jekyll/liquid_renderer.rb
|
||||
- lib/jekyll/log_adapter.rb
|
||||
- lib/jekyll/page.rb
|
||||
- lib/jekyll/plugin.rb
|
||||
- lib/jekyll/plugin_manager.rb
|
||||
- lib/jekyll/publisher.rb
|
||||
- lib/jekyll/reader.rb
|
||||
- lib/jekyll/readers/collection_reader.rb
|
||||
- lib/jekyll/readers/data_reader.rb
|
||||
- lib/jekyll/readers/layout_reader.rb
|
||||
- lib/jekyll/readers/page_reader.rb
|
||||
- lib/jekyll/readers/post_reader.rb
|
||||
- lib/jekyll/readers/static_file_reader.rb
|
||||
- lib/jekyll/regenerator.rb
|
||||
- lib/jekyll/related_posts.rb
|
||||
- lib/jekyll/renderer.rb
|
||||
- lib/jekyll/site.rb
|
||||
- lib/jekyll/static_file.rb
|
||||
- lib/jekyll/stevenson.rb
|
||||
- lib/jekyll/tags/highlight.rb
|
||||
- lib/jekyll/tags/include.rb
|
||||
- lib/jekyll/tags/link.rb
|
||||
- lib/jekyll/tags/post_url.rb
|
||||
- lib/jekyll/theme.rb
|
||||
- lib/jekyll/url.rb
|
||||
- lib/jekyll/utils/ansi.rb
|
||||
- lib/jekyll/utils/platforms.rb
|
||||
- lib/jekyll/utils.rb
|
||||
- lib/jekyll/version.rb
|
||||
- lib/jekyll.rb
|
||||
- features/step_definitions.rb
|
||||
- features/support/formatter.rb
|
||||
- features/support/helpers.rb
|
||||
- test/helper.rb
|
||||
- test/simplecov_custom_profile.rb
|
||||
- test/test_ansi.rb
|
||||
- test/test_cleaner.rb
|
||||
- test/test_coffeescript.rb
|
||||
- test/test_collections.rb
|
||||
- test/test_command.rb
|
||||
- test/test_commands_serve.rb
|
||||
- test/test_configuration.rb
|
||||
- test/test_convertible.rb
|
||||
- test/test_doctor_command.rb
|
||||
- test/test_document.rb
|
||||
- test/test_entry_filter.rb
|
||||
- test/test_excerpt.rb
|
||||
- test/test_filters.rb
|
||||
- test/test_front_matter_defaults.rb
|
||||
- test/test_generated_site.rb
|
||||
- test/test_kramdown.rb
|
||||
- test/test_layout_reader.rb
|
||||
- test/test_liquid_extensions.rb
|
||||
- test/test_liquid_renderer.rb
|
||||
- test/test_log_adapter.rb
|
||||
- test/test_new_command.rb
|
||||
- test/test_page.rb
|
||||
- test/test_path_sanitization.rb
|
||||
- test/test_plugin_manager.rb
|
||||
- test/test_rdiscount.rb
|
||||
- test/test_redcarpet.rb
|
||||
- test/test_regenerator.rb
|
||||
- test/test_related_posts.rb
|
||||
- test/test_sass.rb
|
||||
- test/test_site.rb
|
||||
- test/test_static_file.rb
|
||||
- test/test_tags.rb
|
||||
- test/test_theme.rb
|
||||
- test/test_url.rb
|
||||
- test/test_utils.rb
|
||||
- bin/**/*
|
||||
- benchmark/**/*
|
||||
- script/**/*
|
||||
- .rubocop.yml
|
||||
- .codeclimate.yml
|
||||
- .travis.yml
|
||||
- .gitignore
|
||||
- .rspec
|
||||
|
||||
- Gemfile.lock
|
||||
- CHANGELOG.{md,markdown,txt,textile}
|
||||
- CONTRIBUTING.{md,markdown,txt,textile}
|
||||
- readme.{md,markdown,txt,textile}
|
||||
- README.{md,markdown,txt,textile}
|
||||
- Readme.{md,markdown,txt,textile}
|
||||
- ReadMe.{md,markdown,txt,textile}
|
||||
- COPYING
|
||||
- LICENSE
|
||||
|
||||
- site/**/*
|
||||
- test/**/*
|
||||
- vendor/**/*
|
||||
Lint/EndAlignment:
|
||||
Severity: error
|
||||
Lint/UnreachableCode:
|
||||
Severity: error
|
||||
Lint/UselessAccessModifier:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Max: 20
|
||||
Metrics/ClassLength:
|
||||
Max: 240
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 8
|
||||
Metrics/LineLength:
|
||||
Max: 90
|
||||
Severity: warning
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
Metrics/MethodLength:
|
||||
Max: 20
|
||||
CountComments: false
|
||||
Severity: error
|
||||
Metrics/ModuleLength:
|
||||
Max: 240
|
||||
Metrics/ParameterLists:
|
||||
Max: 4
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 8
|
||||
Style/Alias:
|
||||
Enabled: false
|
||||
Style/AlignArray:
|
||||
Enabled: false
|
||||
Style/AlignHash:
|
||||
SupportedLastArgumentHashStyles: always_ignore
|
||||
Style/AlignParameters:
|
||||
EnforcedStyle: with_fixed_indentation
|
||||
Enabled: false
|
||||
Style/AndOr:
|
||||
Severity: error
|
||||
Style/Attr:
|
||||
Enabled: false
|
||||
Style/BracesAroundHashParameters:
|
||||
Enabled: false
|
||||
Style/ClassAndModuleChildren:
|
||||
Enabled: false
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
Style/DoubleNegation:
|
||||
Enabled: false
|
||||
Style/EmptyLinesAroundAccessModifier:
|
||||
Enabled: false
|
||||
Style/EmptyLinesAroundModuleBody:
|
||||
Enabled: false
|
||||
Style/ExtraSpacing:
|
||||
AllowForAlignment: true
|
||||
Style/FileName:
|
||||
Enabled: false
|
||||
Style/FirstParameterIndentation:
|
||||
EnforcedStyle: consistent
|
||||
Style/GuardClause:
|
||||
Enabled: false
|
||||
Style/HashSyntax:
|
||||
EnforcedStyle: hash_rockets
|
||||
Severity: error
|
||||
Style/IfUnlessModifier:
|
||||
Enabled: false
|
||||
Style/IndentArray:
|
||||
EnforcedStyle: consistent
|
||||
Style/IndentHash:
|
||||
EnforcedStyle: consistent
|
||||
Style/IndentationWidth:
|
||||
Severity: error
|
||||
Style/ModuleFunction:
|
||||
Enabled: false
|
||||
Style/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/MultilineOperationIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/MultilineTernaryOperator:
|
||||
Severity: error
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
"%q": "{}"
|
||||
"%Q": "{}"
|
||||
"%r": "!!"
|
||||
"%s": "()"
|
||||
"%w": "()"
|
||||
"%W": "()"
|
||||
"%x": "()"
|
||||
Style/RedundantReturn:
|
||||
Enabled: false
|
||||
Style/RedundantSelf:
|
||||
Enabled: false
|
||||
Style/RegexpLiteral:
|
||||
EnforcedStyle: slashes
|
||||
Style/RescueModifier:
|
||||
Enabled: false
|
||||
Style/SignalException:
|
||||
EnforcedStyle: only_raise
|
||||
Style/SingleLineMethods:
|
||||
Enabled: false
|
||||
Style/SpaceAroundOperators:
|
||||
Enabled: false
|
||||
Style/SpaceInsideBrackets:
|
||||
Enabled: false
|
||||
Style/StringLiterals:
|
||||
EnforcedStyle: double_quotes
|
||||
Style/StringLiteralsInInterpolation:
|
||||
EnforcedStyle: double_quotes
|
||||
Style/UnneededCapitalW:
|
||||
Enabled: false
|
||||
- features/**/*
|
||||
- script/**/*
|
||||
- spec/**/*
|
||||
|
||||
10
.travis.yml
10
.travis.yml
@@ -9,7 +9,7 @@ rvm:
|
||||
- &ruby1 2.3.0
|
||||
- &ruby2 2.2.4
|
||||
- &ruby3 2.1.8
|
||||
- &jruby jruby-9.0.5.0
|
||||
- &jruby jruby-9.0.4.0
|
||||
- &rhead ruby-head
|
||||
|
||||
matrix:
|
||||
@@ -17,9 +17,6 @@ matrix:
|
||||
allow_failures:
|
||||
- rvm: *jruby
|
||||
- rvm: *rhead
|
||||
include:
|
||||
- rvm: 2.3.0
|
||||
env: TEST_SUITE=fmt
|
||||
env:
|
||||
matrix:
|
||||
- TEST_SUITE=test
|
||||
@@ -28,9 +25,12 @@ env:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
template: "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}"
|
||||
channels: irc.freenode.org#jekyll
|
||||
|
||||
email:
|
||||
recipients:
|
||||
- jordon@envygeeks.io
|
||||
|
||||
3
Gemfile
3
Gemfile
@@ -4,6 +4,7 @@ gemspec :name => "jekyll"
|
||||
gem "rake", "~> 11.0"
|
||||
group :development do
|
||||
gem "launchy", "~> 2.3"
|
||||
gem "rubocop", :branch => :master, :github => "bbatsov/rubocop"
|
||||
gem "pry"
|
||||
|
||||
unless RUBY_ENGINE == "jruby"
|
||||
@@ -14,7 +15,6 @@ end
|
||||
#
|
||||
|
||||
group :test do
|
||||
gem "rubocop"
|
||||
gem "cucumber", "~> 2.1"
|
||||
gem "jekyll_test_plugin"
|
||||
gem "jekyll_test_plugin_malicious"
|
||||
@@ -22,7 +22,6 @@ group :test do
|
||||
gem "rspec-mocks"
|
||||
gem "nokogiri"
|
||||
gem "rspec"
|
||||
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
@@ -19,12 +19,6 @@
|
||||
* Allow static files to be symlinked in unsafe mode or non-prod environments (#4640)
|
||||
* Add `:after_init` hook & add `Site#config=` to make resetting config easy (#4703)
|
||||
* DocumentDrop: add `#<=>` which sorts by date (falling back to path) (#4741)
|
||||
* Add a where_exp filter for filtering by expression (#4478)
|
||||
* Globalize Jekyll's Filters. (#4792)
|
||||
* Gem-based themes (#4595)
|
||||
* Allow symlinks if they point to stuff inside site.source (#4710)
|
||||
* Update colorator dependency to v1.x (#4855)
|
||||
* Move EntryFilter to use Pathutil & fix `glob_include?` (#4859)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -36,11 +30,6 @@
|
||||
* Ensures related_posts are only set for a post (#4620)
|
||||
* EntryFilter#special?: ignore filenames which begin with '~' (#4491)
|
||||
* Cleaner: `keep_files` should only apply to the beginning of paths, not substrings with index > 0 (#3849)
|
||||
* Use SSLEnable instead of EnableSSL and make URL HTTPS. (#4693)
|
||||
* convertible: use Document::YAML_FRONT_MATTER_REGEXP to parse transformable files (#4786)
|
||||
* Example in the site template should be IANA-approved example.com (#4793)
|
||||
* 3.2.x/master: Fix defaults for Documents (posts/collection docs) (#4808)
|
||||
* Don't rescue LoadError or bundler load errors for Bundler. (#4857)
|
||||
|
||||
### Development Fixes
|
||||
|
||||
@@ -52,10 +41,6 @@
|
||||
* Update Rake & disable warnings when running tests (#4720)
|
||||
* Fix many warnings (#4537)
|
||||
* Don't blindly assume the last system when determining "open" cmd (#4717)
|
||||
* Fix "locally" typo in contributing documentation (#4756)
|
||||
* Update Rubocop rules (#4886)
|
||||
* Flesh out the issue template to be much more detailed (#4849)
|
||||
* Fixing rubocop offenses in lib/jekyll/cleaner.rb (#4892)
|
||||
|
||||
### Site Enhancements
|
||||
|
||||
@@ -80,27 +65,6 @@
|
||||
* Add Hawkins to the list of third-party plugins (#4755)
|
||||
* Fix a typo in pagination doc (#4763)
|
||||
* Switch second GitHub Pages link to HTTPS (#4760)
|
||||
* Explain data file format requirements more clearly in documentation (#4781)
|
||||
* Add jekyll-i18n_tags to list of third-party plugins (#4775)
|
||||
* Remove Leonard Lamprecht's website from Sites page (#4771)
|
||||
* Updates documentation for collections to include `date` property (#4769)
|
||||
* Added an explicit rerun note to configuration.md, defaults section (#4734)
|
||||
* Update Rack-Jekyll Heroku deployment blog post url (#4789)
|
||||
* Added missing single quote on rsync client side command (#4813)
|
||||
* Organize Form Platforms-as-a-Service into unified list & add FormSpree.io (#4754)
|
||||
* Fixed typo on Configuration page (#4804)
|
||||
* Update FormKeep URL on the Resources doc (#4844)
|
||||
* site: use liquid & reduce some whitespace noise (#4854)
|
||||
* Add jekyll-breadcrumbs to list of third-party plugins (#4874)
|
||||
* Added Pug converter to list of third-party plugins (#4872)
|
||||
* Add jekyll-ideal-image-slider to list of third-party plugins (#4863)
|
||||
* Add Jekyll Tips and the Cheatsheet to the list of resources (#4887)
|
||||
* Removed extra `</p>` from `site/_docs/permalinks.md` (#4890)
|
||||
|
||||
## 3.1.3 / 2016-04-18
|
||||
|
||||
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4807)
|
||||
* Use SSLEnable instead of EnableSSL and make URL HTTPS (WEBrick) (#4693)
|
||||
|
||||
## 3.1.2 / 2016-02-19
|
||||
|
||||
@@ -249,15 +213,6 @@
|
||||
* Add Contentful Extension to list of third-party plugins (#4390)
|
||||
* Correct Minor spelling error (#4394)
|
||||
|
||||
## 3.0.5 / 2016-04-26
|
||||
|
||||
* Remove call to `#backwards_compatibilize` in `Configuration.from` (#4846)
|
||||
|
||||
## 3.0.4 / 2016-04-18
|
||||
|
||||
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4806)
|
||||
* Configuration: allow users to specify a `collections.posts.permalink` directly without `permalink` clobbering it (#4753)
|
||||
|
||||
## 3.0.3 / 2016-02-08
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -80,26 +80,6 @@ Feature: frontmatter defaults
|
||||
And I should see "main: <p>content of site/special/2013/10/14/about1.html</p>" in "_site/special/2013/10/14/about1.html"
|
||||
And I should see "main: <p>content of site/special/2013/10/14/about2.html</p>" in "_site/special/2013/10/14/about2.html"
|
||||
|
||||
Scenario: Use frontmatter scopes for subdirectories
|
||||
Given I have a _layouts directory
|
||||
And I have a main layout that contains "main: {{ content }}"
|
||||
|
||||
And I have a _posts/en directory
|
||||
And I have the following post under "en":
|
||||
| title | date | content |
|
||||
| helloworld | 2014-09-01 | {{page.lang}} is the current language |
|
||||
And I have a _posts/de directory
|
||||
And I have the following post under "de":
|
||||
| title | date | content |
|
||||
| hallowelt | 2014-09-01 | {{page.lang}} is the current language |
|
||||
|
||||
And I have a configuration file with "defaults" set to "[{scope: {path: "_posts/en"}, values: {layout: "main", lang: "en"}}, {scope: {path: "_posts/de"}, values: {layout: "main", lang: "de"}}]"
|
||||
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "main: <p>en is the current language</p>" in "_site/2014/09/01/helloworld.html"
|
||||
And I should see "main: <p>de is the current language</p>" in "_site/2014/09/01/hallowelt.html"
|
||||
|
||||
Scenario: Override frontmatter defaults by type
|
||||
Given I have a _posts directory
|
||||
And I have the following post:
|
||||
|
||||
@@ -82,9 +82,9 @@ module Jekyll
|
||||
|
||||
#
|
||||
|
||||
def background_name(keyword, name, source_line, indent)
|
||||
def background_name(keyword, name, source_line, indend)
|
||||
print_feature_element_name(
|
||||
keyword, name, source_line, indent
|
||||
keyword, name, source_line, indend
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
Feature: Writing themes
|
||||
As a hacker who likes to share my expertise
|
||||
I want to be able to make a gemified theme
|
||||
In order to share my awesome style skillz with other Jekyllites
|
||||
|
||||
Scenario: A theme with SCSS
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have a css directory
|
||||
And I have a "css/main.scss" page that contains "@import 'style';"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see ".sample {\n color: black; }" in "_site/css/main.css"
|
||||
|
||||
Scenario: A theme with an include
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have an _includes directory
|
||||
And I have an "_includes/in_project.html" file that contains "I'm in the project."
|
||||
And I have an "index.html" page that contains "{% include in_project.html %} {% include include.html %}"
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "I'm in the project." in "_site/index.html"
|
||||
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/index.html"
|
||||
|
||||
Scenario: A theme with a layout
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have an _layouts directory
|
||||
And I have an "_layouts/post.html" file that contains "post.html from the project: {{ content }}"
|
||||
And I have an "index.html" page with layout "default" that contains "I'm content."
|
||||
And I have a "post.html" page with layout "post" that contains "I'm more content."
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "default.html from test-theme: I'm content." in "_site/index.html"
|
||||
And I should see "post.html from the project: I'm more content." in "_site/post.html"
|
||||
|
||||
Scenario: Complicated site that puts it all together
|
||||
Given I have a configuration file with "theme" set to "test-theme"
|
||||
And I have a _posts directory
|
||||
And I have the following posts:
|
||||
| title | date | layout | content |
|
||||
| entry1 | 2016-04-21 | post | I am using a local layout. {% include include.html %} |
|
||||
| entry2 | 2016-04-21 | default | I am using a themed layout. {% include include.html %} {% include in_project.html %} |
|
||||
And I have a _layouts directory
|
||||
And I have a "_layouts/post.html" page with layout "default" that contains "I am a post layout! {{ content }}"
|
||||
And I have an _includes directory
|
||||
And I have an "_includes/in_project.html" file that contains "I am in the project, not the theme."
|
||||
When I run jekyll build
|
||||
Then I should get a zero exit status
|
||||
And the _site directory should exist
|
||||
And I should see "I am in the project, not the theme." in "_site/2016/04/21/entry2.html"
|
||||
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry2.html"
|
||||
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry2.html"
|
||||
And I should see "I am using a themed layout." in "_site/2016/04/21/entry2.html"
|
||||
And I should not see "I am a post layout!" in "_site/2016/04/21/entry2.html"
|
||||
And I should not see "I am in the project, not the theme." in "_site/2016/04/21/entry1.html"
|
||||
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry1.html"
|
||||
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry1.html"
|
||||
And I should see "I am using a local layout." in "_site/2016/04/21/entry1.html"
|
||||
And I should see "I am a post layout!" in "_site/2016/04/21/entry1.html"
|
||||
@@ -32,9 +32,8 @@ Gem::Specification.new do |s|
|
||||
s.add_runtime_dependency('kramdown', '~> 1.3')
|
||||
s.add_runtime_dependency('mercenary', '~> 0.3.3')
|
||||
s.add_runtime_dependency('safe_yaml', '~> 1.0')
|
||||
s.add_runtime_dependency('colorator', '~> 1.0')
|
||||
s.add_runtime_dependency('colorator', '~> 0.1')
|
||||
s.add_runtime_dependency('rouge', '~> 1.7')
|
||||
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
|
||||
s.add_runtime_dependency('jekyll-watch', '~> 1.1')
|
||||
s.add_runtime_dependency("pathutil", "~> 0.12")
|
||||
end
|
||||
|
||||
@@ -14,18 +14,13 @@ end
|
||||
|
||||
# rubygems
|
||||
require 'rubygems'
|
||||
require "pathname"
|
||||
|
||||
# DO NOT MERGE THIS COMMIT.
|
||||
require "pathutil"
|
||||
Pathname = Pathutil
|
||||
|
||||
|
||||
# stdlib
|
||||
require 'forwardable'
|
||||
require 'fileutils'
|
||||
require 'time'
|
||||
require 'English'
|
||||
require 'pathname'
|
||||
require 'logger'
|
||||
require 'set'
|
||||
|
||||
@@ -50,6 +45,7 @@ module Jekyll
|
||||
autoload :Errors, 'jekyll/errors'
|
||||
autoload :Excerpt, 'jekyll/excerpt'
|
||||
autoload :External, 'jekyll/external'
|
||||
autoload :Filters, 'jekyll/filters'
|
||||
autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults'
|
||||
autoload :Hooks, 'jekyll/hooks'
|
||||
autoload :Layout, 'jekyll/layout'
|
||||
@@ -71,7 +67,6 @@ module Jekyll
|
||||
autoload :Site, 'jekyll/site'
|
||||
autoload :StaticFile, 'jekyll/static_file'
|
||||
autoload :Stevenson, 'jekyll/stevenson'
|
||||
autoload :Theme, 'jekyll/theme'
|
||||
autoload :URL, 'jekyll/url'
|
||||
autoload :Utils, 'jekyll/utils'
|
||||
autoload :VERSION, 'jekyll/version'
|
||||
@@ -82,7 +77,6 @@ module Jekyll
|
||||
require 'jekyll/generator'
|
||||
require 'jekyll/command'
|
||||
require 'jekyll/liquid_extensions'
|
||||
require "jekyll/filters"
|
||||
|
||||
class << self
|
||||
# Public: Tells you which Jekyll environment you are building in so you can skip tasks
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
require "set"
|
||||
require 'set'
|
||||
|
||||
module Jekyll
|
||||
# Handles the cleanup of a site's destination before it is built.
|
||||
class Cleaner
|
||||
HIDDEN_FILE_REGEX = %r!\/\.{1,2}$!
|
||||
HIDDEN_FILE_REGEX = /\/\.{1,2}$/
|
||||
attr_reader :site
|
||||
|
||||
def initialize(site)
|
||||
@@ -32,8 +32,7 @@ module Jekyll
|
||||
[site.regenerator.metadata_file]
|
||||
end
|
||||
|
||||
# Private: The list of existing files, apart from those included in
|
||||
# keep_files and hidden files.
|
||||
# Private: The list of existing files, apart from those included in keep_files and hidden files.
|
||||
#
|
||||
# Returns a Set with the file paths
|
||||
def existing_files
|
||||
@@ -78,16 +77,15 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
# Private: The list of existing files that will be replaced by a directory
|
||||
# during build
|
||||
# Private: The list of existing files that will be replaced by a directory during build
|
||||
#
|
||||
# Returns a Set with the file paths
|
||||
def replaced_files
|
||||
new_dirs.select { |dir| File.file?(dir) }.to_set
|
||||
end
|
||||
|
||||
# Private: The list of directories that need to be kept because they are
|
||||
# parent directories of files specified in keep_files
|
||||
# Private: The list of directories that need to be kept because they are parent directories
|
||||
# of files specified in keep_files
|
||||
#
|
||||
# Returns a Set with the directory paths
|
||||
def keep_dirs
|
||||
@@ -97,12 +95,12 @@ module Jekyll
|
||||
# Private: Creates a regular expression from the config's keep_files array
|
||||
#
|
||||
# Examples
|
||||
# ['.git','.svn'] with site.dest "/myblog/_site" creates
|
||||
# ['.git','.svn'] with site.dest "/myblog/_site" creates
|
||||
# the following regex: /\A\/myblog\/_site\/(\.git|\/.svn)/
|
||||
#
|
||||
# Returns the regular expression
|
||||
def keep_file_regex
|
||||
%r!\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})!
|
||||
/\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -94,7 +94,7 @@ module Jekyll
|
||||
Dir.chdir(directory) do
|
||||
entry_filter.filter(entries).reject do |f|
|
||||
path = collection_dir(f)
|
||||
File.directory?(path) || entry_filter.symlink?(f)
|
||||
File.directory?(path) || (File.symlink?(f) && site.safe)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -135,7 +135,7 @@ module Jekyll
|
||||
# Returns false if the directory doesn't exist or if it's a symlink
|
||||
# and we're in safe mode.
|
||||
def exists?
|
||||
File.directory?(directory) && !entry_filter.symlink?(directory)
|
||||
File.directory?(directory) && !(File.symlink?(directory) && site.safe)
|
||||
end
|
||||
|
||||
# The entry filter for this collection.
|
||||
|
||||
@@ -35,7 +35,7 @@ module Jekyll
|
||||
File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f|
|
||||
f.write(scaffold_post_content)
|
||||
end
|
||||
|
||||
|
||||
File.open(File.expand_path("Gemfile", new_blog_path), "w") do |f|
|
||||
f.write(gemfile_contents)
|
||||
end
|
||||
@@ -63,12 +63,11 @@ module Jekyll
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
def gemfile_contents
|
||||
<<-RUBY
|
||||
source "https://rubygems.org"
|
||||
ruby RUBY_VERSION
|
||||
|
||||
|
||||
# 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:
|
||||
@@ -82,7 +81,7 @@ gem "jekyll", "#{Jekyll::VERSION}"
|
||||
# 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-github-metadata", "~> 1.0"
|
||||
|
||||
@@ -116,12 +116,11 @@ module Jekyll
|
||||
|
||||
private
|
||||
def server_address(server, opts)
|
||||
"%{prefix}://%{address}:%{port}%{baseurl}" % {
|
||||
:prefix => server.config[:SSLEnable] ? "https" : "http",
|
||||
:baseurl => opts["baseurl"] ? "#{opts["baseurl"]}/" : "",
|
||||
:address => server.config[:BindAddress],
|
||||
:port => server.config[:Port]
|
||||
}
|
||||
address = server.config[:BindAddress]
|
||||
baseurl = "#{opts["baseurl"]}/" if opts["baseurl"]
|
||||
port = server.config[:Port]
|
||||
|
||||
"http://#{address}:#{port}#{baseurl}"
|
||||
end
|
||||
|
||||
#
|
||||
@@ -183,7 +182,7 @@ module Jekyll
|
||||
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
|
||||
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
|
||||
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(File.read(source_key))
|
||||
opts[:SSLEnable] = true
|
||||
opts[:EnableSSL] = true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -286,8 +286,8 @@ module Jekyll
|
||||
def renamed_key(old, new, config, _ = nil)
|
||||
if config.key?(old)
|
||||
Jekyll::Deprecator.deprecation_message "The '#{old}' configuration" \
|
||||
" option has been renamed to '#{new}'. Please update your config" \
|
||||
" file accordingly."
|
||||
"option has been renamed to '#{new}'. Please update your config " \
|
||||
"file accordingly."
|
||||
config[new] = config.delete(old)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -39,9 +39,9 @@ module Jekyll
|
||||
filename = File.join(base, name)
|
||||
|
||||
begin
|
||||
self.content = File.read(@path || site.in_source_dir(base, name),
|
||||
self.content = File.read(site.in_source_dir(base, name),
|
||||
Utils.merged_file_read_opts(site, opts))
|
||||
if content =~ Document::YAML_FRONT_MATTER_REGEXP
|
||||
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
self.data = SafeYAML.load(Regexp.last_match(1))
|
||||
end
|
||||
@@ -215,9 +215,9 @@ module Jekyll
|
||||
payload["layout"] = Utils.deep_merge_hashes(payload["layout"] || {}, layout.data)
|
||||
|
||||
self.output = render_liquid(layout.content,
|
||||
payload,
|
||||
info,
|
||||
layout.relative_path)
|
||||
payload,
|
||||
info,
|
||||
File.join(site.config['layouts_dir'], layout.name))
|
||||
|
||||
# Add layout to dependency tree
|
||||
site.regenerator.add_dependency(
|
||||
|
||||
@@ -263,7 +263,7 @@ module Jekyll
|
||||
@data = SafeYAML.load_file(path)
|
||||
else
|
||||
begin
|
||||
defaults = @site.frontmatter_defaults.all(relative_path, collection.label.to_sym)
|
||||
defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
|
||||
merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
|
||||
|
||||
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
module Jekyll
|
||||
class EntryFilter
|
||||
SPECIAL_LEADING_CHARACTERS = ['.', '_', '#', '~'].freeze
|
||||
|
||||
attr_reader :site
|
||||
SPECIAL_LEADING_CHARACTERS = [
|
||||
'.', '_', '#', '~'
|
||||
].freeze
|
||||
|
||||
def initialize(site, base_directory = nil)
|
||||
@site = site
|
||||
@base_directory = derive_base_directory(
|
||||
@site, base_directory.to_s.dup
|
||||
)
|
||||
@base_directory = derive_base_directory(@site, base_directory.to_s.dup)
|
||||
end
|
||||
|
||||
def base_directory
|
||||
@@ -17,14 +14,14 @@ module Jekyll
|
||||
end
|
||||
|
||||
def derive_base_directory(site, base_dir)
|
||||
base_dir[site.source] = "" if base_dir.start_with?(site.source)
|
||||
if base_dir.start_with?(site.source)
|
||||
base_dir[site.source] = ""
|
||||
end
|
||||
base_dir
|
||||
end
|
||||
|
||||
def relative_to_source(entry)
|
||||
File.join(
|
||||
base_directory, entry
|
||||
)
|
||||
File.join(base_directory, entry)
|
||||
end
|
||||
|
||||
def filter(entries)
|
||||
@@ -36,9 +33,7 @@ module Jekyll
|
||||
end
|
||||
|
||||
def included?(entry)
|
||||
glob_include?(site.include,
|
||||
entry
|
||||
)
|
||||
glob_include?(site.include, entry)
|
||||
end
|
||||
|
||||
def special?(entry)
|
||||
@@ -56,62 +51,21 @@ module Jekyll
|
||||
excluded
|
||||
end
|
||||
|
||||
# --
|
||||
# Check if a file is a symlink.
|
||||
# NOTE: This can be converted to allowing even in safe,
|
||||
# since we use Pathutil#in_path? now.
|
||||
# --
|
||||
def symlink?(entry)
|
||||
site.safe && File.symlink?(entry) && symlink_outside_site_source?(entry)
|
||||
File.symlink?(entry) && site.safe
|
||||
end
|
||||
|
||||
# --
|
||||
# NOTE: Pathutil#in_path? gets the realpath.
|
||||
# @param [<Anything>] entry the entry you want to validate.
|
||||
# Check if a path is outside of our given root.
|
||||
# --
|
||||
def symlink_outside_site_source?(entry)
|
||||
!Pathutil.new(entry).in_path?(
|
||||
site.in_source_dir
|
||||
)
|
||||
def ensure_leading_slash(path)
|
||||
path[0..0] == "/" ? path : "/#{path}"
|
||||
end
|
||||
|
||||
# --
|
||||
# Check if an entry matches a specific pattern and return true,false.
|
||||
# Returns true if path matches against any glob pattern.
|
||||
# --
|
||||
# Look for more detail about glob pattern in method File::fnmatch.
|
||||
def glob_include?(enum, e)
|
||||
entry = Pathutil.new(site.in_source_dir).join(e)
|
||||
entry = ensure_leading_slash(e)
|
||||
enum.any? do |exp|
|
||||
|
||||
# Users who send a Regexp knows what they want to
|
||||
# exclude, so let them send a Regexp to exclude files,
|
||||
# we will not bother caring if it works or not, it's
|
||||
# on them at this point.
|
||||
|
||||
if exp.is_a?(Regexp)
|
||||
entry =~ exp
|
||||
|
||||
else
|
||||
item = Pathutil.new(site.in_source_dir).join(exp)
|
||||
|
||||
# If it's a directory they want to exclude, AKA
|
||||
# ends with a "/" then we will go on to check and
|
||||
# see if the entry falls within that path and
|
||||
# exclude it if that's the case.
|
||||
|
||||
if e.end_with?("/")
|
||||
entry.in_path?(
|
||||
item
|
||||
)
|
||||
|
||||
else
|
||||
File.fnmatch?(item, entry) ||
|
||||
entry.to_path.start_with?(
|
||||
item
|
||||
)
|
||||
end
|
||||
end
|
||||
item = ensure_leading_slash(exp)
|
||||
File.fnmatch?(item, entry) || entry.start_with?(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require 'uri'
|
||||
require 'json'
|
||||
require 'date'
|
||||
require 'liquid'
|
||||
|
||||
module Jekyll
|
||||
module Filters
|
||||
@@ -226,26 +225,6 @@ module Jekyll
|
||||
input.select { |object| Array(item_property(object, property)).map(&:to_s).include?(value.to_s) }
|
||||
end
|
||||
|
||||
# Filters an array of objects against an expression
|
||||
#
|
||||
# input - the object array
|
||||
# variable - the variable to assign each item to in the expression
|
||||
# expression - a Liquid comparison expression passed in as a string
|
||||
#
|
||||
# Returns the filtered array of objects
|
||||
def where_exp(input, variable, expression)
|
||||
return input unless input.is_a?(Enumerable)
|
||||
input = input.values if input.is_a?(Hash) # FIXME
|
||||
|
||||
condition = parse_condition(expression)
|
||||
@context.stack do
|
||||
input.select do |object|
|
||||
@context[variable] = object
|
||||
condition.evaluate(@context)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Sort an array of objects
|
||||
#
|
||||
# input - the object array
|
||||
@@ -384,25 +363,5 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Parse a string to a Liquid Condition
|
||||
def parse_condition(exp)
|
||||
parser = Liquid::Parser.new(exp)
|
||||
left_expr = parser.expression
|
||||
operator = parser.consume?(:comparison)
|
||||
condition =
|
||||
if operator
|
||||
Liquid::Condition.new(left_expr, operator, parser.expression)
|
||||
else
|
||||
Liquid::Condition.new(left_expr)
|
||||
end
|
||||
parser.consume(:end_of_string)
|
||||
|
||||
condition
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter(
|
||||
Jekyll::Filters
|
||||
)
|
||||
|
||||
@@ -29,14 +29,7 @@ module Jekyll
|
||||
@site = site
|
||||
@base = base
|
||||
@name = name
|
||||
|
||||
if site.theme && site.theme.layouts_path.eql?(base)
|
||||
@base_dir = site.theme.root
|
||||
@path = site.in_theme_dir(base, name)
|
||||
else
|
||||
@base_dir = site.source
|
||||
@path = site.in_source_dir(base, name)
|
||||
end
|
||||
@path = site.in_source_dir(base, name)
|
||||
|
||||
self.data = {}
|
||||
|
||||
@@ -52,13 +45,5 @@ module Jekyll
|
||||
def process(name)
|
||||
self.ext = File.extname(name)
|
||||
end
|
||||
|
||||
# The path to the layout, relative to the site source.
|
||||
#
|
||||
# Returns a String path which represents the relative path
|
||||
# from the site source to this layout
|
||||
def relative_path
|
||||
@relative_path ||= Pathname.new(path).relative_path_from(Pathname.new(@base_dir)).to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,7 +40,6 @@ module Jekyll
|
||||
@base = base
|
||||
@dir = dir
|
||||
@name = name
|
||||
@path = site.in_source_dir(base, dir, name)
|
||||
|
||||
process(name)
|
||||
read_yaml(File.join(base, dir), name)
|
||||
|
||||
@@ -30,16 +30,16 @@ module Jekyll
|
||||
def self.require_from_bundler
|
||||
if !ENV["JEKYLL_NO_BUNDLER_REQUIRE"] && File.file?("Gemfile")
|
||||
require "bundler"
|
||||
|
||||
Bundler.setup
|
||||
required_gems = Bundler.require(:jekyll_plugins)
|
||||
Bundler.setup # puts all groups on the load path
|
||||
required_gems = Bundler.require(:jekyll_plugins) # requires the gems in this group only
|
||||
Jekyll.logger.debug("PluginManager:", "Required #{required_gems.map(&:name).join(', ')}")
|
||||
ENV["JEKYLL_NO_BUNDLER_REQUIRE"] = "true"
|
||||
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
rescue LoadError, Bundler::GemfileNotFound
|
||||
false
|
||||
end
|
||||
|
||||
# Check whether a gem plugin is allowed to be used during this build.
|
||||
|
||||
@@ -4,7 +4,6 @@ module Jekyll
|
||||
def initialize(site)
|
||||
@site = site
|
||||
@content = {}
|
||||
@entry_filter = EntryFilter.new(site)
|
||||
end
|
||||
|
||||
# Read all the files in <source>/<dir>/_drafts and create a new Draft
|
||||
@@ -27,7 +26,7 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def read_data_to(dir, data)
|
||||
return unless File.directory?(dir) && !@entry_filter.symlink?(dir)
|
||||
return unless File.directory?(dir) && (!site.safe || !File.symlink?(dir))
|
||||
|
||||
entries = Dir.chdir(dir) do
|
||||
Dir['*.{yaml,yml,json,csv}'] + Dir['*'].select { |fn| File.directory?(fn) }
|
||||
@@ -35,7 +34,7 @@ module Jekyll
|
||||
|
||||
entries.each do |entry|
|
||||
path = @site.in_source_dir(dir, entry)
|
||||
next if @entry_filter.symlink?(path)
|
||||
next if File.symlink?(path) && site.safe
|
||||
|
||||
key = sanitize_filename(File.basename(entry, '.*'))
|
||||
if File.directory?(path)
|
||||
|
||||
@@ -7,12 +7,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
def read
|
||||
layout_entries.each do |layout_file|
|
||||
@layouts[layout_name(layout_file)] = Layout.new(site, layout_directory, layout_file)
|
||||
end
|
||||
|
||||
theme_layout_entries.each do |layout_file|
|
||||
@layouts[layout_name(layout_file)] ||= Layout.new(site, theme_layout_directory, layout_file)
|
||||
layout_entries.each do |f|
|
||||
@layouts[layout_name(f)] = Layout.new(site, layout_directory, f)
|
||||
end
|
||||
|
||||
@layouts
|
||||
@@ -22,23 +18,11 @@ module Jekyll
|
||||
@layout_directory ||= (layout_directory_in_cwd || layout_directory_inside_source)
|
||||
end
|
||||
|
||||
def theme_layout_directory
|
||||
@theme_layout_directory ||= site.theme.layouts_path if site.theme
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def layout_entries
|
||||
entries_in layout_directory
|
||||
end
|
||||
|
||||
def theme_layout_entries
|
||||
theme_layout_directory ? entries_in(theme_layout_directory) : []
|
||||
end
|
||||
|
||||
def entries_in(dir)
|
||||
entries = []
|
||||
within(dir) do
|
||||
within(layout_directory) do
|
||||
entries = EntryFilter.new(site).filter(Dir['**/*.*'])
|
||||
end
|
||||
entries
|
||||
|
||||
@@ -52,6 +52,7 @@ module Jekyll
|
||||
document.trigger_hooks(:pre_render, payload)
|
||||
|
||||
info = {
|
||||
:filters => [Jekyll::Filters],
|
||||
:registers => { :site => site, :page => payload['page'] }
|
||||
}
|
||||
|
||||
@@ -145,7 +146,7 @@ module Jekyll
|
||||
layout.content,
|
||||
payload,
|
||||
info,
|
||||
layout.relative_path
|
||||
File.join(site.config['layouts_dir'], layout.name)
|
||||
)
|
||||
|
||||
# Add layout to dependency tree
|
||||
|
||||
@@ -8,10 +8,10 @@ module Jekyll
|
||||
:exclude, :include, :lsi, :highlighter, :permalink_style,
|
||||
:time, :future, :unpublished, :safe, :plugins, :limit_posts,
|
||||
:show_drafts, :keep_files, :baseurl, :data, :file_read_opts,
|
||||
:gems, :plugin_manager, :theme
|
||||
:gems, :plugin_manager
|
||||
|
||||
attr_accessor :converters, :generators, :reader
|
||||
attr_reader :regenerator, :liquid_renderer, :includes_load_paths
|
||||
attr_reader :regenerator, :liquid_renderer
|
||||
|
||||
# Public: Initialize a new Site.
|
||||
#
|
||||
@@ -52,12 +52,6 @@ module Jekyll
|
||||
self.plugin_manager = Jekyll::PluginManager.new(self)
|
||||
self.plugins = plugin_manager.plugins_path
|
||||
|
||||
self.theme = nil
|
||||
self.theme = Jekyll::Theme.new(config["theme"]) if config["theme"]
|
||||
|
||||
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
|
||||
@includes_load_paths << theme.includes_path if self.theme
|
||||
|
||||
self.file_read_opts = {}
|
||||
self.file_read_opts[:encoding] = config['encoding'] if config['encoding']
|
||||
|
||||
@@ -373,19 +367,6 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Prefix a given path with the theme directory.
|
||||
#
|
||||
# paths - (optional) path elements to a file or directory within the
|
||||
# theme directory
|
||||
#
|
||||
# Returns a path which is prefixed with the theme root directory.
|
||||
def in_theme_dir(*paths)
|
||||
return nil unless theme
|
||||
paths.reduce(theme.root) do |base, path|
|
||||
Jekyll.sanitized_path(base, path)
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Prefix a given path with the destination directory.
|
||||
#
|
||||
# paths - (optional) path elements to a file or directory within the
|
||||
|
||||
@@ -12,6 +12,8 @@ module Jekyll
|
||||
end
|
||||
|
||||
class IncludeTag < Liquid::Tag
|
||||
attr_reader :includes_dir
|
||||
|
||||
VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/
|
||||
VARIABLE_SYNTAX = /(?<variable>[^{]*(\{\{\s*[\w\-\.]+\s*(\|.*)?\}\}[^\s{}]*)+)(?<params>.*)/
|
||||
|
||||
@@ -96,29 +98,20 @@ eos
|
||||
end
|
||||
end
|
||||
|
||||
def tag_includes_dirs(context)
|
||||
context.registers[:site].includes_load_paths.freeze
|
||||
end
|
||||
|
||||
def locate_include_file(context, file, safe)
|
||||
includes_dirs = tag_includes_dirs(context)
|
||||
includes_dirs.each do |dir|
|
||||
path = File.join(dir, file)
|
||||
return path if valid_include_file?(path, dir, safe)
|
||||
end
|
||||
raise IOError, "Could not locate the included file '#{file}' in any of #{includes_dirs}." \
|
||||
" Ensure it exists in one of those directories and, if it is a symlink, " \
|
||||
"does not point outside your site source."
|
||||
def tag_includes_dir(context)
|
||||
context.registers[:site].config['includes_dir'].freeze
|
||||
end
|
||||
|
||||
def render(context)
|
||||
site = context.registers[:site]
|
||||
@includes_dir = tag_includes_dir(context)
|
||||
dir = resolved_includes_dir(context)
|
||||
|
||||
file = render_variable(context) || @file
|
||||
validate_file_name(file)
|
||||
|
||||
path = locate_include_file(context, file, site.safe)
|
||||
return unless path
|
||||
path = File.join(dir, file)
|
||||
validate_path(path, dir, site.safe)
|
||||
|
||||
# Add include to dependency tree
|
||||
if context.registers[:page] && context.registers[:page].key?("path")
|
||||
@@ -128,16 +121,16 @@ eos
|
||||
)
|
||||
end
|
||||
|
||||
#begin
|
||||
begin
|
||||
partial = load_cached_partial(path, context)
|
||||
|
||||
context.stack do
|
||||
context['include'] = parse_params(context) if @params
|
||||
partial.render!(context)
|
||||
end
|
||||
#rescue => e
|
||||
#raise IncludeTagError.new e.message, path
|
||||
#end
|
||||
rescue => e
|
||||
raise IncludeTagError.new e.message, File.join(@includes_dir, @file)
|
||||
end
|
||||
end
|
||||
|
||||
def load_cached_partial(path, context)
|
||||
@@ -151,18 +144,24 @@ eos
|
||||
end
|
||||
end
|
||||
|
||||
def valid_include_file?(path, dir, safe)
|
||||
!(outside_site_source?(path, dir, safe) || !File.exist?(path))
|
||||
def resolved_includes_dir(context)
|
||||
context.registers[:site].in_source_dir(@includes_dir)
|
||||
end
|
||||
|
||||
def outside_site_source?(path, dir, safe)
|
||||
safe && !realpath_prefixed_with?(path, dir)
|
||||
def validate_path(path, dir, safe)
|
||||
if safe && !realpath_prefixed_with?(path, dir)
|
||||
raise IOError.new "The included file '#{path}' should exist and should not be a symlink"
|
||||
elsif !File.exist?(path)
|
||||
raise IOError.new "Included file '#{path_relative_to_source(dir, path)}' not found"
|
||||
end
|
||||
end
|
||||
|
||||
def path_relative_to_source(dir, path)
|
||||
File.join(@includes_dir, path.sub(Regexp.new("^#{dir}"), ""))
|
||||
end
|
||||
|
||||
def realpath_prefixed_with?(path, dir)
|
||||
File.exist?(path) && File.realpath(path).start_with?(dir)
|
||||
rescue
|
||||
false
|
||||
end
|
||||
|
||||
# This method allows to modify the file content by inheriting from the class.
|
||||
@@ -172,17 +171,16 @@ eos
|
||||
end
|
||||
|
||||
class IncludeRelativeTag < IncludeTag
|
||||
def tag_includes_dirs(context)
|
||||
Array(page_path(context)).freeze
|
||||
def tag_includes_dir(context)
|
||||
'.'.freeze
|
||||
end
|
||||
|
||||
def page_path(context)
|
||||
if context.registers[:page].nil?
|
||||
context.registers[:site].source
|
||||
else
|
||||
current_doc_dir = File.dirname(context.registers[:page]["path"])
|
||||
context.registers[:site].in_source_dir current_doc_dir
|
||||
end
|
||||
context.registers[:page].nil? ? includes_dir : File.dirname(context.registers[:page]["path"])
|
||||
end
|
||||
|
||||
def resolved_includes_dir(context)
|
||||
context.registers[:site].in_source_dir(page_path(context))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
module Jekyll
|
||||
class Theme
|
||||
extend Forwardable
|
||||
attr_reader :name
|
||||
def_delegator :gemspec, :version, :version
|
||||
|
||||
def initialize(name)
|
||||
@name = name.downcase.strip
|
||||
configure_sass
|
||||
end
|
||||
|
||||
def root
|
||||
@root ||= gemspec.full_gem_path
|
||||
end
|
||||
|
||||
def includes_path
|
||||
path_for :includes
|
||||
end
|
||||
|
||||
def layouts_path
|
||||
path_for :layouts
|
||||
end
|
||||
|
||||
def sass_path
|
||||
path_for :sass
|
||||
end
|
||||
|
||||
def configure_sass
|
||||
return unless sass_path
|
||||
require 'sass'
|
||||
Sass.load_paths << sass_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def path_for(folder)
|
||||
resolved_dir = realpath_for(folder)
|
||||
return unless resolved_dir
|
||||
|
||||
path = Jekyll.sanitized_path(root, resolved_dir)
|
||||
path if Dir.exists?(path)
|
||||
end
|
||||
|
||||
def realpath_for(folder)
|
||||
File.realpath(Jekyll.sanitized_path(root, "_#{folder}"))
|
||||
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
|
||||
nil
|
||||
end
|
||||
|
||||
def gemspec
|
||||
@gemspec ||= Gem::Specification.find_by_name(name)
|
||||
rescue Gem::LoadError
|
||||
raise Jekyll::Errors::MissingDependencyException, "The #{name} theme could not be found."
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -19,7 +19,7 @@ description: > # this means to ignore newlines until "baseurl:"
|
||||
line in _config.yml. It will appear in your document head meta (for
|
||||
Google search results) and in your feed.xml site description.
|
||||
baseurl: "" # the subpath of your site, e.g. /blog
|
||||
url: "http://example.com" # the base hostname & protocol for your site
|
||||
url: "http://yourdomain.com" # the base hostname & protocol for your site
|
||||
twitter_username: jekyllrb
|
||||
github_username: jekyll
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace :site do
|
||||
|
||||
desc "Create a nicely formatted history page for the jekyll site based on the repo history."
|
||||
task :history do
|
||||
siteify_file('History.markdown', { "title" => "History" })
|
||||
siteify_file('History.markdown')
|
||||
end
|
||||
|
||||
desc "Copy the Code of Conduct"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
bundle exec rubocop -D $@
|
||||
@@ -1,5 +1,5 @@
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
highlighter: pygments
|
||||
permalink: /news/:year/:month/:day/:title/
|
||||
excerpt_separator: ""
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
- permalinks
|
||||
- pagination
|
||||
- plugins
|
||||
- themes
|
||||
- extras
|
||||
|
||||
- title: Deployment
|
||||
|
||||
@@ -317,16 +317,6 @@ file, each document has the following attributes:
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>date</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The date of the document's collection.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -435,7 +435,7 @@ Using [YAML Front Matter](../frontmatter/) is one way that you can specify confi
|
||||
|
||||
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
|
||||
|
||||
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
|
||||
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your projects root directory.
|
||||
|
||||
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
|
||||
|
||||
@@ -450,18 +450,6 @@ defaults:
|
||||
layout: "default"
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="note info">
|
||||
<h5>Please stop and rerun `jekyll serve` command.</h5>
|
||||
<p>
|
||||
The <code>_config.yml</code> master configuration file contains global configurations
|
||||
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
|
||||
during automatic regeneration are not loaded until the next execution.
|
||||
</p>
|
||||
<p>
|
||||
Note <a href="../datafiles">Data Files</a> are included and reloaded during automatic regeneration.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Here, we are scoping the `values` to any file that exists in the scopes path. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
|
||||
|
||||
{% highlight yaml %}
|
||||
|
||||
@@ -38,7 +38,7 @@ Save the commands you want to run and succeed in a file: `./script/cibuild`
|
||||
|
||||
### The HTML Proofer Executable
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
#!/usr/bin/env bash
|
||||
set -e # halt script on error
|
||||
|
||||
@@ -52,7 +52,7 @@ Some options can be specified via command-line switches. Check out the
|
||||
|
||||
For example to avoid testing external sites, use this command:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ bundle exec htmlproofer ./_site --disable-external
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
|
||||
|
||||
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
|
||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
|
||||
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
|
||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
|
||||
* More resources are listed on our [Help page](https://jekyllrb.com/help/)
|
||||
|
||||
## Ways to contribute
|
||||
|
||||
@@ -33,7 +33,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
|
||||
|
||||
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
|
||||
|
||||
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
|
||||
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/)
|
||||
|
||||
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
|
||||
|
||||
@@ -41,7 +41,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
|
||||
|
||||
Many small changes can be made entirely through the github.com web interface.
|
||||
|
||||
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit.
|
||||
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit
|
||||
2. Click the pencil icon in the top right corner to edit the file
|
||||
3. Make your proposed changes
|
||||
4. Click "Propose file change"
|
||||
@@ -53,13 +53,13 @@ That's it! You'll be automatically subscribed to receive updates as others revie
|
||||
|
||||
### Submitting a pull request via Git command line
|
||||
|
||||
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
|
||||
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
|
||||
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll)
|
||||
2. Clone the repository lcoally `git clone https://github.com/<you-username>/jekyll`
|
||||
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
|
||||
4. Hack away, add tests. Not necessarily in that order.
|
||||
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
|
||||
6. Push the branch up ( `git push origin my-awesome-feature` ).
|
||||
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
|
||||
7. Create a pull request by visiting https://github.com/<your-username>/jekyll/ and following the instructions at the top of the screen.
|
||||
|
||||
## Proposing updates to the documentation
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ Plugins/themes can also leverage Data Files to set configuration variables.
|
||||
|
||||
As explained on the [directory structure](../structure/) page, the `_data`
|
||||
folder is where you can store additional data for Jekyll to use when generating
|
||||
your site. These files must be YAML, JSON, or CSV files (using either
|
||||
the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be
|
||||
your site. These files must be YAML files
|
||||
(using either the `.yml`, `.yaml`, `.json` or `csv` extension) and they will be
|
||||
accessible via `site.data`.
|
||||
|
||||
## Example: List of members
|
||||
|
||||
@@ -35,7 +35,7 @@ this](http://web.archive.org/web/20091223025644/http://www.taknado.com/en/2009/0
|
||||
|
||||
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
laptop$ ssh deployer@example.com
|
||||
server$ mkdir myrepo.git
|
||||
server$ cd myrepo.git
|
||||
@@ -47,7 +47,7 @@ server$ mkdir /var/www/myrepo
|
||||
Next, add the following lines to hooks/post-receive and be sure Jekyll is
|
||||
installed on the server:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
GIT_REPO=$HOME/myrepo.git
|
||||
TMP_GIT_CLONE=$HOME/tmp/myrepo
|
||||
PUBLIC_WWW=/var/www/myrepo
|
||||
@@ -61,14 +61,14 @@ exit
|
||||
Finally, run the following command on any users laptop that needs to be able to
|
||||
deploy using this hook:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
laptops$ git remote add deploy deployer@example.com:~/myrepo.git
|
||||
{% endhighlight %}
|
||||
|
||||
Deploying is now as easy as telling nginx or Apache to look at
|
||||
`/var/www/myrepo` and running the following:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
laptops$ git push deploy master
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -129,7 +129,7 @@ is to put the restriction to certificate-based authorization in
|
||||
`~/.ssh/authorized_keys`. Then, launch `rrsync` and supply
|
||||
it with the folder it shall have read-write access to:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
command="$HOME/bin/rrsync <folder>",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa <cert>
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -139,10 +139,10 @@ command="$HOME/bin/rrsync <folder>",no-agent-forwarding,no-port-forwarding,no-pt
|
||||
|
||||
Add the `deploy` script to the site source folder:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
#!/bin/sh
|
||||
|
||||
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
|
||||
rsync -crvz --rsh=ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
|
||||
{% endhighlight %}
|
||||
|
||||
Command line parameters are:
|
||||
@@ -155,7 +155,7 @@ your host uses a different port than the default (e.g, HostGator)
|
||||
|
||||
Using this setup, you might run the following command:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded _site/ hostuser@example.org:
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -186,7 +186,7 @@ script executes.
|
||||
|
||||
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
|
||||
|
||||
Read [this post](http://andycroll.com/ruby/serving-a-jekyll-blog-using-heroku) on how to deploy to Heroku using Rack-Jekyll.
|
||||
Read [this post](http://blog.crowdint.com/2010/08/02/instant-blog-using-jekyll-and-heroku.html) on how to deploy to Heroku using Rack-Jekyll.
|
||||
|
||||
## Jekyll-Admin for Rails
|
||||
|
||||
|
||||
@@ -5,13 +5,6 @@ permalink: "/docs/history/"
|
||||
note: This file is autogenerated. Edit /History.markdown instead.
|
||||
---
|
||||
|
||||
## 3.1.3 / 2016-04-18
|
||||
{: #v3-1-3}
|
||||
|
||||
- Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` ([#4807]({{ site.repository }}/issues/4807))
|
||||
- Use SSLEnable instead of EnableSSL and make URL HTTPS (WEBrick) ([#4693]({{ site.repository }}/issues/4693))
|
||||
|
||||
|
||||
## 3.1.2 / 2016-02-19
|
||||
{: #v3-1-2}
|
||||
|
||||
@@ -175,19 +168,6 @@ note: This file is autogenerated. Edit /History.markdown instead.
|
||||
- Correct Minor spelling error ([#4394]({{ site.repository }}/issues/4394))
|
||||
|
||||
|
||||
## 3.0.5 / 2016-04-26
|
||||
{: #v3-0-5}
|
||||
|
||||
- Remove call to `#backwards_compatibilize` in `Configuration.from` ([#4846]({{ site.repository }}/issues/4846))
|
||||
|
||||
|
||||
## 3.0.4 / 2016-04-18
|
||||
{: #v3-0-4}
|
||||
|
||||
- Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` ([#4806]({{ site.repository }}/issues/4806))
|
||||
- Configuration: allow users to specify a `collections.posts.permalink` directly without `permalink` clobbering it ([#4753]({{ site.repository }}/issues/4753))
|
||||
|
||||
|
||||
## 3.0.3 / 2016-02-08
|
||||
{: #v3-0-3}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ The best way to install Jekyll is via
|
||||
[RubyGems](http://rubygems.org/pages/download). At the terminal prompt,
|
||||
simply run the following command to install Jekyll:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ gem install jekyll
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -62,14 +62,14 @@ community can improve the experience for everyone.
|
||||
In order to install a pre-release, make sure you have all the requirements
|
||||
installed properly and run:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
gem install jekyll --pre
|
||||
{% endhighlight %}
|
||||
|
||||
This will install the latest pre-release. If you want a particular pre-release,
|
||||
use the `-v` switch to indicate the version you'd like to install:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
gem install jekyll -v '2.0.0.alpha.1'
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -77,7 +77,7 @@ If you'd like to install a development version of Jekyll, the process is a bit
|
||||
more involved. This gives you the advantage of having the latest and greatest,
|
||||
but may be unstable.
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ git clone git://github.com/jekyll/jekyll.git
|
||||
$ cd jekyll
|
||||
$ script/bootstrap
|
||||
|
||||
@@ -46,7 +46,7 @@ directory with a suitable name for the page you want to create. For a site with
|
||||
a homepage, an about page, and a contact page, here’s what the root directory
|
||||
and associated URLs might look like:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
.
|
||||
|-- _config.yml
|
||||
|-- _includes/
|
||||
@@ -69,7 +69,7 @@ the page URL ends up being the folder name, and the web server will serve up
|
||||
the respective `index.html` file. Here's an example of what this structure
|
||||
might look like:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
.
|
||||
├── _config.yml
|
||||
├── _includes/
|
||||
|
||||
@@ -101,6 +101,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti
|
||||
<p>
|
||||
Second of the minute from the post’s <code>date</code> front matter. (00..59)
|
||||
</p>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -757,7 +757,6 @@ LESS.js files during generation.
|
||||
- [Textile converter](https://github.com/jekyll/jekyll-textile-converter): Convert `.textile` files into HTML. Also includes the `textilize` Liquid filter.
|
||||
- [Slim plugin](https://github.com/slim-template/jekyll-slim): Slim converter and includes for Jekyll with support for Liquid tags.
|
||||
- [Jade plugin by John Papandriopoulos](https://github.com/snappylabs/jade-jekyll-plugin): Jade converter for Jekyll.
|
||||
- [Pug plugin by Josh Waller](https://github.com/mdxprograms/pug-jekyll-plugin): Pug (previously Jade) converter for Jekyll.
|
||||
- [HAML plugin by Sam Z](https://gist.github.com/517556): HAML converter for Jekyll.
|
||||
- [HAML-Sass Converter by Adam Pearson](https://gist.github.com/481456): Simple HAML-Sass converter for Jekyll. [Fork](https://gist.github.com/528642) by Sam X.
|
||||
- [Sass SCSS Converter by Mark Wolfe](https://gist.github.com/960150): Sass converter which uses the new CSS compatible syntax, based Sam X’s fork above.
|
||||
@@ -859,8 +858,6 @@ LESS.js files during generation.
|
||||
- [Jekyll Flickr Plugin](https://github.com/lawmurray/indii-jekyll-flickr) by [Lawrence Murray](http://www.indii.org): Embeds Flickr photosets (albums) as a gallery of thumbnails, with lightbox links to larger images.
|
||||
- [jekyll-figure](https://github.com/paulrobertlloyd/jekyll-figure): A liquid tag for Jekyll that generates `<figure>` elements.
|
||||
- [Jekyll Video Embed](https://github.com/eug/jekyll-video-embed): It provides several tags to easily embed videos (e.g. Youtube, Vimeo, UStream and Ted Talks)
|
||||
- [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags): Translate your templates.
|
||||
- [Jekyll Ideal Image Slider](https://github.com/xHN35RQ/jekyll-ideal-image-slider): Liquid tag plugin to create image sliders using [Ideal Image Slider](https://github.com/gilbitron/Ideal-Image-Slider).
|
||||
|
||||
#### Collections
|
||||
|
||||
@@ -902,8 +899,6 @@ LESS.js files during generation.
|
||||
- [Official Contentful Jekyll Plugin](https://github.com/contentful/jekyll-contentful-data-import): Adds a `contentful` sub-command to Jekyll to import data from Contentful.
|
||||
- [jekyll-paspagon](https://github.com/KrzysiekJ/jekyll-paspagon): Sell your posts in various formats for cryptocurrencies.
|
||||
- [Hawkins](https://github.com/awood/hawkins): Adds a `liveserve` sub-command to Jekyll that incorporates [LiveReload](http://livereload.com/) into your pages while you preview them. No more hitting the refresh button in your browser!
|
||||
- [Jekyll Autoprefixer](https://github.com/vwochnik/jekyll-autoprefixer): Autoprefixer integration for Jekyll
|
||||
- [Jekyll-breadcrumbs](https://github.com/git-no/jekyll-breadcrumbs): Creates breadcrumbs for Jekyll 3.x, includes features like SEO optimization, optional breadcrumb item translation and more.
|
||||
|
||||
#### Editors
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ To create a new post, all you need to do is create a file in the `_posts`
|
||||
directory. How you name files in this folder is important. Jekyll requires blog
|
||||
post files to be named according to the following format:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
YEAR-MONTH-DAY-title.MARKUP
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -35,7 +35,7 @@ Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit
|
||||
numbers, and `MARKUP` is the file extension representing the format used in the
|
||||
file. For example, the following are examples of valid post filenames:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
2011-12-31-new-years-eve-is-awesome.md
|
||||
2012-09-12-how-to-write-a-blog.textile
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -6,7 +6,7 @@ permalink: /docs/quickstart/
|
||||
|
||||
For the impatient, here's how to get a boilerplate Jekyll site up and running.
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
~ $ gem install jekyll
|
||||
~ $ jekyll new myblog
|
||||
~ $ cd myblog
|
||||
|
||||
@@ -8,8 +8,6 @@ Jekyll’s growing use is producing a wide variety of tutorials, frameworks, ext
|
||||
|
||||
### Useful Guides
|
||||
|
||||
- [Jekyll Tips](http://jekyll.tips) is a set of resources created by [CloudCannon](https://cloudcannon.com) to help folks get up and running with Jekyll. The cover all skill levels, and even include some great video tutorials.
|
||||
- [Jekyll Cheatsheet](http://cheat.jekyll.tips) is a single-page resource for Jekyll filters, variables, and the like.
|
||||
- [“Creating and Hosting a Personal Site on GitHub”](http://jmcglone.com/guides/github-pages/)
|
||||
- [‘Build A Blog With Jekyll And GitHub Pages’ on Smashing Magazine](http://www.smashingmagazine.com/2014/08/01/build-blog-jekyll-github-pages/)
|
||||
- Publishing to GitHub Pages? [Check out our documentation page for just that purpose](/docs/github-pages/).
|
||||
@@ -18,10 +16,8 @@ Jekyll’s growing use is producing a wide variety of tutorials, frameworks, ext
|
||||
|
||||
### Integrations
|
||||
|
||||
- Use a saas service as a backend for forms (contact forms, hiring forms, etc.)
|
||||
- [Formspree (also open source)](http://formspree.io/)
|
||||
- [FormKeep](https://formkeep.com/guides/contact-form-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
|
||||
- [Simple Form](http://getsimpleform.com/)
|
||||
- [Use FormKeep as a backend for forms (contact forms, hiring forms, etc.)](https://formkeep.com/guides/how-to-make-a-contact-form-in-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
|
||||
- [Use Simple Form to add a simple contact form](http://getsimpleform.com/)
|
||||
- [Jekyll Bootstrap](http://jekyllbootstrap.com), 0 to Blog in 3 minutes. Provides detailed explanations, examples, and helper-code to make getting started with Jekyll easier.
|
||||
- [Integrating Twitter with Jekyll](http://www.justkez.com/integrating-twitter-with-jekyll/)
|
||||
> “Having migrated Justkez.com to be based on Jekyll, I was pondering how I might include my recent twitterings on the front page of the site. In the WordPress world, this would have been done via a plugin which may or may not have hung the loading of the page, might have employed caching, but would certainly have had some overheads. … Not in Jekyll.”
|
||||
|
||||
@@ -14,6 +14,8 @@ learning purposes.
|
||||
([source](https://github.com/github/training-kit))
|
||||
- [Rasmus Andersson](http://rsms.me/)
|
||||
([source](https://github.com/rsms/rsms.github.com))
|
||||
- [Leonard Lamprecht](http://leo.im)
|
||||
([source](https://github.com/leo/leo.github.io))
|
||||
|
||||
If you would like to explore more examples, you can find a list of sites
|
||||
and their sources on the ["Sites" page in the Jekyll wiki][jekyll-sites].
|
||||
|
||||
@@ -14,7 +14,7 @@ product.
|
||||
|
||||
A basic Jekyll site usually looks something like this:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
.
|
||||
├── _config.yml
|
||||
├── _drafts
|
||||
|
||||
@@ -88,22 +88,6 @@ common tasks easier.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Where Expression</strong></p>
|
||||
<p>Select all the objects in an array where the expression is true.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p>
|
||||
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
|
||||
"item.graduation_year == 2014" }}{% endraw %}</code>
|
||||
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
|
||||
"item.graduation_year < 2014" }}{% endraw %}</code>
|
||||
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
|
||||
"item.projects contains 'foo'" }}{% endraw %}</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class="name"><strong>Group By</strong></p>
|
||||
@@ -341,7 +325,7 @@ The default is `default`. They are as follows (with what they filter):
|
||||
If you have small page fragments that you wish to include in multiple places on
|
||||
your site, you can use the `include` tag.
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight ruby %}
|
||||
{% raw %}{% include footer.html %}{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -362,13 +346,13 @@ root of your source directory. This will embed the contents of
|
||||
|
||||
You can also pass parameters to an include. Omit the quotation marks to send a variable's value. Liquid curly brackets should not be used here:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight ruby %}
|
||||
{% raw %}{% include footer.html param="value" variable-param=page.variable %}{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
These parameters are available via Liquid in the include:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight ruby %}
|
||||
{% raw %}{{ include.param }}{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -376,7 +360,7 @@ These parameters are available via Liquid in the include:
|
||||
|
||||
You can also choose to include file fragments relative to the current file:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight ruby %}
|
||||
{% raw %}{% include_relative somedir/footer.html %}{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -404,7 +388,7 @@ languages](http://pygments.org/languages/)
|
||||
|
||||
To render a code block with syntax highlighting, surround your code as follows:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
{% highlight ruby %}
|
||||
def foo
|
||||
@@ -427,7 +411,7 @@ Including the `linenos` argument will force the highlighted code to include line
|
||||
numbers. For instance, the following code block would include line numbers next
|
||||
to each line:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
{% highlight ruby linenos %}
|
||||
def foo
|
||||
@@ -452,7 +436,7 @@ numbers from the highlighted code.
|
||||
If you would like 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.
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
{% post_url 2010-07-21-name-of-post %}
|
||||
{% endraw %}
|
||||
@@ -461,7 +445,7 @@ will generate the correct permalink URL for the post you specify.
|
||||
If you organize your posts in subdirectories, you need to include subdirectory
|
||||
path to the post:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
{% post_url /subdir/2010-07-21-name-of-post %}
|
||||
{% endraw %}
|
||||
@@ -471,7 +455,7 @@ There is no need to include the file extension when using the `post_url` tag.
|
||||
|
||||
You can also use this tag to create a link to a post in Markdown as follows:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
[Name of Link]({% post_url 2010-07-21-name-of-post %})
|
||||
{% endraw %}
|
||||
@@ -482,7 +466,7 @@ You can also use this tag to create a link to a post in Markdown as follows:
|
||||
Use the `gist` tag to easily embed a GitHub Gist onto your site. This works
|
||||
with public or secret gists:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
{% gist parkr/931c1c8d465a04042403 %}
|
||||
{% endraw %}
|
||||
@@ -490,7 +474,7 @@ with public or secret gists:
|
||||
|
||||
You may also optionally specify the filename in the gist to display:
|
||||
|
||||
{% highlight liquid %}
|
||||
{% highlight text %}
|
||||
{% raw %}
|
||||
{% gist parkr/931c1c8d465a04042403 jekyll-private-gist.markdown %}
|
||||
{% endraw %}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
---
|
||||
layout: docs
|
||||
title: Themes
|
||||
permalink: /docs/themes/
|
||||
---
|
||||
|
||||
<div class="note unreleased">
|
||||
<h5>This feature is unreleased!</h5>
|
||||
<p>
|
||||
Jekyll 3.0 and 3.1 do NOT have the ability to add themes in this way.
|
||||
The documentation below is for an unreleased version of Jekyll and
|
||||
cannot be used at the moment.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Jekyll has an extensive theme system, which allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site's content.
|
||||
|
||||
## Installing a theme
|
||||
|
||||
1. To install a theme, first, add the theme to your site's `Gemfile`:
|
||||
|
||||
gem 'my-awesome-jekyll-theme'
|
||||
|
||||
2. Save the changes to your `Gemfile`
|
||||
3. Run the command `bundle install` to install the theme
|
||||
4. Finally, activate the theme by adding the following to your site's `_config.yml`:
|
||||
|
||||
theme: my-awesome-jekyll-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 }
|
||||
|
||||
## Overriding theme defaults
|
||||
|
||||
Jekyll themes set default layouts, includes, and stylesheets, that can be overridden by your site's content. For example, if your selected theme has a `page` layout, you can override the theme's layout by creating your own `page` layout in the `_layouts` folder (e.g., `_layouts/page.html`).
|
||||
|
||||
Jekyll will look first to your site's content, before looking to the theme's defaults, for any requested file in the following folders:
|
||||
|
||||
* `/_layouts`
|
||||
* `/_includes`
|
||||
* `/_sass`
|
||||
|
||||
Refer to your selected theme's documentation and source repository for more information on what files you can override.
|
||||
{: .note .info}
|
||||
|
||||
## Creating a theme
|
||||
|
||||
Jekyll themes are distributed as Ruby gems. The only required file is the [Ruby Gemspec](http://guides.rubygems.org/specification-reference/). Here's an example of a minimal Gemspec for the `my-awesome-jekyll-theme` theme, saved as `/my-awsome-jekyll-theme.gemspec`:
|
||||
|
||||
{% highlight ruby %}
|
||||
Gem::Specification.new do |s|
|
||||
s.name = '<THEME TITLE>'
|
||||
s.version = '0.1.0'
|
||||
s.license = 'MIT'
|
||||
s.summary = '<THEME DESCRIPTION>'
|
||||
s.author = '<YOUR NAME>'
|
||||
s.email = '<YOUR EMAIL>'
|
||||
s.homepage = 'https://github.com/jekyll/my-awesome-jekyll-theme'
|
||||
s.files = `git ls-files -z`.split("\x0").grep(%r{^_(sass|includes|layouts)/})
|
||||
end
|
||||
{% endhighlight %}
|
||||
|
||||
### Layouts and includes
|
||||
|
||||
Theme layouts and includes work just like they work in any Jekyll site. Place layouts in your theme's `/_layouts` folder, and place includes in your themes `/_includes` folder.
|
||||
|
||||
For example, if your theme has a `/_layouts/page.html` file, and a page has `layout: page` in its YAML front matter, Jekyll will first look to the site's `_layouts` folder for a the `page` layout, and if none exists, will use your theme's `page` layout.
|
||||
|
||||
### Stylesheets
|
||||
|
||||
Your theme's stylesheets should be placed in your theme's `/_sass` folder, again, just as you would when authoring a Jekyll site. Your theme's styles can be included in the user's stylesheet using the `@import` directive.
|
||||
|
||||
### Documenting your theme
|
||||
|
||||
Your theme should include a `/README.md` file, which explains how site authors can install and use your theme. What layouts are included? What includes? Do they need to add anything special to their site's configuration file?
|
||||
|
||||
### Adding a screenshot
|
||||
|
||||
Themes are visual. Show users what your theme looks like by including a screenshot as `/screenshot.png` within your theme's repository where it can be retrieved programatically. You can also include this screenshot within your theme's documentation.
|
||||
|
||||
### Previewing your theme
|
||||
|
||||
To preview your theme as you're authoring it, it may be helpful to add dummy content in, for example, `/index.html` and `/page.html` files. This will allow you to use the `jekyll build` and `jekyll serve` commands to preview your theme, just as you'd preview a Jekyll site.
|
||||
|
||||
If you do preview your theme locally, be sure to add `/_site` to your theme's `.gitignore` file to prevent the compiled site from also being included when you distribute your theme.
|
||||
{: .info .note}
|
||||
|
||||
### Publishing your theme
|
||||
|
||||
Themes are published via [RubyGems.org](https://rubygems.org). You'll need a RubyGems account, which you can [create for free](https://rubygems.org/sign_up).
|
||||
|
||||
1. First, package your theme, by running the following command, replacing `my-awesome-jekyll-theme` with the name of your theme:
|
||||
|
||||
gem build my-awesome-jekyll-theme.gemspec
|
||||
|
||||
2. Next, push your packaged theme up to the RubyGems service, by running the following command, again replacing `my-awesome-jekyll-theme` with the name of your theme:
|
||||
|
||||
gem push my-awesome-jekyll-theme-*.gem
|
||||
@@ -20,19 +20,19 @@ If you encounter errors during gem installation, you may need to install
|
||||
the header files for compiling extension modules for Ruby 2.0.0. This
|
||||
can be done on Ubuntu or Debian by running:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo apt-get install ruby2.0.0-dev
|
||||
{% endhighlight %}
|
||||
|
||||
On Red Hat, CentOS, and Fedora systems you can do this by running:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo yum install ruby-devel
|
||||
{% endhighlight %}
|
||||
|
||||
If you installed the above - specifically on Fedora 23 - but the extensions would still not compile, you are probably running a Fedora image that misses the `redhat-rpm-config` package. To solve this, simply run:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo dnf install redhat-rpm-config
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -40,7 +40,7 @@ sudo dnf install redhat-rpm-config
|
||||
On [NearlyFreeSpeech](https://www.nearlyfreespeech.net/) you need to run the
|
||||
following commands before installing Jekyll:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
export GEM_HOME=/home/private/gems
|
||||
export GEM_PATH=/home/private/gems:/usr/local/lib/ruby/gems/1.8/
|
||||
export PATH=$PATH:/home/private/gems/bin
|
||||
@@ -49,7 +49,7 @@ export RB_USER_INSTALL='true'
|
||||
|
||||
To install RubyGems on Gentoo:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo emerge -av dev-ruby/rubygems
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -58,21 +58,21 @@ DevKit](https://wiki.github.com/oneclick/rubyinstaller/development-kit).
|
||||
|
||||
On Mac OS X, you may need to update RubyGems (using `sudo` only if necessary):
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo gem update --system
|
||||
{% endhighlight %}
|
||||
|
||||
If you still have issues, you can download and install new Command Line
|
||||
Tools (such as `gcc`) using the command
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
xcode-select --install
|
||||
{% endhighlight %}
|
||||
|
||||
which may allow you to install native gems using this command (again using
|
||||
`sudo` only if necessary):
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo gem install jekyll
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -90,20 +90,20 @@ longer available. Given these changes, there are a couple of simple ways to get
|
||||
up and running. One option is to change the location where the gem will be
|
||||
installed (again using `sudo` only if necessary):
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
sudo gem install -n /usr/local/bin jekyll
|
||||
{% endhighlight %}
|
||||
|
||||
Alternatively, Homebrew can be installed and used to set up Ruby. This can be
|
||||
done as follows:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
{% endhighlight %}
|
||||
|
||||
Once Homebrew is installed, the second step is easy:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
brew install ruby
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -119,13 +119,13 @@ which to install Jekyll.
|
||||
If you elect to use one of the above methods to install Ruby, it might be
|
||||
necessary to modify your `$PATH` variable using the following command:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
export PATH=/usr/local/bin:$PATH
|
||||
{% endhighlight %}
|
||||
|
||||
GUI apps can modify the `$PATH` as follows:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
launchctl setenv PATH "/usr/local/bin:$PATH"
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -151,19 +151,19 @@ in order to have the `jekyll` executable be available in your Terminal.
|
||||
|
||||
If you are using base-url option like:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
jekyll serve --baseurl '/blog'
|
||||
{% endhighlight %}
|
||||
|
||||
… then make sure that you access the site at:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
http://localhost:4000/blog/index.html
|
||||
{% endhighlight %}
|
||||
|
||||
It won’t work to just access:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
http://localhost:4000/blog
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -192,7 +192,7 @@ The latest version, version 2.0, seems to break the use of `{{ "{{" }}` in
|
||||
templates. Unlike previous versions, using `{{ "{{" }}` in 2.0 triggers the
|
||||
following error:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
'{{ "{{" }}' was not properly terminated with regexp: /\}\}/ (Liquid::SyntaxError)
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ and 2.0 that you'll want to know about.
|
||||
|
||||
Before we dive in, go ahead and fetch the latest version of Jekyll:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ gem update jekyll
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ that you'll want to know about.
|
||||
|
||||
Before we dive in, go ahead and fetch the latest version of Jekyll:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ gem update jekyll
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ permalink: /docs/usage/
|
||||
The Jekyll gem makes a `jekyll` executable available to you in your Terminal
|
||||
window. You can use this command in a number of ways:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ jekyll build
|
||||
# => The current folder will be generated into ./_site
|
||||
|
||||
@@ -52,7 +52,7 @@ $ jekyll build --watch
|
||||
Jekyll also comes with a built-in development server that will allow you to
|
||||
preview what the generated site will look like in your browser locally.
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ jekyll serve
|
||||
# => A development server will run at http://localhost:4000/
|
||||
# Auto-regeneration: enabled. Use `--no-watch` to disable.
|
||||
@@ -70,7 +70,7 @@ $ jekyll serve --detach
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ jekyll serve --no-watch
|
||||
# => Same as `jekyll serve` but will not watch for changes.
|
||||
{% endhighlight %}
|
||||
@@ -89,7 +89,7 @@ destination: _deploy
|
||||
|
||||
Then the following two commands will be equivalent:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ jekyll build
|
||||
$ jekyll build --source _source --destination _deploy
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -27,7 +27,7 @@ Additionally, you might need to change the code page of the console window to UT
|
||||
in case you get a "Liquid Exception: Incompatible character encoding" error during
|
||||
the site generation process. It can be done with the following command:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ chcp 65001
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
{% for item in include.items %}
|
||||
{% assign items = include.items %}
|
||||
|
||||
{% for item in items %}
|
||||
{% assign item_url = item | prepend:"/docs/" | append:"/" %}
|
||||
{% assign doc = site.docs | where: "url", item_url | first %}
|
||||
<option value="{{ site.url }}{{ doc.url }}">{{ doc.title }}</option>
|
||||
|
||||
{% for p in site.docs %}
|
||||
{% if p.url == item_url %}
|
||||
<option value="{{ site.url }}{{ p.url }}">{{ p.title }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
{% assign items = include.items %}
|
||||
|
||||
<ul>
|
||||
{% for item in include.items %}
|
||||
{% for item in items %}
|
||||
{% assign item_url = item | prepend:"/docs/" | append:"/" %}
|
||||
{% assign p = site.docs | where:"url", item_url | first %}
|
||||
<li class="{% if item_url == page.url %}current{% endif %}"><a href="{{ site.url }}{{ p.url }}">{{ p.title }}</a></li>
|
||||
|
||||
{% if item_url == page.url %}
|
||||
{% assign c = "current" %}
|
||||
{% else %}
|
||||
{% assign c = "" %}
|
||||
{% endif %}
|
||||
|
||||
{% assign p = site.docs | where:"url",item_url | first %}
|
||||
<li class="{{ c }}"><a href="{{ site.url }}{{ p.url }}">{{ p.title }}</a></li>
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -20,7 +20,7 @@ to get a feel for what changes are afoot. Key features:
|
||||
|
||||
To install just run:
|
||||
|
||||
{% highlight shell %}
|
||||
{% highlight bash %}
|
||||
$ gem install jekyll --pre
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
---
|
||||
layout: news_item
|
||||
title: 'Jekyll 3.0.4 Released'
|
||||
date: 2016-04-19 10:26:12 -0700
|
||||
author: parkr
|
||||
version: 3.0.4
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
v3.0.4 is a patch release which fixes the follow two issues:
|
||||
|
||||
- Front matter defaults may not have worked for collection documents and posts due to a problem where they were looked up by their URL rather than their path relative to the site source
|
||||
- Configuration for the posts permalink might be borked when a user specified a value for `collections.posts.permalink` directly. This forced the use of `permalink` at the top level, which also affected pages. To configure a permalink _just for posts_, you can do so with:
|
||||
|
||||
{% highlight yaml %}
|
||||
collections:
|
||||
posts:
|
||||
output: true
|
||||
permalink: /blog/:year/:title/
|
||||
{% endhighlight %}
|
||||
|
||||
Both of these issues have been resolved. For more information, check out [the full history](/docs/history/#v3-0-4).
|
||||
|
||||
Happy Jekylling!
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
layout: news_item
|
||||
title: 'Jekyll 3.1.3 Released'
|
||||
date: 2016-04-19 10:26:16 -0700
|
||||
author: parkr
|
||||
version: 3.1.3
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
v3.1.3 is a patch release which fixes the follow two issues:
|
||||
|
||||
- Front matter defaults may not have worked for collection documents and posts due to a problem where they were looked up by their URL rather than their path relative to the site source
|
||||
- Running `jekyll serve` with SSL enabled was broken due to a bad configuration.
|
||||
|
||||
Both of these issues have been resolved. For more information, check out [the full history](/docs/history/#v3-1-3).
|
||||
|
||||
Happy Jekylling!
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
layout: news_item
|
||||
title: 'Jekyll 3.0.5 Released'
|
||||
date: 2016-04-26 17:40:44 -0700
|
||||
author: parkr
|
||||
version: 3.0.5
|
||||
categories: [release]
|
||||
---
|
||||
|
||||
This version fixes a bug affecting only v3.0.4 where autoregeneration was
|
||||
*always* disabled when running Jekyll locally. This feature is a huge
|
||||
reason why Jekyll (or any static site generator, for that matter) is a joy
|
||||
to use. Sorry for the regression!
|
||||
|
||||
If you're using GitHub Pages, [you can follow the progress of the upgrade
|
||||
on the github/pages-gem repo](https://github.com/github/pages-gem/pull/285).
|
||||
|
||||
As always, our [history doc](/docs/history/#v3-0-5) has links to the pull
|
||||
requests and issues associated with the release for your perusal.
|
||||
|
||||
We're looking forward to the upcoming release of v3.2 which [has some
|
||||
excellent goodies](https://github.com/jekyll/jekyll/blob/master/History.markdown#head)
|
||||
we think you'll love.
|
||||
|
||||
Happy Jekylling!
|
||||
20
site/roadmap.md
Normal file
20
site/roadmap.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: page
|
||||
title: Roadmap
|
||||
---
|
||||
|
||||
This is a high-level roadmap for Jekyll. It is a list of things we're
|
||||
planning for each release. While plans are subject to change, this should
|
||||
offer a bit of an overview for anyone interested in future features.
|
||||
|
||||
If you'd like to discuss any of the items, visit the link next to each
|
||||
item and leave us a comment! We'd love to hear your thoughts.
|
||||
|
||||
- [v3.2](#v32)
|
||||
- [v3.3](#v33)
|
||||
|
||||
## v3.2
|
||||
|
||||
For v3.2, we're interested in shipping:
|
||||
|
||||
1. **Gem-based themes.** This will allow users to ship layouts, includes, and sass (to start with) in a way that is more easily consumable and versionable. ([discuss]({{ site.repository }}/issues/4510))
|
||||
@@ -1 +0,0 @@
|
||||
<span class="sample">include.html from test-theme</span>
|
||||
@@ -1 +0,0 @@
|
||||
default.html from test-theme: {{ content }}
|
||||
3
test/fixtures/test-theme/_sass/style.scss
vendored
3
test/fixtures/test-theme/_sass/style.scss
vendored
@@ -1,3 +0,0 @@
|
||||
.sample {
|
||||
color: black;
|
||||
}
|
||||
1
test/fixtures/test-theme/_symlink
vendored
1
test/fixtures/test-theme/_symlink
vendored
@@ -1 +0,0 @@
|
||||
_layouts
|
||||
9
test/fixtures/test-theme/test-theme.gemspec
vendored
9
test/fixtures/test-theme/test-theme.gemspec
vendored
@@ -1,9 +0,0 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'test-theme'
|
||||
s.version = '0.1.0'
|
||||
s.licenses = ['MIT']
|
||||
s.summary = "This is a theme used to test Jekyll"
|
||||
s.authors = ["Jekyll"]
|
||||
s.files = ["lib/example.rb"]
|
||||
s.homepage = 'https://github.com/jekyll/jekyll'
|
||||
end
|
||||
@@ -179,13 +179,13 @@ class TestCollections < JekyllUnitTest
|
||||
@collection = @site.collections["methods"]
|
||||
end
|
||||
|
||||
should "include the symlinked file as it resolves to inside site.source" do
|
||||
assert_includes @collection.filtered_entries, "um_hi.md"
|
||||
should "not allow symlinks" do
|
||||
refute_includes @collection.filtered_entries, "um_hi.md"
|
||||
refute_includes @collection.filtered_entries, "/um_hi.md"
|
||||
end
|
||||
|
||||
should "include the symlinked file in the list of docs as it resolves to inside site.source" do
|
||||
assert_includes @collection.docs.map(&:relative_path), "_methods/um_hi.md"
|
||||
should "not include the symlinked file in the list of docs" do
|
||||
refute_includes @collection.docs.map(&:relative_path), "_methods/um_hi.md"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class TestCommandsServe < JekyllUnitTest
|
||||
"ssl_key" => "bar"
|
||||
})
|
||||
|
||||
assert result[:SSLEnable]
|
||||
assert result[:EnableSSL]
|
||||
assert_equal result[:SSLPrivateKey ], "c2"
|
||||
assert_equal result[:SSLCertificate], "c1"
|
||||
end
|
||||
|
||||
@@ -122,7 +122,7 @@ class TestDocument < JekyllUnitTest
|
||||
@site = fixture_site({
|
||||
"collections" => ["slides"],
|
||||
"defaults" => [{
|
||||
"scope"=> {"path"=>"_slides", "type"=>"slides"},
|
||||
"scope"=> {"path"=>"slides", "type"=>"slides"},
|
||||
"values"=> {
|
||||
"nested"=> {
|
||||
"key"=>"value123",
|
||||
|
||||
@@ -14,17 +14,6 @@ class TestEntryFilter < JekyllUnitTest
|
||||
assert_equal %w[foo.markdown bar.markdown baz.markdown .htaccess], entries
|
||||
end
|
||||
|
||||
should "allow regexp filtering" do
|
||||
files = %w(README.md)
|
||||
@site.exclude = excludes = [
|
||||
/README/
|
||||
]
|
||||
|
||||
assert_empty @site.reader.filter_entries(
|
||||
files
|
||||
)
|
||||
end
|
||||
|
||||
should "filter entries with exclude" do
|
||||
excludes = %w[README TODO vendor/bundle]
|
||||
files = %w[index.html site.css .htaccess vendor]
|
||||
@@ -57,11 +46,11 @@ class TestEntryFilter < JekyllUnitTest
|
||||
assert_equal files, @site.reader.filter_entries(files)
|
||||
end
|
||||
|
||||
should "keep safe symlink entries when safe mode enabled" do
|
||||
should "filter symlink entries when safe mode enabled" do
|
||||
site = Site.new(site_configuration('safe' => true))
|
||||
allow(File).to receive(:symlink?).with('symlink.js').and_return(true)
|
||||
files = %w[symlink.js]
|
||||
assert_equal files, @site.reader.filter_entries(files)
|
||||
assert_equal [], site.reader.filter_entries(files)
|
||||
end
|
||||
|
||||
should "not filter symlink entries when safe mode disabled" do
|
||||
@@ -70,18 +59,12 @@ class TestEntryFilter < JekyllUnitTest
|
||||
assert_equal files, @site.reader.filter_entries(files)
|
||||
end
|
||||
|
||||
should "filter symlink pointing outside site source" do
|
||||
ent1 = %w[_includes/tmp]
|
||||
entries = EntryFilter.new(@site).filter(ent1)
|
||||
assert_equal %w[], entries
|
||||
end
|
||||
|
||||
should "include only safe symlinks in safe mode" do
|
||||
should "not include symlinks in safe mode" do
|
||||
site = Site.new(site_configuration('safe' => true))
|
||||
|
||||
site.reader.read_directories("symlink-test")
|
||||
assert_equal %w[main.scss symlinked-file].length, site.pages.length
|
||||
refute_equal [], site.static_files
|
||||
assert_equal [], site.pages
|
||||
assert_equal [], site.static_files
|
||||
end
|
||||
|
||||
should "include symlinks in unsafe mode" do
|
||||
|
||||
@@ -354,64 +354,6 @@ class TestFilters < JekyllUnitTest
|
||||
end
|
||||
end
|
||||
|
||||
context "where_exp filter" do
|
||||
should "return any input that is not an array" do
|
||||
assert_equal "some string", @filter.where_exp("some string", "la", "le")
|
||||
end
|
||||
|
||||
should "filter objects in a hash appropriately" do
|
||||
hash = {"a"=>{"color"=>"red"}, "b"=>{"color"=>"blue"}}
|
||||
assert_equal 1, @filter.where_exp(hash, "item", "item.color == 'red'").length
|
||||
assert_equal [{"color"=>"red"}], @filter.where_exp(hash, "item", "item.color == 'red'")
|
||||
end
|
||||
|
||||
should "filter objects appropriately" do
|
||||
assert_equal 2, @filter.where_exp(@array_of_objects, "item", "item.color == 'red'").length
|
||||
end
|
||||
|
||||
should "stringify during comparison for compatibility with liquid parsing" do
|
||||
hash = {
|
||||
"The Words" => {"rating" => 1.2, "featured" => false},
|
||||
"Limitless" => {"rating" => 9.2, "featured" => true},
|
||||
"Hustle" => {"rating" => 4.7, "featured" => true},
|
||||
}
|
||||
|
||||
results = @filter.where_exp(hash, "item", "item.featured == true")
|
||||
assert_equal 2, results.length
|
||||
assert_equal 9.2, results[0]["rating"]
|
||||
assert_equal 4.7, results[1]["rating"]
|
||||
|
||||
results = @filter.where_exp(hash, "item", "item.rating == 4.7")
|
||||
assert_equal 1, results.length
|
||||
assert_equal 4.7, results[0]["rating"]
|
||||
end
|
||||
|
||||
should "filter with other operators" do
|
||||
assert_equal [3, 4, 5], @filter.where_exp([ 1, 2, 3, 4, 5 ], "n", "n >= 3")
|
||||
end
|
||||
|
||||
objects = [
|
||||
{ "id" => "a", "groups" => [1, 2] },
|
||||
{ "id" => "b", "groups" => [2, 3] },
|
||||
{ "id" => "c" },
|
||||
{ "id" => "d", "groups" => [1, 3] }
|
||||
]
|
||||
should "filter with the contains operator over arrays" do
|
||||
results = @filter.where_exp(objects, "obj", "obj.groups contains 1")
|
||||
assert_equal 2, results.length
|
||||
assert_equal "a", results[0]["id"]
|
||||
assert_equal "d", results[1]["id"]
|
||||
end
|
||||
|
||||
should "filter with the contains operator over hash keys" do
|
||||
results = @filter.where_exp(objects, "obj", "obj contains 'groups'")
|
||||
assert_equal 3, results.length
|
||||
assert_equal "a", results[0]["id"]
|
||||
assert_equal "b", results[1]["id"]
|
||||
assert_equal "d", results[2]["id"]
|
||||
end
|
||||
end
|
||||
|
||||
context "sort filter" do
|
||||
should "raise Exception when input is nil" do
|
||||
err = assert_raises ArgumentError do
|
||||
|
||||
@@ -418,12 +418,12 @@ class TestSite < JekyllUnitTest
|
||||
assert_equal site.site_payload['site']['data']['products'], file_content
|
||||
end
|
||||
|
||||
should "load the symlink files in safe mode, as they resolve to inside site.source" do
|
||||
should "not load symlink files in safe mode" do
|
||||
site = Site.new(site_configuration('safe' => true))
|
||||
site.process
|
||||
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'products.yml'))
|
||||
assert_equal site.data['products'], file_content
|
||||
assert_equal site.site_payload['site']['data']['products'], file_content
|
||||
|
||||
assert_nil site.data['products']
|
||||
assert_nil site.site_payload['site']['data']['products']
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -616,7 +616,7 @@ title: Include symlink
|
||||
CONTENT
|
||||
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
|
||||
end
|
||||
assert_match "Could not locate the included file 'tmp/pages-test-does-not-exist' in any of [\"#{source_dir}/_includes\"].", ex.message
|
||||
assert_match(/should exist and should not be a symlink/, ex.message)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -757,7 +757,7 @@ CONTENT
|
||||
exception = assert_raises IOError do
|
||||
create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
||||
end
|
||||
assert_match "Could not locate the included file 'missing.html' in any of [\"#{source_dir}/_includes\"].", exception.message
|
||||
assert_equal 'Included file \'_includes/missing.html\' not found', exception.message
|
||||
end
|
||||
end
|
||||
|
||||
@@ -839,7 +839,7 @@ CONTENT
|
||||
exception = assert_raises IOError do
|
||||
create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
||||
end
|
||||
assert_match "Could not locate the included file 'missing.html' in any of [\"#{source_dir}\"].", exception.message
|
||||
assert_equal 'Included file \'./missing.html\' not found', exception.message
|
||||
end
|
||||
end
|
||||
|
||||
@@ -894,7 +894,7 @@ title: Include symlink
|
||||
CONTENT
|
||||
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
|
||||
end
|
||||
assert_match /Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source./, ex.message
|
||||
assert_match(/should exist and should not be a symlink/, ex.message)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
require 'helper'
|
||||
|
||||
class TestTheme < JekyllUnitTest
|
||||
def setup
|
||||
@theme = Theme.new('test-theme')
|
||||
@expected_root = File.expand_path "./fixtures/test-theme", File.dirname(__FILE__)
|
||||
end
|
||||
|
||||
context "initializing" do
|
||||
should "normalize the theme name" do
|
||||
theme = Theme.new(' Test-Theme ')
|
||||
assert_equal "test-theme", theme.name
|
||||
end
|
||||
|
||||
should "know the theme root" do
|
||||
assert_equal @expected_root, @theme.root
|
||||
end
|
||||
|
||||
should "know the theme version" do
|
||||
assert_equal Gem::Version.new("0.1.0"), @theme.version
|
||||
end
|
||||
|
||||
should "raise an error for invalid themes" do
|
||||
assert_raises Jekyll::Errors::MissingDependencyException do
|
||||
Theme.new("foo").version
|
||||
end
|
||||
end
|
||||
|
||||
should "add itself to sass's load path" do
|
||||
@theme.configure_sass
|
||||
assert Sass.load_paths.include?(@theme.sass_path), "Sass load paths should include the theme sass dir"
|
||||
end
|
||||
end
|
||||
|
||||
context "path generation" do
|
||||
[:layouts, :includes, :sass].each do |folder|
|
||||
should "know the #{folder} path" do
|
||||
expected = File.expand_path("_#{folder}", @expected_root)
|
||||
assert_equal expected, @theme.public_send("#{folder}_path")
|
||||
end
|
||||
end
|
||||
|
||||
should "generate folder paths" do
|
||||
expected = File.expand_path("./_sass", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :sass)
|
||||
end
|
||||
|
||||
should "not allow paths outside of the theme root" do
|
||||
assert_equal nil, @theme.send(:path_for, "../../source")
|
||||
end
|
||||
|
||||
should "return nil for paths that don't exist" do
|
||||
assert_equal nil, @theme.send(:path_for, "foo")
|
||||
end
|
||||
|
||||
should "return the resolved path when a symlink & resolved path exists" do
|
||||
expected = File.expand_path("./_layouts", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :symlink)
|
||||
end
|
||||
end
|
||||
|
||||
should "retrieve the gemspec" do
|
||||
assert_equal "test-theme-0.1.0", @theme.send(:gemspec).full_name
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user