Compare commits

..

26 Commits

Author SHA1 Message Date
Ashwin Maroli
647c5931bc Backport 3c06609 to 3.7-stable
Install platform-specific gems as required
2019-03-18 11:31:15 +05:30
Ashwin Maroli
e3144fd7d2 Backport c2dff2c to 3.7-stable
* Fix CI builds on older Ruby versions
* Remove deprecated Travis configuration
2019-03-13 23:10:54 +05:30
Parker Moore
c813cfbc0c Merge pull request #7423 from jekyll/3.7-stable-backport-7419
Backport #7419 for v3.7.x: Theme gems: ensure directories aren't symlinks
2019-03-13 10:18:43 -04:00
Ashwin Maroli
e478a331ba Merge branch '3.7-stable' into 3.7-stable-backport-7419 2018-12-18 22:52:34 +05:30
Ashwin Maroli
68945e96db Backport c368fec to 3.7-stable
Create symlink only if target is accessible (#7429)
2018-12-18 22:46:02 +05:30
Parker Moore
22bbe6dd2d Skip theme dir symlink test if Windows. 2018-12-17 16:35:52 -05:00
Ashwin Maroli
f6c834f7f0 Merge branch '3.7-stable' into this branch 2018-12-15 00:13:56 +05:30
Ashwin Maroli
888fb4c8d2 Backport e41c427 to 3.7-stable
CI: Build stable branches during backport
2018-12-15 00:07:07 +05:30
olivia hugger
9c66c3cbcc Backport 564f773 to 3.7-stable
test for stable and backport branches on travis
2018-12-14 23:31:42 +05:30
Frank Taillandier
a054e4ae80 Backport #6784 to 3.7.x : Fix theme gem feature 2018-12-14 23:29:07 +05:30
Parker Moore
9db91abc9b Fix linting issue with lines being too long. 2018-12-14 10:31:45 -05:00
Parker Moore
220f1bdc16 Backport ensure-realpath-for-theme-dirs-is-in-theme-dir from #7419 to 3.7-stable 2018-12-14 10:12:14 -05:00
Parker Moore
07561b301b Release 💎 3.7.4 2018-09-07 13:36:55 -04:00
Parker Moore
bd70949ecf Release 💎 v3.7.4 2018-09-07 13:36:34 -04:00
Parker Moore
4108ddb05c Merge pull request #7224 from jekyll/3.7-entryfilter-symlink-fix
3.7.x: EntryFilter#filter symlink fix
2018-09-07 13:28:17 -04:00
Parker Moore
2025d12502 Revert "Run this branch."
This reverts commit f5cd15cfd4.
2018-09-07 13:28:00 -04:00
Parker Moore
7f1faea47d LayoutReader: skip tests if Windows 2018-09-07 13:23:22 -04:00
Parker Moore
f5cd15cfd4 Run this branch. 2018-09-07 12:36:22 -04:00
Parker Moore
35219a8c42 Fix fmt errors. 2018-09-07 12:35:30 -04:00
Parker Moore
2c088e2596 Update tests for EntryFilter#filter fix and add comments for it 2018-09-07 12:29:04 -04:00
Parker Moore
a8b91de97b EntryFilter#filter: reject all symlinks, even if included
Previously, you could include the name of a symlinked file
and Jekyll would not filter it. This is considered a bypass
of the symlink checking, and thus a security bug.
2018-09-06 13:11:41 -04:00
Parker Moore
2a679e797c Add failing tests for symlink check. 2018-09-06 12:30:59 -04:00
olivia
6298d06f40 Release 💎 3.7.3 2018-02-25 17:41:51 +01:00
olivia
7b88125445 Prepare for 3.7.3 release 2018-02-25 17:41:23 +01:00
olivia
f9f6b2fcfa Update history to reflect backport of #6791 2018-02-25 12:26:53 +01:00
olivia
31130f724d Backport #6791 from master to 3.7-stable 2018-02-25 12:24:03 +01:00
122 changed files with 665 additions and 2560 deletions

View File

@@ -3,7 +3,7 @@ engines:
enabled: false
rubocop:
enabled: true
channel: rubocop-0-54
channel: rubocop-0-49
exclude_paths:
- .codeclimate.yml
@@ -29,8 +29,6 @@ exclude_paths:
- test/**/*
- vendor/**/*
- lib/jekyll/commands/serve/livereload_assets/livereload.js
ratings:
paths:
- lib/**/*.rb

View File

@@ -48,7 +48,7 @@
## My Reproduction Steps
<!--
If this error occurred on GitHub Pages, please try to provide us with logs,
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.)

View File

@@ -12,7 +12,7 @@ Nothing. This issue is meant to welcome you to Open Source :) We are happy to wa
- [ ] 👌 **Join the team**: Add yourself to a Jekyll affinity team.
Go to [teams.jekyllrb.com](https://teams.jekyllrb.com/) and join a team that best fits your interests. Once you click the link to join a team, you will soon receive an email inviting you to join the Jekyll organization.
Go to [teams.jekyllrb.com](https://teams.jekyllrb.com/) and join a team that best fits your interests. Once you click the link to join a team, you will soon recieve an email inviting you to join the Jekyll organization.
- [ ] 🙋 **Claim this issue**: Comment below.

View File

@@ -46,12 +46,9 @@ Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Lint/NestedPercentLiteral:
Exclude:
- test/test_site.rb
Layout/EmptyComment:
Layout/SpaceInsideBrackets:
Enabled: false
Layout/EndAlignment:
Lint/EndAlignment:
Severity: error
Lint/UnreachableCode:
Severity: error
@@ -97,14 +94,6 @@ Naming/FileName:
Enabled: false
Naming/HeredocDelimiterNaming:
Enabled: false
Naming/MemoizedInstanceVariableName:
Exclude:
- lib/jekyll/page_without_a_file.rb
- lib/jekyll/drops/unified_payload_drop.rb
- lib/jekyll/drops/site_drop.rb
Naming/UncommunicativeMethodParamName:
AllowedNames:
- _
Security/MarshalLoad:
Exclude:
- !ruby/regexp /test\/.*.rb$/
@@ -129,9 +118,6 @@ Style/Documentation:
- !ruby/regexp /features\/.*.rb$/
Style/DoubleNegation:
Enabled: false
Style/FormatStringToken:
Exclude:
- lib/jekyll/utils/ansi.rb
Style/GuardClause:
Enabled: false
Style/HashSyntax:
@@ -141,9 +127,6 @@ Style/IfUnlessModifier:
Enabled: false
Style/InverseMethods:
Enabled: false
Style/MixinUsage:
Exclude:
- test/helper.rb
Style/ModuleFunction:
Enabled: false
Style/MultilineTernaryOperator:
@@ -175,7 +158,5 @@ Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/SymbolArray:
Enabled: false
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma

View File

@@ -2,14 +2,13 @@ bundler_args: --without benchmark:site:development
script: script/cibuild
cache: bundler
language: ruby
sudo: false
rvm:
- &ruby1 2.5.1
- &ruby2 2.4.4
- &ruby3 2.3.7
- &ruby4 2.2.10
- &jruby jruby-9.1.16.0
- &ruby1 2.5.0
- &ruby2 2.4.3
- &ruby3 2.3.6
- &ruby4 2.2.9
- &jruby jruby-9.1.15.0
matrix:
include:
@@ -31,7 +30,7 @@ branches:
only:
- master
- themes
- /*-stable/
- /.*-stable/
notifications:
slack:
@@ -54,5 +53,4 @@ after_success:
- bundle exec codeclimate-test-reporter
before_install:
- gem update --system
- gem install bundler
- gem update --system || true

View File

@@ -27,15 +27,16 @@ group :test do
gem "httpclient"
gem "jekyll_test_plugin"
gem "jekyll_test_plugin_malicious"
# nokogiri v1.8 does not work with ruby 2.1 and below
gem "nokogiri", RUBY_VERSION >= "2.2" ? "~> 1.7" : "~> 1.7.0"
# nokogiri v1.10 does not work with ruby 2.2 and below
gem "nokogiri", RUBY_VERSION >= "2.3" ? "~> 1.9" : "~> 1.9.0"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 0.56.0"
gem "rubocop", "~> 0.51.0"
gem "test-dependency-theme", :path => File.expand_path("test/fixtures/test-dependency-theme", __dir__)
gem "test-theme", :path => File.expand_path("test/fixtures/test-theme", __dir__)
gem "test-theme-symlink", :path => File.expand_path("test/fixtures/test-theme-symlink", __dir__)
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
gem "jruby-openssl", "0.10.1" if RUBY_ENGINE == "jruby"
end
#

View File

@@ -1,130 +1,12 @@
## 3.8.4 / 2018-09-18
## 3.7.4 / 2018-09-07
### Bug Fixes
* security: fix `include` bypass of `EntryFilter#filter` symlink check (#7228)
## 3.8.3 / 2018-06-05
### Bug Fixes
* Fix --unpublished not affecting collection documents (#7027)
## 3.8.2 / 2018-05-18
### Development Fixes
* Update rubocop version (#7016)
### Bug Fixes
* Add whitespace control to LIQUID_TAG_REGEX (#7015)
## 3.8.1 / 2018-05-01
### Bug Fixes
* Fix rendering Liquid constructs in excerpts (#6945)
* Liquify documents unless published == false (#6959)
## 3.8.0 / 2018-04-19
### Development Fixes
* move duplicate code to a single private method (#6593)
* Test against Ruby 2.5 on AppVeyor (#6668)
* Replace simple regex with a native Ruby method (#6732)
* Codeclimate: exclude livereload.js (#6776)
* Add a cucumber feature to test link tag (#6777)
* Fix theme gem feature (#6784)
* Replace simple regex with equivalent Ruby methods (#6736)
* Rewrite `script/rubyprof` as a Ruby script (#6813)
* Add debug output to theme rendering (#5195)
* fix minitest deprecation warning in test (#6839)
* Memoize `Site#site_data` (#6809)
* Memoize document output extension (#6814)
* Access document permalink attribute efficiently (#6740)
* Minimize array allocations in the `where` filter (#6860)
* Bump JRuby (#6878)
* Assert existence of &lt;collection&gt;.files (#6907)
* Bump Rubocop to 0.54.x (#6915)
* Regenerate unconditionally unless its an incremental build (#6917)
* Centralize require statements (#6910)
* Bump to Rubocop 0.55 (#6929)
* Refactor private method `HighlightBlock#parse_options` (#6822)
### Minor Enhancements
* Two massive performance improvements for large sites (#6730)
* Cache the list of documents to be written (#6741)
* Allow Jekyll Doctor to detect stray posts dir (#6681)
* Excerpt relative-path should match its path (#6597)
* Remind user to resolve conflict in `jekyll new` with `--force` (#6801)
* Memoize helper methods in site-cleaner (#6808)
* Compute document&#39;s relative_path faster (#6767)
* Create a single instance of PostReader per site (#6759)
* Allow date filters to output ordinal days (#6773)
* Change regex to sanitize and normalize filenames passed to LiquidRenderer (#6610)
* Allow passing :strict_variables and :strict_filters options to Liquid&#39;s renderer (#6726)
* Debug writing files during the build process (#6696)
* Improve regex usage in `Tags::IncludeTag` (#6848)
* Improve comment included in the starter index.md (#6916)
* Store and retrieve converter instances for Jekyll::Filters via a hash (#6856)
* Implement a cache within the `where` filter (#6868)
* Store regexp in a constant (#6887)
* Optimize computing filename in LiquidRenderer (#6841)
### Documentation
* Adding the jekyll-algolia plugin to the list of plugins (#6737)
* Added Premonition plugin to list of plugins (#6750)
* Add document on releasing a new version (#6745)
* Mention Talkyard, a new commenting system for Jekyll and others. (#6752)
* Add &#39;jekyll-fontello&#39; to plugins (#6757)
* Install dh-autoreconf on Windows (#6765)
* Fix common typos (#6764)
* Fix documentation for `{{ page.excerpt }}` (#6779)
* Update docs on permalink configuration (#6775)
* Propose fix some typos (#6785)
* Say hello to Jekyll&#39;s New Lead Developer (#6790)
* Add reference to Liquid to plugin docs (#6794)
* Draft a release post for v3.7.3 (#6803)
* add missing step for gem-based theme conversion (#6802)
* Update windows.md to explain an issue with jekyll new. (#6838)
* Add Bundler Installation Instructions (#6828)
* Docs: describe difference between tags and categories (#6882)
* Add `jekyll-random` plugin to docs (#6833)
* Fixed typo in description of categories and tags (#6896)
* Add missing ul-tag (#6897)
* doc: add liquid tag plugin jekyll-onebox for html previews (#6898)
* Add `jekyll-w2m` to plugins (#6855)
* Fix tutorials navigation HTML (#6919)
* add Arch Linux instalation troubleshoot (#6782)
* Docs: Install Jekyll on macOS (#6881)
* Fix CodeClimate badges [ci skip] (#6930)
* Update index.md (#6933)
### Site Enhancements
* Remove links to Gists (#6751)
* Always load Google Fonts over HTTPS (#6792)
* always load analytics.js over HTTPS (#6807)
### Bug Fixes
* Append appropriate closing tag to Liquid block in an excerpt ### -minor (#6724)
* Bypass rendering via Liquid unless required (#6735)
* Delegated methods after `private` keyword are meant to be private (#6819)
* Improve handling non-default collection documents rendering and writing (#6795)
* Fix passing multiline params to include tag when using the variable syntax (#6858)
* `include_relative` tag should find related documents in collections gathered within custom `collections_dir` (#6818)
* Handle liquid tags in excerpts robustly (#6891)
* Allow front matter defaults to be applied properly to documents gathered under custom `collections_dir` (#6885)
* Security: fix `include` bypass of EntryFilter#filter symlink check
## 3.7.3 / 2018-02-25
### Bug Fixes
* Do not hardcode locale unless certainly necessary (#6791)
## 3.7.2 / 2018-01-25
@@ -157,7 +39,7 @@
* inform that symlinks are not allowed in safe mode (#6670)
* Glob scope path only if configured with a pattern (#6692)
* Add gem &#34;wdm&#34; to all newly generated Gemfiles (#6711)
* Fix timezone inconsistencies between different ruby version (#6697)
* Fix timezone incosistencies between different ruby version (#6697)
* Refactor collections_dir feature for consistency (#6685)
### Minor Enhancements
@@ -258,7 +140,7 @@
* Add jekyll-pwa-plugin (#6533)
* Remove Jekyll-Smartify from plugins directory (#6548)
* Updated Jekyll-Pug listing to include official website (#6555)
* Remove link to severely outdated asset plugin (#6613)
* Remove link to severly outdated asset plugin (#6613)
* Default time zone depends upon server (#6617)
* Add `disqus-for-jekyll` to plugins. (#6618)
* Update &#34;Requirements&#34; for Ruby version (#6623)
@@ -835,9 +717,9 @@
* Update appveyor.yml and fix optional deps for Ruby x64 (#5180)
* Improve tests for Jekyll::PluginManager (#5167)
* Update Ruby versions in travis.yml (#5221)
* Avoid installing unnecessary gems for site testing (#5272)
* Avoid installing unecessary gems for site testing (#5272)
* Proposal: Affinity teams and their captains (#5273)
* Replace duplicate with positive local test in issue template (#5286)
* Replace duplicate with postive local test in issue template (#5286)
* Update AppVeyor config. (#5240)
* Execute jekyll from clone instead of defined binary when running 'script/default-site' (#5295)
* rubocop: lib/jekyll/document.rb complexity fixes (#5045)
@@ -881,7 +763,7 @@
* Allow collections to have documents that have no file extension (#4545)
* Add size property to `group_by` result (#4557)
* Site Template: Removed unnecessary nesting from `_base.scss` (#4637)
* Adding a debug log statement for skipped future documents. (#4558)
* Adding a debug log statment for skipped future documents. (#4558)
* Site Template: Changed main `<div>` to `<main>` and added accessibility info (#4636)
* Add array support to `where` filter (#4555)
* 'jekyll clean': also remove .sass-cache (#4652)
@@ -1190,7 +1072,7 @@
* utils/drops: update Drop to support `Utils.deep_merge_hashes` (#4289)
* Make sure jekyll/drops/drop is loaded first. (#4292)
* Convertible/Page/Renderer: use payload hash accessor & setter syntax for backwards-compatibility (#4311)
* Drop: fix hash setter precedence (#4312)
* Drop: fix hash setter precendence (#4312)
* utils: `has_yaml_header?` should accept files with extraneous spaces (#4290)
* Escape html from site.title and page.title in site template (#4307)
* Allow custom file extensions if defined in `permalink` YAML front matter (#4314)

View File

@@ -3,8 +3,8 @@
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)][ruby-gems]
[![Linux Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg?label=Linux%20build)][travis]
[![Windows Build status](https://img.shields.io/appveyor/ci/jekyll/jekyll/master.svg?label=Windows%20build)][appveyor]
[![Maintainability](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/maintainability)](codeclimate)
[![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)](coverage)
[![Test Coverage](https://img.shields.io/codeclimate/coverage/github/jekyll/jekyll.svg)][coverage]
[![Code Climate](https://img.shields.io/codeclimate/github/jekyll/jekyll.svg)][codeclimate]
[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)][gemnasium]
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]

View File

@@ -6,6 +6,7 @@ branches:
only:
- master
- themes
- /.*-stable/
build: off
@@ -16,15 +17,13 @@ install:
environment:
BUNDLE_WITHOUT: "benchmark:site:development"
matrix:
- RUBY_FOLDER_VER: "25"
TEST_SUITE: "test"
- RUBY_FOLDER_VER: "25"
TEST_SUITE: "cucumber"
- RUBY_FOLDER_VER: "25"
TEST_SUITE: "default-site"
- RUBY_FOLDER_VER: "25-x64"
- RUBY_FOLDER_VER: "24"
TEST_SUITE: "test"
- RUBY_FOLDER_VER: "24"
TEST_SUITE: "cucumber"
- RUBY_FOLDER_VER: "24"
TEST_SUITE: "default-site"
- RUBY_FOLDER_VER: "24-x64"
TEST_SUITE: "test"
- RUBY_FOLDER_VER: "23"
TEST_SUITE: "test"

View File

@@ -1,101 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "liquid"
require "benchmark/ips"
# Test if processing content string without any Liquid constructs, via Liquid,
# is slower than checking whether constructs exist ( using `String#include?` )
# and return-ing the "plaintext" content string as is..
#
# Ref: https://github.com/jekyll/jekyll/pull/6735
# Sample contents
WITHOUT_LIQUID = <<-TEXT.freeze
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor libero at
pharetra tempus. Etiam bibendum magna et metus fermentum, eu cursus lorem
mattis. Curabitur vel dui et lacus rutrum suscipit et eget neque.
Nullam luctus fermentum est id blandit. Phasellus consectetur ullamcorper
ligula, at finibus eros laoreet id. Etiam sit amet est in libero efficitur
tristique. Ut nec magna augue. Quisque ut fringilla lacus, ac dictum enim.
Aliquam vel ornare mauris. Suspendisse ornare diam tempor nulla facilisis
aliquet. Sed ultrices placerat ultricies.
TEXT
WITH_LIQUID = <<-LIQUID.freeze
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor libero at
pharetra tempus. {{ author }} et metus fermentum, eu cursus lorem
mattis. Curabitur vel dui et lacus rutrum suscipit et eget neque.
Nullam luctus fermentum est id blandit. Phasellus consectetur ullamcorper
ligula, {% if author == "Jane Doe" %} at finibus eros laoreet id. {% else %}
Etiam sit amet est in libero efficitur.{% endif %}
tristique. Ut nec magna augue. Quisque ut fringilla lacus, ac dictum enim.
Aliquam vel ornare mauris. Suspendisse ornare diam tempor nulla facilisis
aliquet. Sed ultrices placerat ultricies.
LIQUID
WITH_JUST_LIQUID_VAR = <<-LIQUID.freeze
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor libero at
pharetra tempus. et metus fermentum, eu cursus lorem, ac dictum enim.
mattis. Curabitur vel dui et lacus rutrum suscipit et {{ title }} neque.
Nullam luctus fermentum est id blandit. Phasellus consectetur ullamcorper
ligula, at finibus eros laoreet id. Etiam sit amet est in libero efficitur.
tristique. Ut nec magna augue. {{ author }} Quisque ut fringilla lacus
Aliquam vel ornare mauris. Suspendisse ornare diam tempor nulla facilisis
aliquet. Sed ultrices placerat ultricies.
LIQUID
SUITE = {
:"plain text" => WITHOUT_LIQUID,
:"tags n vars" => WITH_LIQUID,
:"just vars" => WITH_JUST_LIQUID_VAR,
}.freeze
# Mimic how Jekyll's LiquidRenderer would process a non-static file, with
# some dummy payload
def always_liquid(content)
Liquid::Template.error_mode = :warn
Liquid::Template.parse(content, :line_numbers => true).render(
"author" => "John Doe",
"title" => "FooBar"
)
end
# Mimic how the proposed change would first execute a couple of checks and
# proceed to process with Liquid if necessary
def conditional_liquid(content)
return content if content.nil? || content.empty?
return content unless content.include?("{%") || content.include?("{{")
always_liquid(content)
end
# Test https://github.com/jekyll/jekyll/pull/6735#discussion_r165499868
# ------------------------------------------------------------------------
def check_with_regex(content)
!content.to_s.match?(%r!{[{%]!)
end
def check_with_builtin(content)
content.include?("{%") || content.include?("{{")
end
SUITE.each do |key, text|
Benchmark.ips do |x|
x.report("regex-check - #{key}") { check_with_regex(text) }
x.report("builtin-check - #{key}") { check_with_builtin(text) }
x.compare!
end
end
# ------------------------------------------------------------------------
# Let's roll!
SUITE.each do |key, text|
Benchmark.ips do |x|
x.report("always thru liquid - #{key}") { always_liquid(text) }
x.report("conditional liquid - #{key}") { conditional_liquid(text) }
x.compare!
end
end

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'benchmark/ips'
require 'jekyll'
require 'json'
DATA = {"foo"=>"bar", "alpha"=>{"beta"=>"gamma"}, "lipsum"=>["lorem", "ipsum", "dolor"]}
def local_require
require 'json'
JSON.pretty_generate(DATA)
end
def global_require
JSON.pretty_generate(DATA)
end
def graceful_require
Jekyll::External.require_with_graceful_fail("json")
JSON.pretty_generate(DATA)
end
Benchmark.ips do |x|
x.report("local-require") { local_require }
x.report("global-require") { global_require }
x.report("graceful-require") { graceful_require }
x.compare!
end

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env ruby
# -------------------------------------------------------------------
# Benchmarking changes in https://github.com/jekyll/jekyll/pull/6767
# -------------------------------------------------------------------
require 'benchmark/ips'
require 'pathutil'
DOC_PATH = File.join(File.expand_path(__dir__), "_puppies", "rover.md")
COL_PATH = File.join(File.expand_path(__dir__), "_puppies")
def pathutil_relative
Pathutil.new(DOC_PATH).relative_path_from(COL_PATH).to_s
end
def native_relative
DOC_PATH.sub("#{COL_PATH}/", "")
end
if pathutil_relative == native_relative
Benchmark.ips do |x|
x.report("pathutil") { pathutil_relative }
x.report("native") { native_relative }
x.compare!
end
else
print "PATHUTIL: "
puts pathutil_relative
print "NATIVE: "
puts native_relative
end

View File

@@ -1,26 +0,0 @@
#!/usr/bin/env ruby
require "benchmark/ips"
PATH = "/../../..../...//.....//lorem/ipsum//dolor///sit.xyz"
def sanitize_with_regex
"/" + PATH.gsub(%r!/{2,}!, "/").gsub(%r!\.+/|\A/+!, "")
end
def sanitize_with_builtin
"/#{PATH}".gsub("..", "/").gsub("./", "").squeeze("/")
end
if sanitize_with_regex == sanitize_with_builtin
Benchmark.ips do |x|
x.report("sanitize w/ regexes") { sanitize_with_regex }
x.report("sanitize w/ builtin") { sanitize_with_builtin }
x.compare!
end
else
puts "w/ regexes: #{sanitize_with_regex}"
puts "w/ builtin: #{sanitize_with_builtin}"
puts ""
puts "Thank you. Do try again :("
end

View File

@@ -1,5 +1,5 @@
---
version: 3.8.4
version: 3.7.2
name: Jekyll • Simple, blog-aware, static sites
description: Transform your plain text into static websites and blogs
url: https://jekyllrb.com
@@ -8,6 +8,7 @@ timezone: America/Los_Angeles
twitter:
username: jekyllrb
logo: "/img/logo-2x.png"
gauges_id: 503c5af6613f5d0f19000027
google_analytics_id: UA-50755011-1
google_site_verification: onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY
collections:

View File

@@ -6,7 +6,6 @@
- orderofinterpretation
- custom-404-page
- convert-site-to-jekyll
- using-jekyll-with-bundler
#- title: Another section
# tutorials:

View File

@@ -53,7 +53,7 @@ sass:
The Sass converter will default the `sass_dir` configuration option to
`_sass`.
[example-sass]: https://github.com/jekyll/jekyll-sass-converter/tree/master/docs
[example-sass]: https://github.com/jekyll/jekyll-sass-converter/tree/master/example
<div class="note info">
<h5>The <code>sass_dir</code> is only used by Sass</h5>

View File

@@ -348,20 +348,6 @@ you specified in your `_config.yml` (if present) and the following information:
<code>{% raw %}{{ site.collections | where: "label", "myCollection" | first }}{% endraw %}</code></p>
</div>
<div class="note info">
<h5>Collections and Time</h5>
<p>Except for documents in hard-coded default collection <code>posts</code>, all documents in collections
you create, are accessible via Liquid irrespective of their assigned date, if any, and therefore renderable.
</p>
<p>However documents are attempted to be written to disk only if the concerned collection
metadata has <code>output: true</code>. Additionally, future-dated documents are only written if
<code>site.future</code> <em>is also true</em>.
</p>
<p>More fine-grained control over documents being written to disk can be exercised by setting
<code>published: false</code> (<em><code>true</code> by default</em>) in the document's front matter.
</p>
</div>
### Documents

View File

@@ -642,12 +642,12 @@ collections:
output: true
# Handling Reading
safe: false
include: [".htaccess"]
exclude: ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
keep_files: [".git", ".svn"]
encoding: "utf-8"
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
safe: false
include: [".htaccess"]
exclude: ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
keep_files: [".git", ".svn"]
encoding: "utf-8"
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
strict_front_matter: false
# Filtering Content
@@ -684,9 +684,7 @@ verbose: false
defaults: []
liquid:
error_mode: warn
strict_filters: false
strict_variables: false
error_mode: warn
# Markdown Processors
rdiscount:
@@ -696,14 +694,14 @@ redcarpet:
extensions: []
kramdown:
auto_ids: true
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
input: GFM
hard_wrap: false
footnote_nr: 1
show_warnings: false
auto_ids: true
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
input: GFM
hard_wrap: false
footnote_nr: 1
show_warnings: false
```
## Liquid Options
@@ -715,14 +713,6 @@ options are
- `warn` --- Output a warning on the console for each error.
- `strict` --- Output an error message and stop the build.
You can also configure Liquid's renderer to catch non-assigned variables and
non-existing filters by setting `strict_variables` and / or `strict_filters`
to `true` respectively. {% include docs_version_badge.html version="3.8.0" %}
Do note that while `error_mode` configures Liquid's parser, the `strict_variables`
and `strict_filters` options configure Liquid's renderer and are consequently,
mutually exclusive.
## Markdown Options
The various Markdown renderers supported by Jekyll sometimes have extra options

View File

@@ -4,157 +4,6 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 3.8.4 / 2018-09-18
{: #v3-8-4}
### Bug Fixes
{: #bug-fixes-v3-8-4}
- security: fix `include` bypass of `EntryFilter#filter` symlink check ([#7228]({{ site.repository }}/issues/7228))
## 3.8.3 / 2018-06-05
{: #v3-8-3}
### Bug Fixes
{: #bug-fixes-v3-8-3}
- Fix --unpublished not affecting collection documents ([#7027]({{ site.repository }}/issues/7027))
## 3.8.2 / 2018-05-18
{: #v3-8-2}
### Development Fixes
{: #development-fixes-v3-8-2}
- Update rubocop version ([#7016]({{ site.repository }}/issues/7016))
### Bug Fixes
{: #bug-fixes-v3-8-2}
- Add whitespace control to LIQUID_TAG_REGEX ([#7015]({{ site.repository }}/issues/7015))
## 3.8.1 / 2018-05-01
{: #v3-8-1}
### Bug Fixes
{: #bug-fixes-v3-8-1}
- Fix rendering Liquid constructs in excerpts ([#6945]({{ site.repository }}/issues/6945))
- Liquify documents unless published == false ([#6959]({{ site.repository }}/issues/6959))
## 3.8.0 / 2018-04-19
{: #v3-8-0}
### Development Fixes
{: #development-fixes-v3-8-0}
- move duplicate code to a single private method ([#6593]({{ site.repository }}/issues/6593))
- Test against Ruby 2.5 on AppVeyor ([#6668]({{ site.repository }}/issues/6668))
- Replace simple regex with a native Ruby method ([#6732]({{ site.repository }}/issues/6732))
- Codeclimate: exclude livereload.js ([#6776]({{ site.repository }}/issues/6776))
- Add a cucumber feature to test link tag ([#6777]({{ site.repository }}/issues/6777))
- Fix theme gem feature ([#6784]({{ site.repository }}/issues/6784))
- Replace simple regex with equivalent Ruby methods ([#6736]({{ site.repository }}/issues/6736))
- Rewrite `script/rubyprof` as a Ruby script ([#6813]({{ site.repository }}/issues/6813))
- Add debug output to theme rendering ([#5195]({{ site.repository }}/issues/5195))
- fix minitest deprecation warning in test ([#6839]({{ site.repository }}/issues/6839))
- Memoize `Site#site_data` ([#6809]({{ site.repository }}/issues/6809))
- Memoize document output extension ([#6814]({{ site.repository }}/issues/6814))
- Access document permalink attribute efficiently ([#6740]({{ site.repository }}/issues/6740))
- Minimize array allocations in the `where` filter ([#6860]({{ site.repository }}/issues/6860))
- Bump JRuby ([#6878]({{ site.repository }}/issues/6878))
- Assert existence of &lt;collection&gt;.files ([#6907]({{ site.repository }}/issues/6907))
- Bump Rubocop to 0.54.x ([#6915]({{ site.repository }}/issues/6915))
- Regenerate unconditionally unless its an incremental build ([#6917]({{ site.repository }}/issues/6917))
- Centralize require statements ([#6910]({{ site.repository }}/issues/6910))
- Bump to Rubocop 0.55 ([#6929]({{ site.repository }}/issues/6929))
- Refactor private method `HighlightBlock#parse_options` ([#6822]({{ site.repository }}/issues/6822))
### Minor Enhancements
{: #minor-enhancements-v3-8-0}
- Two massive performance improvements for large sites ([#6730]({{ site.repository }}/issues/6730))
- Cache the list of documents to be written ([#6741]({{ site.repository }}/issues/6741))
- Allow Jekyll Doctor to detect stray posts dir ([#6681]({{ site.repository }}/issues/6681))
- Excerpt relative-path should match its path ([#6597]({{ site.repository }}/issues/6597))
- Remind user to resolve conflict in `jekyll new` with `--force` ([#6801]({{ site.repository }}/issues/6801))
- Memoize helper methods in site-cleaner ([#6808]({{ site.repository }}/issues/6808))
- Compute document&#39;s relative_path faster ([#6767]({{ site.repository }}/issues/6767))
- Create a single instance of PostReader per site ([#6759]({{ site.repository }}/issues/6759))
- Allow date filters to output ordinal days ([#6773]({{ site.repository }}/issues/6773))
- Change regex to sanitize and normalize filenames passed to LiquidRenderer ([#6610]({{ site.repository }}/issues/6610))
- Allow passing :strict_variables and :strict_filters options to Liquid&#39;s renderer ([#6726]({{ site.repository }}/issues/6726))
- Debug writing files during the build process ([#6696]({{ site.repository }}/issues/6696))
- Improve regex usage in `Tags::IncludeTag` ([#6848]({{ site.repository }}/issues/6848))
- Improve comment included in the starter index.md ([#6916]({{ site.repository }}/issues/6916))
- Store and retrieve converter instances for Jekyll::Filters via a hash ([#6856]({{ site.repository }}/issues/6856))
- Implement a cache within the `where` filter ([#6868]({{ site.repository }}/issues/6868))
- Store regexp in a constant ([#6887]({{ site.repository }}/issues/6887))
- Optimize computing filename in LiquidRenderer ([#6841]({{ site.repository }}/issues/6841))
### Documentation
- Adding the jekyll-algolia plugin to the list of plugins ([#6737]({{ site.repository }}/issues/6737))
- Added Premonition plugin to list of plugins ([#6750]({{ site.repository }}/issues/6750))
- Add document on releasing a new version ([#6745]({{ site.repository }}/issues/6745))
- Mention Talkyard, a new commenting system for Jekyll and others. ([#6752]({{ site.repository }}/issues/6752))
- Add &#39;jekyll-fontello&#39; to plugins ([#6757]({{ site.repository }}/issues/6757))
- Install dh-autoreconf on Windows ([#6765]({{ site.repository }}/issues/6765))
- Fix common typos ([#6764]({{ site.repository }}/issues/6764))
- Fix documentation for {% raw %}`{{ page.excerpt }}`{% endraw %} ([#6779]({{ site.repository }}/issues/6779))
- Update docs on permalink configuration ([#6775]({{ site.repository }}/issues/6775))
- Propose fix some typos ([#6785]({{ site.repository }}/issues/6785))
- Say hello to Jekyll&#39;s New Lead Developer ([#6790]({{ site.repository }}/issues/6790))
- Add reference to Liquid to plugin docs ([#6794]({{ site.repository }}/issues/6794))
- Draft a release post for v3.7.3 ([#6803]({{ site.repository }}/issues/6803))
- add missing step for gem-based theme conversion ([#6802]({{ site.repository }}/issues/6802))
- Update windows.md to explain an issue with jekyll new. ([#6838]({{ site.repository }}/issues/6838))
- Add Bundler Installation Instructions ([#6828]({{ site.repository }}/issues/6828))
- Docs: describe difference between tags and categories ([#6882]({{ site.repository }}/issues/6882))
- Add `jekyll-random` plugin to docs ([#6833]({{ site.repository }}/issues/6833))
- Fixed typo in description of categories and tags ([#6896]({{ site.repository }}/issues/6896))
- Add missing ul-tag ([#6897]({{ site.repository }}/issues/6897))
- doc: add liquid tag plugin jekyll-onebox for html previews ([#6898]({{ site.repository }}/issues/6898))
- Add `jekyll-w2m` to plugins ([#6855]({{ site.repository }}/issues/6855))
- Fix tutorials navigation HTML ([#6919]({{ site.repository }}/issues/6919))
- add Arch Linux instalation troubleshoot ([#6782]({{ site.repository }}/issues/6782))
- Docs: Install Jekyll on macOS ([#6881]({{ site.repository }}/issues/6881))
- Fix CodeClimate badges [ci skip] ([#6930]({{ site.repository }}/issues/6930))
- Update index.md ([#6933]({{ site.repository }}/issues/6933))
### Site Enhancements
{: #site-enhancements-v3-8-0}
- Remove links to Gists ([#6751]({{ site.repository }}/issues/6751))
- Always load Google Fonts over HTTPS ([#6792]({{ site.repository }}/issues/6792))
- always load analytics.js over HTTPS ([#6807]({{ site.repository }}/issues/6807))
### Bug Fixes
{: #bug-fixes-v3-8-0}
- Append appropriate closing tag to Liquid block in an excerpt ### -minor ([#6724]({{ site.repository }}/issues/6724))
- Bypass rendering via Liquid unless required ([#6735]({{ site.repository }}/issues/6735))
- Delegated methods after `private` keyword are meant to be private ([#6819]({{ site.repository }}/issues/6819))
- Improve handling non-default collection documents rendering and writing ([#6795]({{ site.repository }}/issues/6795))
- Fix passing multiline params to include tag when using the variable syntax ([#6858]({{ site.repository }}/issues/6858))
- `include_relative` tag should find related documents in collections gathered within custom `collections_dir` ([#6818]({{ site.repository }}/issues/6818))
- Handle liquid tags in excerpts robustly ([#6891]({{ site.repository }}/issues/6891))
- Allow front matter defaults to be applied properly to documents gathered under custom `collections_dir` ([#6885]({{ site.repository }}/issues/6885))
## 3.7.3 / 2018-02-25
{: #v3-7-3}
### Bug Fixes
{: #bug-fixes-v3-7-3}
- Do not hardcode locale unless certainly necessary ([#6791]({{ site.repository }}/issues/6791))
## 3.7.2 / 2018-01-25
{: #v3-7-2}
@@ -189,7 +38,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- inform that symlinks are not allowed in safe mode ([#6670]({{ site.repository }}/issues/6670))
- Glob scope path only if configured with a pattern ([#6692]({{ site.repository }}/issues/6692))
- Add gem &#34;wdm&#34; to all newly generated Gemfiles ([#6711]({{ site.repository }}/issues/6711))
- Fix timezone inconsistencies between different ruby version ([#6697]({{ site.repository }}/issues/6697))
- Fix timezone incosistencies between different ruby version ([#6697]({{ site.repository }}/issues/6697))
- Refactor collections_dir feature for consistency ([#6685]({{ site.repository }}/issues/6685))
### Minor Enhancements
@@ -296,7 +145,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Add jekyll-pwa-plugin ([#6533]({{ site.repository }}/issues/6533))
- Remove Jekyll-Smartify from plugins directory ([#6548]({{ site.repository }}/issues/6548))
- Updated Jekyll-Pug listing to include official website ([#6555]({{ site.repository }}/issues/6555))
- Remove link to severely outdated asset plugin ([#6613]({{ site.repository }}/issues/6613))
- Remove link to severly outdated asset plugin ([#6613]({{ site.repository }}/issues/6613))
- Default time zone depends upon server ([#6617]({{ site.repository }}/issues/6617))
- Add `disqus-for-jekyll` to plugins. ([#6618]({{ site.repository }}/issues/6618))
- Update &#34;Requirements&#34; for Ruby version ([#6623]({{ site.repository }}/issues/6623))
@@ -929,9 +778,9 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Update appveyor.yml and fix optional deps for Ruby x64 ([#5180]({{ site.repository }}/issues/5180))
- Improve tests for Jekyll::PluginManager ([#5167]({{ site.repository }}/issues/5167))
- Update Ruby versions in travis.yml ([#5221]({{ site.repository }}/issues/5221))
- Avoid installing unnecessary gems for site testing ([#5272]({{ site.repository }}/issues/5272))
- Avoid installing unecessary gems for site testing ([#5272]({{ site.repository }}/issues/5272))
- Proposal: Affinity teams and their captains ([#5273]({{ site.repository }}/issues/5273))
- Replace duplicate with positive local test in issue template ([#5286]({{ site.repository }}/issues/5286))
- Replace duplicate with postive local test in issue template ([#5286]({{ site.repository }}/issues/5286))
- Update AppVeyor config. ([#5240]({{ site.repository }}/issues/5240))
- Execute jekyll from clone instead of defined binary when running 'script/default-site' ([#5295]({{ site.repository }}/issues/5295))
- rubocop: lib/jekyll/document.rb complexity fixes ([#5045]({{ site.repository }}/issues/5045))
@@ -983,7 +832,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Allow collections to have documents that have no file extension ([#4545]({{ site.repository }}/issues/4545))
- Add size property to `group_by` result ([#4557]({{ site.repository }}/issues/4557))
- Site Template: Removed unnecessary nesting from `_base.scss` ([#4637]({{ site.repository }}/issues/4637))
- Adding a debug log statement for skipped future documents. ([#4558]({{ site.repository }}/issues/4558))
- Adding a debug log statment for skipped future documents. ([#4558]({{ site.repository }}/issues/4558))
- Site Template: Changed main `<div>` to `<main>` and added accessibility info ([#4636]({{ site.repository }}/issues/4636))
- Add array support to `where` filter ([#4555]({{ site.repository }}/issues/4555))
- 'jekyll clean': also remove .sass-cache ([#4652]({{ site.repository }}/issues/4652))
@@ -1321,7 +1170,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- utils/drops: update Drop to support `Utils.deep_merge_hashes` ([#4289]({{ site.repository }}/issues/4289))
- Make sure jekyll/drops/drop is loaded first. ([#4292]({{ site.repository }}/issues/4292))
- Convertible/Page/Renderer: use payload hash accessor & setter syntax for backwards-compatibility ([#4311]({{ site.repository }}/issues/4311))
- Drop: fix hash setter precedence ([#4312]({{ site.repository }}/issues/4312))
- Drop: fix hash setter precendence ([#4312]({{ site.repository }}/issues/4312))
- utils: `has_yaml_header?` should accept files with extraneous spaces ([#4290]({{ site.repository }}/issues/4290))
- Escape html from site.title and page.title in site template ([#4307]({{ site.repository }}/issues/4307))
- Allow custom file extensions if defined in `permalink` YAML front matter ([#4314]({{ site.repository }}/issues/4314))

View File

@@ -4,38 +4,53 @@ permalink: /docs/home/
redirect_from: /docs/index.html
---
This site aims to be a comprehensive guide to Jekyll. Well cover topics such as getting your site up and running, creating and managing content, customizing your build, and deploying.
This site aims to be a comprehensive guide to Jekyll. Well cover topics such
as getting your site up and running, creating and managing your content,
customizing the way your site works and looks, deploying to various
environments, and give you some advice on participating in the future
development of Jekyll itself.
## What is Jekyll, exactly?
## So what is Jekyll, exactly?
Jekyll is a simple, blog-aware, static site generator.
Jekyll is a simple, blog-aware, static site generator. It takes a template
directory containing raw text files in various formats, runs it through
a converter (like [Markdown](https://daringfireball.net/projects/markdown/))
and our [Liquid](https://shopify.github.io/liquid/) renderer, and
spits out a complete, ready-to-publish static website suitable
for serving with your favorite web server. Jekyll also happens to be the engine
behind [GitHub Pages](https://pages.github.com), which means you can use Jekyll
to host your projects page, blog, or website from GitHubs servers **for
free**.
You create your content as text files ([Markdown](https://daringfireball.net/projects/markdown/)), and organize them into folders. Then, you build the shell of your site using [Liquid](https://shopify.github.io/liquid/)-enhanced HTML templates. Jekyll automatically stitches the content and templates together, generating a website made entirely of static assets, suitable for uploading to any server.
## Helpful Hints
Jekyll happens to be the engine behind [GitHub Pages](https://pages.github.com), so you can host your projects Jekyll page/blog/website on GitHubs servers **for free**.
## Navigating the Guide
Throughout this guide, you'll see these special sections that help you get the most out of Jekyll:
Throughout this guide there are a number of small-but-handy pieces of
information that can make using Jekyll easier, more interesting, and less
hazardous. Heres what to look out for.
<div class="note">
<h5>ProTips™</h5>
<p>Tips and tricks that'll make you a Jekyll wizard!</p>
<h5>ProTips™ help you get more from Jekyll</h5>
<p>These are tips and tricks that will help you be a Jekyll wizard!</p>
</div>
<div class="note info">
<h5>Notes</h5>
<p>Extra tidbits that are sometimes necessary to understand Jekyll.</p>
<h5>Notes are handy pieces of information</h5>
<p>These are for the extra tidbits sometimes necessary to understand
Jekyll.</p>
</div>
<div class="note warning">
<h5>Warnings</h5>
<p>Common pitfalls to avoid.</p>
<h5>Warnings help you not blow things up</h5>
<p>Be aware of these messages if you wish to avoid certain death.</p>
</div>
<div class="note unreleased">
<h5>Unreleased</h5>
<p>Features planned for future versions of Jekyll, but not available yet.</p>
<h5>You'll see this by a feature that hasn't been released</h5>
<p>Some pieces of this website are for future versions of Jekyll that
are not yet released.</p>
</div>
If you find anything we havent covered, or would like to share a tip that others might find handy, please [file an issue]({{ site.repository }}/issues/new) and well see about adding it to the guide.
If you come across anything along the way that we havent covered, or if you
know of a tip you think others would find handy, please [file an
issue]({{ site.repository }}/issues/new) and well see about
including it in this guide.

View File

@@ -1,144 +1,64 @@
---
title: Installation
description: Official guide to install Jekyll on macOS, GNU/Linux or Windows.
permalink: /docs/installation/
---
- [Requirements](#requirements)
- [Install on macOS](#macOS)
- [Install on Windows](../windows/)
- [Upgrade Jekyll](#upgrade-jekyll)
Getting Jekyll installed and ready-to-go should only take a few minutes.
If it ever becomes a pain, please [file an issue]({{ site.repository }}/issues/new)
(or submit a pull request) describing the issue you
encountered and how we might make the process easier.
Installing Jekyll should be straight-forward if your system meets the requirements.
## Requirements
### Requirements
Installing Jekyll should be straight-forward if all requirements are met.
Before you start, make sure your system has the following:
- [Ruby](https://www.ruby-lang.org/en/downloads/) version 2.2.5 or above, including all development headers (ruby installation can be checked by running `ruby -v`)
- GNU/Linux, Unix, or macOS
- [Ruby](https://www.ruby-lang.org/en/downloads/) version 2.2.5 or above, including all development
headers (ruby installation can be checked by running `ruby -v`, development headers can be checked on Ubuntu by running `apt list --installed ruby-dev`)
- [RubyGems](https://rubygems.org/pages/download) (which you can check by running `gem -v`)
- [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (in case your system doesn't have them installed, which you can check by running `gcc -v`,`g++ -v` and `make -v` in your system's command line interface)
## Install on macOS {#macOS}
We only cover macOS High Sierra 10.13 here, which comes with Ruby 2.3.3, older systems will need to [install a more recent Ruby version via Homebrew](#homebrew).
First, you need to install the command-line tools to be able to compile native extensions, open a terminal and run:
```sh
xcode-select --install
```
### Set up Ruby included with the OS
Check your Ruby version meet our requirements:
```sh
ruby -v
2.3.3
```
Great, let's install Jekyll. We also need [Bundler](https://bundler.io/) to help us handle [plugins](../plugins) and [themes](../themes):
```sh
gem install bundler jekyll
```
That's it, you're ready to go, either by installing our [default minimal blog theme](https://github.com/jekyll/minima) with `jekyll new jekyll-website` or by starting from scratch:
```sh
mkdir jekyll-website
cd jekyll-website
# Create a Gemfile
bundle init
# Add Jekyll
bundle add jekyll
# Install gems
bundle install
```
Great, from there you can now either use a [theme](../themes/) or [create your own layouts](../templates/).
### Install a newer Ruby version via Homebrew {#homebrew}
If you wish to install the latest version of Ruby and get faster builds, we recommend to do it via [Homebrew](https://brew.sh) a handy package manager for macOS.
```sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
```
Yay! Now you have a shiny Ruby on your system!
### Install multiple Ruby versions with rbenv {#rbenv}
Developers often use [rbenv](https://github.com/rbenv/rbenv) to manage multiple Ruby versions. This can be useful if you want to run the same Ruby version used by [GitHub Pages](https://pages.github.com/versions/) or [Netlify](https://www.netlify.com/docs/#ruby) for instance.
```sh
# Install rbenv and ruby-build
brew install rbenv
# Setup rbenv integration to your shell
rbenv init
# Check your install
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
```
Restart your terminal for changes to take effect.
Now we can install the Ruby version of our choice, let's go with Ruby 2.5.1 here:
```sh
rbenv install 2.5.1
rbenv global 2.5.1
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
```
That's it! Head over [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
<div class="note info" markdown="1">
##### Problems installing Jekyll?
Check out the [troubleshooting](../troubleshooting/) page or
[ask for help on our forum](https://talk.jekyllrb.com).
<div class="note info">
<h5>Problems installing Jekyll?</h5>
<p>
Check out the <a href="../troubleshooting/">troubleshooting</a> page or
<a href="{{ site.repository }}/issues/new">report an issue</a> so the
Jekyll community can improve the experience for everyone.
</p>
</div>
## Upgrade Jekyll
<div class="note info">
<h5>Running Jekyll on Windows</h5>
<p>
While Windows is not officially supported, it is possible to get Jekyll running
on Windows. Special instructions can be found on our
<a href="../windows/#installation">Windows-specific docs page</a>.
</p>
</div>
Before you start developing with Jekyll, you may want to check that you're up to date with the latest version. To find the currently installed version of Jekyll, run one of these commands:
## Install with RubyGems
The best way to install Jekyll is via
[RubyGems](https://rubygems.org/pages/download). At the terminal prompt,
simply run the following command to install Jekyll:
```sh
jekyll --version
gem list jekyll
gem install jekyll
```
You can use RubyGems to find [the current version of Jekyll](https://rubygems.org/gems/jekyll). Another way to check if you have the latest version is to run the command `gem outdated`. This will provide a list of all the gems on your system that need to be updated. If you aren't running the latest version, run this command:
All of Jekylls gem dependencies are automatically installed by the above
command, so you wont have to worry about them at all.
```sh
bundle update jekyll
```
Alternatively, if you don't have Bundler installed run:
```sh
gem update jekyll
```
To upgrade to latest Rubygems, run:
```
gem update --system
```
Refer to our [upgrading section](../upgrading/) to upgrade from Jekyll 2.x or 1.x.
<div class="note info">
<h5>Installing Xcode Command-Line Tools</h5>
<p>
If you run into issues installing Jekyll's dependencies which make use of
native extensions and are using macOS, you will need to install Xcode
and the Command-Line Tools it ships with. Download them in
<code>Preferences &#8594; Downloads &#8594; Components</code>.
</p>
</div>
## Pre-releases
@@ -168,4 +88,52 @@ bundle exec rake build
ls pkg/*.gem | head -n 1 | xargs gem install -l
```
## Optional Extras
There are a number of (optional) extra features that Jekyll supports that you
may want to install, depending on how you plan to use Jekyll. These extras
include LaTeX support, and the use of alternative content rendering engines.
Check out [the extras page](../extras/) for more information.
<div class="note">
<h5>ProTip™: Enable Syntax Highlighting</h5>
<p>
If youre the kind of person who is using Jekyll, then chances are youll
want to enable syntax highlighting using <a href="http://pygments.org/">Pygments</a>
or <a href="https://github.com/jayferd/rouge">Rouge</a>. You should really
<a href="../templates/#code-snippet-highlighting">check out how to
do that</a> before you go any farther.
</p>
</div>
## Already Have Jekyll?
Before you start developing with Jekyll, you may want to check that you're up to date with the latest version. To find your version of Jekyll, run one of these commands:
```sh
jekyll --version
gem list jekyll
```
You can also use [RubyGems](https://rubygems.org/gems/jekyll) to find the current versioning of any gem. But you can also use the `gem` command line tool:
```sh
gem search jekyll --remote
```
and you'll search for just the name `jekyll`, and in brackets will be latest version. Another way to check if you have the latest version is to run the command `gem outdated`. This will provide a list of all the gems on your system that need to be updated. If you aren't running the latest version, run this command:
```sh
bundle update jekyll
```
Alternatively, if you don't have Bundler installed run:
```sh
gem update jekyll
```
Please refer to our [upgrading section](../upgrading/) for major updates
detailed instructions.
Now that youve got everything up-to-date and installed, lets get to work!

View File

@@ -7,11 +7,11 @@ title: "Avoiding Burnout"
# 1. Use Jekyll
Maintainers of Jekyll should be using it regularly. This is partly because you won't be a good maintainer unless you can put yourself in the shoes of our users, but also because you may at some point decide to stop using Jekyll, and at that point you should also decide to stop being a maintainer and find other things to work on.
Maintainers of Jekyll should be using it regularly. This is partly because you won't be a good maintainer unless you can put yourself in the shoes of our users but also because you may decide to stop using Jekyll and at that point you should also decide not to be a maintainer and find other things to work on.
# 2. No Guilt About Leaving
All maintainers can stop working on Jekyll at any time without any guilt or explanation (like at a job). We may still ask for your help with questions after you leave but you are under no obligation to answer them. If you create a big mess and then leave you still have no obligations but we may think less of you (or, realistically, probably just revert the problematic work). Also, you should probably take a break from Jekyll at least a few times a year.
All maintainers can stop working on Jekyll at any time without any guilt or explanation (like a job). We may still ask for your help with questions after you leave but you are under no obligation to answer them. Like a job, if you create a big mess and then leave you still have no obligations but we may think less of you (or, realistically, probably just revert the problematic work). Like a job, you should probably take a break from Jekyll at least a few times a year.
This also means contributors should be consumers. If a maintainer finds they are not using a project in the real-world, they should reconsider their involvement with the project.

View File

@@ -8,14 +8,13 @@ permalink: /docs/maintaining/
Hello! This is where we document various processes for maintaining Jekyll. Being a maintainer for any Jekyll project is a big responsibility, so we put together some helpful documentation for various tasks you might do as a maintainer.
- [Affinity teams & their captains](affinity-team-captain/)
- [Triaging an issue](triaging-an-issue/)
- [Reviewing a pull request](reviewing-a-pull-request/)
- [Merging a pull request](merging-a-pull-request/)
- [Avoiding burnout](avoiding-burnout/)
- [Special Labels](special-labels/)
- [Releasing a new version](releasing-a-new-version/)
1. [Affinity teams & their captains](affinity-team-captain/)
2. [Triaging and issue](triaging-an-issue/)
3. [Reviewing a pull request](reviewing-a-pull-request/)
4. [Merging a pull request](merging-a-pull-request/)
5. [Avoiding burnout](avoiding-burnout/)
6. [Special Labels](special-labels/)
Interested in becoming a maintainer? Here is some documentation for **contributors**:
- [Becoming a maintainer](becoming-a-maintainer/)
1. [Becoming a maintainer](becoming-a-maintainer/)

View File

@@ -16,7 +16,7 @@ All pull requests should be subject to code review. Code review is a [foundation
We have [a helpful little bot](https://github.com/jekyllbot) which we use to merge pull requests. We don't use the GitHub.com interface for two reasons:
1. You can't modify anything on mobile (e.g. titles, labels)
2. We like to provide a consistent paper trail in the `History.markdown` file for each release
2. Provide a consistent paper trail in the `History.markdown` file for each release
To merge a pull request, leave a comment thanking the contributor, then add the special merge request:
@@ -30,12 +30,12 @@ The merge request is made up of three things:
1. `@jekyllbot:` this is the prefix our bot looks for when processing commands
2. `merge` the command
3. `+dev` the category to which the changes belong.
3. `+dev` the category to which the changes belong
The categories match the headings in the `History.markdown` file, and they are:
The categories match the H3's in the history/changelog file, and they are:
1. Major Enhancements (`+major`) major updates or breaking changes to the code which necessitate a major version bump (v3 ~> v4)
2. Minor Enhancements (`+minor`) minor updates (with the labels `feature` or `enhancement`) which necessitate a minor version bump (v3.1 ~> v3.2)
2. Minor Enhancements (`+minor`) minor updates (feature, enhancement) which necessitate a minor version bump (v3.1 ~> v3.2)
3. Bug Fixes (`+bug`) corrections to code which do not change or add functionality, which necessitate a patch version bump (v3.1.0 ~> v3.1.1)
4. Documentation (`+doc`) - changes to the documentation found in `docs/_docs/`
5. Site Enhancements (`+site`) changes to the source of [https://jekyllrb.com](https://jekyllrb.com) found in `docs/`

View File

@@ -1,81 +0,0 @@
---
title: "Releasing a new version"
---
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
The most important thing to understand before making a release is that there's no need to feel nervous. Most things are revertable, and even if you do publish an incomplete gem version, we can always skip that one. Don't hestitate to contact the other maintainers if you feel unsure or don't know what to do next.
### Bump the version
The only important place you need to manually bump the version is in `lib/jekyll/version.rb`. Adjust that, and everything else should work fine.
### Update the history document
Replace the first header of the history document with a version milestone. This looks like the following:
```diff
-## HEAD
+## 3.7.1 / 2018-01-25
```
Adjust the version number and the date. The `## HEAD` heading will be regenerated next time a pull request is merged.
Once you've done this, update the website by running the following command:
```sh
bundle exec rake site:generate
```
This updates the website's changelog, and pushes the versions in various other places.
It's recommended that you go over the `History.markdown` file manually one more time, in case there are any spelling errors or such. Feel free to fix those manually, and after you're done generating the website changelog, commit your changes.
## Write a release post
In case this isn't done already, you can generate a new release post using the included `rake` command:
```sh
bundle exec rake site:releases:new[3.8.0]
```
where `3.8.0` should be replaced with the new version. Then, write the post. Be sure to thank all of the collaborators and maintainers who have contributed since the last release. You can generate a log of their names using the following command:
```sh
git shortlog -sn master...v3.7.2
```
where, again `v3.7.2` is the last release. Be sure to open a pull request for your release post.
### Push the version
Before you do this step, make sure the following things are done:
- You have permission to push a new gem version to RubyGems
- You're logged into RubyGems on your command line
- A release post has been prepared, and is ideally already live
- All of the prior steps are done, committed, and pushed to `master`
Really the only thing left to do is to run this command:
```sh
bundle exec rake release
```
This will automatically build the new gem, make a release commit and tag and then push the new gem to RubyGems. Don't worry about creating a GitHub release, @jekyllbot should take care of that.
And then, you're done! :tada: Feel free to celebrate!
If you have access to the [@jekyllrb](https://twitter.com/jekyllrb) Twitter account, you should tweet the release post from there. If not, just ask another maintainer to do it or to give you access.
## For non-core gems
If you're not a maintainer for `jekyll/jekyll`, the procedure is much simpler in a lot of cases. Generally, the procedure still looks like this:
- Bump the gem version manually, usually in `lib/<plugin_name>/version.rb`
- Adjust the history file
- Run `bundle exec rake release` or `script/release`, depending on which of the two exists
- Rejoice
Be sure to ask your project's maintainers if you're unsure!

View File

@@ -6,7 +6,7 @@ permalink: /docs/permalinks/
Permalinks refer to the URLs (excluding the domain name or directory folder) for your pages, posts, or collections.
Jekyll supports a flexible way to build permalinks, allowing you to leverage various template variables or choose built-in permalink styles (such as `date`) that automatically use a template-variable pattern.
You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title:output_ext`. Each of the colon-prefixed keywords is a template variable.
You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title.html`. Each of the colon-prefixed keywords is a template variable.
## Where to configure permalinks
@@ -15,7 +15,7 @@ You can configure your site's permalinks through the [Configuration]({% link _do
Setting permalink styles in your configuration file applies the setting globally in your project. You configure permalinks in your `_config.yml` file like this:
```yaml
permalink: /:categories/:year/:month/:day/:title:output_ext
permalink: /:categories/:year/:month/:day/:title.html
```
If you don't specify any permalink setting, Jekyll uses the above pattern as the default.
@@ -26,7 +26,7 @@ The permalink can also be set using a built-in permalink style:
permalink: date
```
`date` is the same as `:categories/:year/:month/:day/:title:output_ext`, the default. See [Built-in Permalink Styles](#builtinpermalinkstyles) below for more options.
`date` is the same as `:categories/:year/:month/:day/:title.html`, the default. See [Built-in Permalink Styles](#builtinpermalinkstyles) below for more options.
Setting the permalink in your post, page, or collection's front matter overrides any global settings. Here's an example:
@@ -226,7 +226,7 @@ Although you can specify a custom permalink pattern using [template variables](#
<p><code>date</code></p>
</td>
<td>
<p><code>/:categories/:year/:month/:day/:title:output_ext</code></p>
<p><code>/:categories/:year/:month/:day/:title.html</code></p>
</td>
</tr>
<tr>
@@ -242,7 +242,7 @@ Although you can specify a custom permalink pattern using [template variables](#
<p><code>ordinal</code></p>
</td>
<td>
<p><code>/:categories/:year/:y_day/:title:output_ext</code></p>
<p><code>/:categories/:year/:y_day/:title.html</code></p>
</td>
</tr>
<tr>
@@ -250,7 +250,7 @@ Although you can specify a custom permalink pattern using [template variables](#
<p><code>none</code></p>
</td>
<td>
<p><code>/:categories/:title:output_ext</code></p>
<p><code>/:categories/:title.html</code></p>
</td>
</tr>
</tbody>
@@ -297,7 +297,7 @@ Given a post named: `/2009-04-29-slap-chop.md`
</tr>
<tr>
<td>
<p><code>/:month-:day-:year/:title:output_ext</code></p>
<p><code>/:month-:day-:year/:title.html</code></p>
</td>
<td>
<p><code>/04-29-2009/slap-chop.html</code></p>
@@ -330,7 +330,7 @@ The permalink setting in your configuration file specifies the permalink style u
For example:
* A permalink style of `/:categories/:year/:month/:day/:title:output_ext` for posts becomes `/:title.html` for pages and collections.
* A permalink style of `/:categories/:year/:month/:day/:title.:output_ext` for posts becomes `/:title.html` for pages and collections.
* A permalink style of `pretty` (or `/:categories/:year/:month/:day/:title/`), which omits the file extension and contains a trailing slash, will update page and collection permalinks to also omit the file extension and contain a trailing slash: `/:title/`.
* A permalink style of `date`, which contains a trailing file extension, will update page permalinks to also contain a trailing file extension: `/:title.html`. But no time or category information will be included.

View File

@@ -94,11 +94,7 @@ In general, plugins you make will fall broadly into one of five categories:
4. [Tags](#tags)
5. [Hooks](#hooks)
See the bottom of the page for a [list of available plugins](#available-plugins).
For further information on how to develop your own plugins, check out the [Liquid documentation](https://github.com/Shopify/liquid/wiki/Liquid-for-Programmers) as well.
If you never developed a Jekyll plugin [check this useful wrap-up](https://ayastreb.me/writing-a-jekyll-plugin/) by @ayastreb to get started.
See the bottom of the page for a [list of available plugins](#available-plugins)
## Generators
@@ -757,6 +753,10 @@ You can find a few useful plugins at the following locations:
#### Generators
- [ArchiveGenerator by Ilkka Laukkanen](https://gist.github.com/707909): Uses [this archive page](https://gist.github.com/707020) to generate archives.
- [LESS.js Generator by Andy Fowler](https://gist.github.com/642739): Renders
LESS.js files during generation.
- [Version Reporter by Blake Smith](https://gist.github.com/449491): Creates a version.html file containing the Jekyll version.
- [Sitemap.xml Generator by Michael Levin](https://github.com/kinnetica/jekyll-plugins): Generates a sitemap.xml file by traversing all of the available posts and pages.
- [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Adds full-text search to your Jekyll site with a plugin and a bit of JavaScript.
- [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias is specified in the YAML Front Matter.
@@ -772,6 +772,7 @@ You can find a few useful plugins at the following locations:
- [Typescript Generator by Matt Sheehan](https://github.com/sheehamj13/jekyll_ts): Generate Javascript on build from your Typescript.
- [Jekyll::AutolinkEmail by Ivan Tse](https://github.com/ivantsepp/jekyll-autolink_email): Autolink your emails.
- [Jekyll::GitMetadata by Ivan Tse](https://github.com/ivantsepp/jekyll-git_metadata): Expose Git metadata for your templates.
- [Jekyll Http Basic Auth Plugin](https://gist.github.com/snrbrnjna/422a4b7e017192c284b3): Plugin to manage http basic auth for jekyll generated pages and directories.
- [Jekyll Auto Image by Merlos](https://github.com/merlos/jekyll-auto-image): Gets the first image of a post. Useful to list your posts with images or to add [twitter cards](https://dev.twitter.com/cards/overview) to your site.
- [Jekyll Portfolio Generator by Shannon Babincsak](https://github.com/codeinpink/jekyll-portfolio-generator): Generates project pages and computes related projects out of project data files.
- [Jekyll-Umlauts by Arne Gockeln](https://github.com/webchef/jekyll-umlauts): This generator replaces all german umlauts (äöüß) case sensitive with html.
@@ -785,17 +786,25 @@ You can find a few useful plugins at the following locations:
- [Tweetsert](https://github.com/ibrado/jekyll-tweetsert): Imports tweets (Twitter statuses) as new posts. Features multiple timeline support, hashtag import, filtering, automatic category and/or tags, optional retweets and replies.
- [Stickyposts](https://github.com/ibrado/jekyll-stickyposts): Moves or copies (pins) posts marked `sticky: true` to the top of the list. Perfect for keeping important announcements on the home page, or giving collections a descriptive entry. Paginator friendly.
- [Jekyll::Paginate::Content](https://github.com/ibrado/jekyll-paginate-content): Content paginator in the style of jekyll-paginator-v2 that splits pages, posts, and collection entries into several pages. Specify a separator or use HTML &lt;h1&gt; etc. headers. Automatic splitting, single-page view, pager/trail, self-adjusting links, multipage TOC, SEO support.
- [Premonition](https://github.com/amedia/premonition): Adds block-styled side content to your page. For example summary, notes, hints or warning boxes.
- [jekyll-fontello](https://github.com/ericcornelissen/jekyll-fontello): A Jekyll plugin that automatically downloads your webfont from Fontello.
#### Converters
- [Pug plugin by Doug Beney](http://jekyll-pug.dougie.io): Use the popular Pug (previously Jade) templating language in Jekyll. Complete with caching, includes support, and much more.
- [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.
- [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 Xs fork above.
- [LESS Converter by Jason Graham](https://gist.github.com/639920): Convert LESS files to CSS.
- [LESS Converter by Josh Brown](https://gist.github.com/760265): Simple LESS converter.
- [Upcase Converter by Blake Smith](https://gist.github.com/449463): An example Jekyll converter.
- [CoffeeScript Converter by phaer](https://gist.github.com/959938): A [CoffeeScript](http://coffeescript.org) to Javascript converter.
- [Markdown References by Olov Lassus](https://github.com/olov/jekyll-references): Keep all your markdown reference-style link definitions in one \_references.md file.
- [Stylus Converter](https://gist.github.com/988201): Convert .styl to .css.
- [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting.
- [Jekyll-pandoc-multiple-formats](https://github.com/fauno/jekyll-pandoc-multiple-formats) by [edsl](https://github.com/edsl): Use pandoc to generate your site in multiple formats. Supports pandocs markdown extensions.
- [Transform Layouts](https://gist.github.com/1472645): Allows HAML layouts (you need a HAML Converter plugin for this to work).
- [Org-mode Converter](https://gist.github.com/abhiyerra/7377603): Org-mode converter for Jekyll.
- [Customized Kramdown Converter](https://github.com/mvdbos/kramdown-with-pygments): Enable Pygments syntax highlighting for Kramdown-parsed fenced code blocks.
- [Bigfootnotes Plugin](https://github.com/TheFox/jekyll-bigfootnotes): Enables big footnotes for Kramdown.
- [AsciiDoc Plugin](https://github.com/asciidoctor/jekyll-asciidoc): AsciiDoc convertor for Jekyll using [Asciidoctor](http://asciidoctor.org/).
@@ -806,7 +815,9 @@ You can find a few useful plugins at the following locations:
- [Truncate HTML](https://github.com/MattHall/truncatehtml) by [Matt Hall](https://codebeef.com/): A Jekyll filter that truncates HTML while preserving markup structure.
- [Domain Name Filter by Lawrence Woodman](https://github.com/LawrenceWoodman/domain_name-liquid_filter): Filters the input text so that just the domain name is left.
- [Summarize Filter by Mathieu Arnold](https://gist.github.com/731597): Remove markup after a `<div id="extended">` tag.
- [Smilify](https://github.com/SaswatPadhi/jekyll_smilify) by [SaswatPadhi](https://github.com/SaswatPadhi): Convert text emoticons in your content to themeable smiley pics.
- [Read in X Minutes](https://gist.github.com/zachleat/5792681) by [zachleat](https://github.com/zachleat): Estimates the reading time of a string (for blog post content).
- [Jekyll-timeago](https://github.com/markets/jekyll-timeago): Converts a time value to the time ago in words.
- [pluralize](https://github.com/bdesham/pluralize): Easily combine a number and a word into a grammatically-correct amount like “1 minute” or “2 minute**s**”.
- [reading_time](https://github.com/bdesham/reading_time): Count words and estimate reading time for a piece of text, ignoring HTML elements that are unlikely to contain running text.
@@ -825,7 +836,6 @@ You can find a few useful plugins at the following locations:
- [match_regex](https://github.com/sparanoid/match_regex): A Liquid filter to perform regex match.
- [replace_regex](https://github.com/sparanoid/replace_regex): A Liquid filter to perform regex replace.
- [Jekyll Money](https://rubygems.org/gems/jekyll-money): A Jekyll plugin for dealing with money. Because we all have to at some point.
- [jekyll-random](https://github.com/codecalm/jekyll-random) by [codecalm](https://nodecalm.net): A Jekyll plugin that generates pseudo-random data. Very useful when you want to generate a large amount of random data.
#### Tags
@@ -834,16 +844,30 @@ You can find a few useful plugins at the following locations:
- [Jekyll-gist](https://github.com/jekyll/jekyll-gist): Use the `gist` tag to easily embed a GitHub Gist onto your site. This works with public or secret gists.
- [Asset Path Tag](https://github.com/samrayner/jekyll-asset-path-plugin) by [Sam Rayner](http://www.samrayner.com/): Allows organisation of assets into subdirectories by outputting a path for a given file relative to the current post or page.
- [Delicious Plugin by Christian Hellsten](https://github.com/christianhellsten/jekyll-plugins): Fetches and renders bookmarks from delicious.com.
- [Ultraviolet Plugin by Steve Alex](https://gist.github.com/480380): Jekyll tag for the [Ultraviolet](https://github.com/grosser/ultraviolet) code highligher.
- [Tag Cloud Plugin by Ilkka Laukkanen](https://gist.github.com/710577): Generate a tag cloud that links to tag pages.
- [GIT Tag by Alexandre Girard](https://gist.github.com/730347): Add Git activity inside a list.
- [MathJax Liquid Tags by Jessy Cowan-Sharp](https://gist.github.com/834610): Simple liquid tags for Jekyll that convert inline math and block equations to the appropriate MathJax script tags.
- [Non-JS Gist Tag by Brandon Tilley](https://gist.github.com/1027674) A Liquid tag that embeds Gists and shows code for non-JavaScript enabled browsers and readers.
- [Render Time Tag by Blake Smith](https://gist.github.com/449509): Displays the time a Jekyll page was generated.
- [Status.net/OStatus Tag by phaer](https://gist.github.com/912466): Displays the notices in a given status.net/ostatus feed.
- [Embed.ly client by Robert Böhnke](https://github.com/robb/jekyll-embedly-client): Autogenerate embeds from URLs using oEmbed.
- [Logarithmic Tag Cloud](https://gist.github.com/2290195): Flexible. Logarithmic distribution. Documentation inline.
- [oEmbed Tag by Tammo van Lessen](https://gist.github.com/1455726): Enables easy content embedding (e.g. from YouTube, Flickr, Slideshare) via oEmbed.
- [FlickrSetTag by Thomas Mango](https://github.com/tsmango/jekyll_flickr_set_tag): Generates image galleries from Flickr sets.
- [Tweet Tag by Scott W. Bradley](https://github.com/scottwb/jekyll-tweet-tag): Liquid tag for [Embedded Tweets](https://dev.twitter.com/docs/embedded-tweets) using Twitters shortcodes.
- [Jekyll Twitter Plugin](https://github.com/rob-murray/jekyll-twitter-plugin): A Liquid tag plugin that renders Tweets from Twitter API. Currently supports the [oEmbed](https://dev.twitter.com/rest/reference/get/statuses/oembed) API.
- [Jekyll-contentblocks](https://github.com/rustygeldmacher/jekyll-contentblocks): Lets you use Rails-like content_for tags in your templates, for passing content from your posts up to your layouts.
- [Generate YouTube Embed](https://gist.github.com/1805814) by [joelverhagen](https://github.com/joelverhagen): Jekyll plugin which allows you to embed a YouTube video in your page with the YouTube ID. Optionally specify width and height dimensions. Like “oEmbed Tag” but just for YouTube.
- [Jekyll-beastiepress](https://github.com/okeeblow/jekyll-beastiepress): FreeBSD utility tags for Jekyll sites.
- [Jsonball](https://gist.github.com/1895282): Reads json files and produces maps for use in Jekyll files.
- [Bibjekyll](https://github.com/pablooliveira/bibjekyll): Render BibTeX-formatted bibliographies/citations included in posts and pages using bibtex2html.
- [Jekyll-citation](https://github.com/archome/jekyll-citation): Render BibTeX-formatted bibliographies/citations included in posts and pages (pure Ruby).
- [Jekyll Dribbble Set Tag](https://github.com/ericdfields/Jekyll-Dribbble-Set-Tag): Builds Dribbble image galleries from any user.
- [Debbugs](https://gist.github.com/2218470): Allows posting links to Debian BTS easily.
- [Jekyll-devonly_tag](https://gist.github.com/2403522): A block tag for including markup only during development.
- [JekyllGalleryTag](https://github.com/redwallhp/JekyllGalleryTag) by [redwallhp](https://github.com/redwallhp): Generates thumbnails from a directory of images and displays them in a grid.
- [Youku and Tudou Embed](https://gist.github.com/Yexiaoxing/5891929): Liquid plugin for embedding Youku and Tudou videos.
- [Jekyll-swfobject](https://github.com/sectore/jekyll-swfobject): Liquid plugin for embedding Adobe Flash files (.swf) using [SWFObject](https://github.com/swfobject/swfobject).
- [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [`<picture>`](https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element) element, polyfilled with Scott Jehls [Picturefill](https://github.com/scottjehl/picturefill).
- [Jekyll Image Tag](https://github.com/robwierzbowski/jekyll-image-tag): Better images for Jekyll. Save image presets, generate resized images, and add classes, alt text, and other attributes.
@@ -853,6 +877,8 @@ You can find a few useful plugins at the following locations:
- [Jekyll Date Chart](https://github.com/GSI/jekyll_date_chart) by [GSI](https://github.com/GSI): Block that renders date line charts based on textile-formatted tables.
- [Jekyll Image Encode](https://github.com/GSI/jekyll_image_encode) by [GSI](https://github.com/GSI): Tag that renders base64 codes of images fetched from the web.
- [Jekyll Quick Man](https://github.com/GSI/jekyll_quick_man) by [GSI](https://github.com/GSI): Tag that renders pretty links to man page sources on the internet.
- [jekyll-font-awesome](https://gist.github.com/23maverick23/8532525): Quickly and easily add Font Awesome icons to your posts.
- [Lychee Gallery Tag](https://gist.github.com/tobru/9171700) by [tobru](https://github.com/tobru): Include [Lychee](https://lychee.electerious.com/) albums into a post. For an introduction, see [Jekyll meets Lychee - A Liquid Tag plugin](https://tobrunet.ch/articles/jekyll-meets-lychee-a-liquid-tag-plugin/)
- [Image Set/Gallery Tag](https://github.com/callmeed/jekyll-image-set) by [callmeed](https://github.com/callmeed): Renders HTML for an image gallery from a folder in your Jekyll site. Just pass it a folder name and class/tag options.
- [jekyll_figure](https://github.com/lmullen/jekyll_figure): Generate figures and captions with links to the figure in a variety of formats
- [Jekyll GitHub Sample Tag](https://github.com/bwillis/jekyll-github-sample): A liquid tag to include a sample of a github repo file in your Jekyll site.
@@ -883,9 +909,8 @@ You can find a few useful plugins at the following locations:
plugin to generate publication lists from [BibSonomy](https://www.bibsonomy.org/).
- [github-cards](https://github.com/edward-shen/github-cards): Creates styleable Github cards for your Github projects.
- [disqus-for-jekyll](https://github.com/kacperduras/disqus-for-jekyll): A Jekyll plugin to view the comments powered by Disqus.
- [jekyll-html](https://github.com/kacperduras/jekyll-html): A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections.
- [jekyll-onebox](https://github.com/rriemann/jekyll-onebox): Liquid tag for displaying HTML previews (embeds) for links to popular domains. Plugin is based on [Onebox](https://github.com/discourse/onebox) that powers link previews in [Discourse](http://github.com/discourse/discourse) forums.
- [jekyll-w2m](https://github.com/kacperduras/jekyll-w2m): A Jekyll plugin to liberate content from Microsoft Word documents (powered by [word-to-markdown](https://github.com/benbalter/word-to-markdown)).
- [jekyll-html](https://github.com/kacperduras/jekyll-html): A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections.
#### Collections
@@ -898,8 +923,12 @@ You can find a few useful plugins at the following locations:
- [Analytics for Jekyll](https://github.com/hendrikschneider/jekyll-analytics) by Hendrik Schneider: An effortless way to add various trackers like Google Analytics, Matomo (formerly Piwik), mPulse, etc. to your site.
- [ditaa-ditaa](https://github.com/tmthrgd/ditaa-ditaa) by Tom Thorogood: a drastic revision of jekyll-ditaa that renders diagrams drawn using ASCII art into PNG images.
- [Pygments Cache Path by Raimonds Simanovskis](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb): Plugin to cache syntax-highlighted code from Pygments.
- [Draft/Publish Plugin by Michael Ivey](https://gist.github.com/49630): Save posts as drafts.
- [Growl Notification Generator by Tate Johnson](https://gist.github.com/490101): Send Jekyll notifications to Growl.
- [Growl Notification Hook by Tate Johnson](https://gist.github.com/525267): Better alternative to the above, but requires his “hook” fork.
- [Related Posts by Lawrence Woodman](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin): Overrides `site.related_posts` to use categories to assess relationship.
- [jekyll-tagging-related_posts](https://github.com/toshimaru/jekyll-tagging-related_posts): Jekyll related_posts function based on tags (works on Jekyll3).
- [Tiered Archives by Eli Naeher](https://gist.github.com/88cda643aa7e3b0ca1e5): Create tiered template variable that allows you to group archives by year and month.
- [Jekyll-localization](https://github.com/blackwinter/jekyll-localization): Jekyll plugin that adds localization features to the rendering engine.
- [Jekyll-rendering](https://github.com/blackwinter/jekyll-rendering): Jekyll plugin to provide alternative rendering engines.
- [Jekyll-pagination](https://github.com/blackwinter/jekyll-pagination): Jekyll plugin to extend the pagination generator.
@@ -907,6 +936,7 @@ You can find a few useful plugins at the following locations:
- [Jekyll-scholar](https://github.com/inukshuk/jekyll-scholar): Jekyll extensions for the blogging scholar.
- [Jekyll-assets](http://jekyll.github.io/jekyll-assets/) by [ixti](https://github.com/ixti): Rails-alike assets pipeline (write assets in CoffeeScript, Sass, LESS etc; specify dependencies for automatic bundling using simple declarative comments in assets; minify and compress; use JST templates; cache bust; and many-many more).
- [JAPR](https://github.com/kitsched/japr): Jekyll Asset Pipeline Reborn - Powerful asset pipeline for Jekyll that collects, converts and compresses JavaScript and CSS assets.
- [File compressor](https://gist.github.com/2758691) by [mytharcher](https://github.com/mytharcher): Compress HTML and JavaScript files on site build.
- [Jekyll-minibundle](https://github.com/tkareine/jekyll-minibundle): Asset bundling and cache busting using external minification tool of your choice. No gem dependencies.
- [Singlepage-jekyll](https://github.com/JCB-K/singlepage-jekyll) by [JCB-K](https://github.com/JCB-K): Turns Jekyll into a dynamic one-page website.
- [generator-jekyllrb](https://github.com/robwierzbowski/generator-jekyllrb): A generator that wraps Jekyll in [Yeoman](http://yeoman.io/), a tool collection and workflow for building modern web apps.
@@ -934,12 +964,12 @@ You can find a few useful plugins at the following locations:
- [jekyll-numbered-headings](https://github.com/muratayusuke/jekyll-numbered-headings): Adds ordered number to headings.
- [jekyll-pre-commit](https://github.com/mpchadwick/jekyll-pre-commit): A framework for running checks against your posts using a git pre-commit hook before you publish them.
- [jekyll-pwa-plugin](https://github.com/lavas-project/jekyll-pwa): A plugin provides PWA support for Jekyll. It generates a service worker in Jekyll build process and makes precache and runtime cache available in the runtime with Google Workbox.
- [jekyll-algolia](https://community.algolia.com/jekyll-algolia/): Add fast and relevant search to your Jekyll site through the Algolia API.
<div class="note info">
<h5>Submit your gem plugins</h5>
<h5>Jekyll Plugins Wanted</h5>
<p>
You're encouraged to add your Jekyll gem plugins to this list, <a href="../contributing/">read the contributing page</a> to find
If you have a Jekyll plugin that you would like to see added to this list,
you should <a href="../contributing/">read the contributing page</a> to find
out how to make that happen.
</p>
</div>

View File

@@ -201,38 +201,13 @@ category: blog
In this case, the listing pages will be accessible at `{baseurl}/category/blog.html`
Although categories and tags are very similar, they are used to group posts,
there are a few differences between them. Categories and sub-categories create
hierarchies that, by default, are reflected in the directory structure of your
site. A post with the following header
```yaml
---
layout: post
title: A Trip
category: [ blog, travel ]
---
```
will be accessible at `{baseurl}/blog/travel/year/month/day/A-Trip.html`. On
the other hand, a tagged post
```yaml
---
layout: post
title: A Trip
tags: [ blog, travel ]
---
```
will be saved as `{baseurl}/year/month/day/A-Trip.html`. It is up to you to
create `{baseurl}/tag/blog.html` and `{baseurl}/tag/travel.html` the same way as
described above for categories.
While this example is done with tags and categories, you can easily extend your
lists to filter by any other variable created with extensions.
While this example is done with categories, you can easily extend your lists to
filter by tags or any other variable created with extensions.
## Post excerpts
Each post automatically takes the first block of text, from the beginning of
the content to the first occurrence of `excerpt_separator`, and sets it in the
post's data hash.
the content to the first occurrence of `excerpt_separator`, and sets it as the `post.excerpt`.
Take the above example of an index of posts. Perhaps you want to include
a little hint about the post's content by adding the first paragraph of each of
your posts:

View File

@@ -15,8 +15,8 @@ Jekyll's growing use is producing a wide variety of tutorials, frameworks, exten
## Useful Guides
- [CloudCannon Academy](https://learn.cloudcannon.com/) is a set of resources created by [CloudCannon](https://cloudcannon.com/) to help folks get up and running with Jekyll. They cover all skill levels, and even include some great video tutorials.
- [Jekyll Cheatsheet](https://learn.cloudcannon.com/jekyll-cheat-sheet/) is a single-page resource for Jekyll filters, variables, and the like.
- [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. They cover all skill levels, and even include some great video tutorials.
- [Jekyll Cheatsheet](http://jekyll.tips/jekyll-cheat-sheet/) 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](https://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/).
@@ -32,7 +32,6 @@ Jekyll's growing use is producing a wide variety of tutorials, frameworks, exten
- [Simple Form](https://getsimpleform.com/)
- [Formingo](https://www.formingo.co/guides/jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=Jekyll%20Documentation)
- [Formester](http://www.formester.com)
- [Talkyard](https://www.talkyard.io/blog-comments): Embedded comments for Jekyll and others (free and open source, or hosted serverless)
- [Staticman](https://staticman.net): Add user-generated content to a Jekyll site (free and open source)
- [Snipcart](https://snipcart.com/blog/static-site-e-commerce-part-2-integrating-snipcart-with-jekyll): Add a shopping cart to a Jekyll site
- [Contentful](https://www.contentful.com/ecosystem/jekyll/): use Jekyll together with the API-driven Contentful CMS.
@@ -42,8 +41,6 @@ Jekyll's growing use is producing a wide variety of tutorials, frameworks, exten
- [How I'm using Jekyll in 2016](https://mademistakes.com/articles/using-jekyll-2016/)
- [Talkyard comments instructions for Jekyll](https://jekyll-demo.talkyard.io/2018/01/09/installation-instructions.html)
- [Static Comments with Jekyll & Staticman](https://mademistakes.com/articles/improving-jekyll-static-comments/)
- [Adding Ajax pagination to Jekyll](https://eduardoboucas.com/blog/2014/11/05/adding-ajax-pagination-to-jekyll.html)

View File

@@ -91,20 +91,6 @@ you come up with your own tags via plugins.
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Date to String in ordinal US style</strong></p>
<p>Format a date to ordinal, US, short format.</p>
</td>
<td class="align-center">
<p>
<code class="filter">{% raw %}{{ site.time | date_to_string: "ordinal", "US" }}{% endraw %}</code>
</p>
<p>
<code class="output">Nov 7th, 2008</code>
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Date to Long String</strong></p>
@@ -119,20 +105,6 @@ you come up with your own tags via plugins.
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Date to Long String in ordinal UK style</strong></p>
<p>Format a date to ordinal, UK, long format.</p>
</td>
<td class="align-center">
<p>
<code class="filter">{% raw %}{{ site.time | date_to_long_string: "ordinal" }}{% endraw %}</code>
</p>
<p>
<code class="output">7th November 2008</code>
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Where</strong></p>

View File

@@ -3,7 +3,7 @@ title: Themes
permalink: /docs/themes/
---
Jekyll has an extensive theme system that allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes specify plugins and package up assets, layouts, includes, and stylesheets in a way that can be overridden by your site's content.
Jekyll has an extensive theme system that allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes package up layouts, includes, and stylesheets in a way that can be overridden by your site's content.
## Understanding gem-based themes
@@ -108,48 +108,7 @@ Suppose you want to get rid of the gem-based theme and convert it to a regular t
To do this, copy the files from the theme gem's directory into your Jekyll site directory. (For example, copy them to `/myblog` if you created your Jekyll site at `/myblog`. See the previous section for details.)
Then you must tell Jekyll about the plugins that were referenced by the theme. You can find these plugins in the theme's gemspec file as runtime dependencies. If you were converting the Minima theme, for example, you might see:
```
spec.add_runtime_dependency "jekyll-feed", "~> 0.9"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.1"
```
You should include these references in the `Gemfile` in one of two ways.
You could list them individually in both `Gemfile` and `_config.yml`.
```ruby
# ./Gemfile
gem "jekyll-feed", "~> 0.9"
gem "jekyll-seo-tag", "~> 2.1"
```
```yaml
# ./_config.yml
plugins:
- jekyll-feed
- jekyll-seo-tag
```
Or you could list them explicitly as Jekyll plugins in your Gemfile, and not update `_config.yml`, like this:
```ruby
# ./Gemfile
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.9"
gem "jekyll-seo-tag", "~> 2.1"
end
```
Either way, don't forget to `bundle update`.
However, if you're publishing on GitHub Pages you should update only your `_config.yml` as GitHub Pages doesn't load plugins via Bundler.
Finally, remove references to the theme gem in `Gemfile` and configuration. For example, to remove `minima`:
Then remove references to the theme gem in `Gemfile` and configuration. For example, to remove `minima`:
- Open `Gemfile` and remove `gem "minima", "~> 2.0"`.
- Open `_config.yml` and remove `theme: minima`.
@@ -277,7 +236,7 @@ Your theme should include a `/README.md` file, which explains how site authors c
### 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 programmatically. You can also include this screenshot within your theme's documentation.
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

View File

@@ -36,12 +36,6 @@ If you installed the above - specifically on Fedora 23 - but the extensions woul
sudo dnf install redhat-rpm-config
```
On Arch Linux you need to run:
```sh
sudo pacman -S ruby-ffi
```
On Ubuntu if you get stuck after `bundle exec jekyll serve` and see error
messages like `Could not locate Gemfile` or `.bundle/ directory`, it's likely
because all requirements have not been fully met. Recent stock Ubuntu
@@ -103,55 +97,6 @@ Xcode.app can interfere with the command line tools downloaded above. If
you run into this issue, upgrade Xcode and install the upgraded Command
Line Tools.
### Running Jekyll as Non-Superuser (no sudo!)
{: #no-sudo}
On most flavors of Linux, macOS, and Bash on Ubuntu on Windows, it is
possible to run Jekyll as a non-superuser and without having to install
gems to system-wide locations by adding the following lines to the end
of your `.bashrc` file:
```
# Ruby exports
export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH
```
This tells `gem` to place its gems within the user's home folder,
not in a system-wide location, and adds the local `jekyll` command to the
user's `PATH` ahead of any system-wide paths.
This is also useful for many shared webhosting services, where user accounts
have only limited privileges. Adding these exports to `.bashrc` before running
`gem install jekyll bundler` allows a complete non-`sudo` install of Jekyll.
To activate the new exports, either close and restart Bash, logout and
log back into your shell account, or run `. .bashrc` in the
currently-running shell.
If you see the following error when running the `jekyll new` command,
you can solve it by using the above-described procedure:
```sh
jekyll new test
Running bundle install in /home/user/test...
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.
Password:
```
Once this is done, the `jekyll new` command should work properly for
your user account.
### Jekyll &amp; Mac OS X 10.11
With the introduction of System Integrity Protection, several directories
@@ -227,13 +172,13 @@ jekyll serve --baseurl '/blog'
… then make sure that you access the site at:
```
```sh
http://localhost:4000/blog/index.html
```
It wont work to just access:
```
```sh
http://localhost:4000/blog
```
@@ -252,7 +197,7 @@ specified elsewhere.
**Note: From v3.3.0 onward, Jekyll does not process `node_modules` and certain subdirectories within `vendor`, by default. But, by having an `exclude:` array defined explicitly in the config file overrides this default setting, which results in some users to encounter an error in building the site, with the following error message:**
```sh
```
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>':
@@ -290,8 +235,9 @@ problems.
### Liquid
Liquid version 2.0 seems to break the use of `{{ "{{" }}` in templates.
Unlike previous versions, using `{{ "{{" }}` in 2.0 triggers the following error:
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:
```sh
'{{ "{{" }}' was not properly terminated with regexp: /\}\}/ (Liquid::SyntaxError)

View File

@@ -250,7 +250,7 @@ following is a reference of the available data.
<td><p><code>page.excerpt</code></p></td>
<td><p>
The un-rendered excerpt of a document.
The un-rendered excerpt of the Page.
</p></td>
</tr>

View File

@@ -30,7 +30,7 @@ Now we can install Ruby. To do this we will use a repository from [BrightBox](ht
```sh
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.3 ruby2.3-dev build-essential dh-autoreconf
sudo apt-get install ruby2.3 ruby2.3-dev build-essential
```
Next let's update our Ruby gems:
@@ -61,13 +61,9 @@ jekyll new my_blog
You can make sure time management is working properly by inspecting your `_posts` folder. You should see a markdown file with the current date in the filename.
<div class="note info">
<h5>Non-superuser account issues</h5>
<p>If the `jekyll new` command prints the error "Your user account isn't allowed to install to the system RubyGems", see the "Running Jekyll as Non-Superuser" instructions in <a href="/docs/troubleshooting/#no-sudo">Troubleshooting</a>.</p>
</div>
**Note:** Bash on Ubuntu on Windows is still under development, so you may run into issues.
[WSL-Guide]: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
[BASH-WSL]: https://msdn.microsoft.com/en-us/commandline/wsl/about

View File

@@ -1,9 +1,26 @@
{% if site.gauges_id %}
<!-- Gauges (http://get.gaug.es/) -->
<script>
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '{{ site.gauges_id }}');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
{% endif %}
{% if site.google_analytics_id %}
<!-- Google Analytics (https://www.google.com/analytics) -->
<script>
!function(j,e,k,y,l,L){j.GoogleAnalyticsObject=y,j[y]||(j[y]=function(){
(j[y].q=j[y].q||[]).push(arguments)}),j[y].l=+new Date,l=e.createElement(k),
L=e.getElementsByTagName(k)[0],l.src='https://www.google-analytics.com/analytics.js',
L=e.getElementsByTagName(k)[0],l.src='//www.google-analytics.com/analytics.js',
L.parentNode.insertBefore(l,L)}(window,document,'script','ga');
ga('create', '{{ site.google_analytics_id }}', 'jekyllrb.com');

View File

@@ -13,10 +13,10 @@
<span class="post-date">
{{ post.date | date_to_string }}
</span>
{% assign author = post.author %}
<a href="https://github.com/{{ author }}" class="post-author">
<a href="https://github.com/{{ post.author }}" class="post-author">
{% assign author = post.author %}
{% avatar user=author size=24 %}
{{ author }}
{{ post.author }}
</a>
</div>
<div class="post-content">

View File

@@ -6,8 +6,7 @@
<meta name="generator" content="Jekyll v{{ jekyll.version }}">
{% feed_meta %}
<link rel="alternate" type="application/atom+xml" title="Recent commits to Jekylls master branch" href="{{ site.repository }}/commits/master.atom">
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<link rel="stylesheet" href="/css/screen.css">
<link rel="icon" type="image/x-icon" href="/favicon.ico">

View File

@@ -19,10 +19,9 @@ layout: news
<span class="post-date">
{{ page.date | date_to_string }}
</span>
{% assign author = page.author %}
<a href="https://github.com/{{ author }}" class="post-author">
{% avatar user=author size=24 %}
{{ author }}
<a href="https://github.com/{{ page.author }}" class="post-author">
{% avatar {{ page.author}} size=24 %}
{{ page.author }}
</a>
</div>
<div class="post-content">

View File

@@ -1,7 +1,7 @@
---
title: "Diversity in Open Source, and Jekyll's role in it"
date: 2017-10-19 21:33:00 +0200
author: oe
author: pup
categories: [community]
---

View File

@@ -1,8 +1,8 @@
---
title: "Jekyll 3.7.2 Released"
title: "Jekyll 3.7.1 Released"
date: 2018-01-25 22:22:22 +0530
author: ashmaroli
version: 3.7.2
version: 3.7.1
categories: [release]
---
@@ -10,8 +10,7 @@ Close on the heels of shipping 3.7.0, we were informed of a couple of
regressions due to the changes made in that release. In due time, Team Jekyll
set out to address those issues as early as possible.
Days later here we're, announcing 3.7.2 (sorry for skipping 3.7.1,
RubyGems didn't want to play nice) that fixes numerous issues! :tada:
Days later here we're, announcing 3.7.1 that fixes numerous issues! :tada:
The highlights being:
* A major regression in 3.7.0 was that when a Front Matter Default was

View File

@@ -1,43 +0,0 @@
---
layout: news_item
title: "Meet Jekyll's New Lead Developer"
date: "2018-02-19 20:48:09 -0500"
author: parkr
categories: [team]
---
Jekyll has a new Lead Developer: [Olivia](https://liv.cat/)!
After over 5 years of leading Jekyll, many releases from 0.12.1 to 3.6.0, and
countless conversations in GitHub Issues, Pull Requests, Jekyll Talk, and
more, I am passing on the torch as Lead Developer of Jekyll.
Olivia has been working with the Jekyll community for some time now. You
may have seen her around in issues and pull requests on the various Jekyll
repositories. She started as a contributor, then joined the Core team as our
community lead. Olivia joined the Jekyll Core Team with experience in the
Node.js community, both online and as a volunteer organizer with JSConf EU.
In my conversations with Olivia, it is clear that Jekyll's vision of
simplicity for the user ([no magic!](/philosophy#1-no-magic)) and letting
users' [content be king](/philosophy#3-content-is-king) will remain a top
priority. In just the last few weeks as the transition has been occurring,
we have seen some incredible work on performance that will make future
versions of Jekyll work better at scale. She will be prioritizing work on
innovative improvements to make Jekyll that much better for all of us.
Olivia balances an eye for quality with the need for shipping well.
When Tom Preston-Werner met me at GitHub HQ 2.0 in January 2013 to pass on
the torch, I could never have dreamed of all the amazing experiences this
community would share with me over the next 5 years. From visiting @qrush
in Buffalo, NY for a hack night on Jekyll to attending a Jekyll planning
session hosted by @benbalter at GitHub to Google Summer of Code which gave
us jekyll-admin, I am eternally grateful to all of you for the opportunity
to lead this excellent community. I'm confident Olivia will continue to
lead Jekyll to even greater heights.
As always, Happy Jekylling!
Parker
*Curious about who else runs this show? [Check out our excellent team.](/team/)*

View File

@@ -1,19 +0,0 @@
---
title: 'Jekyll 3.7.3 Released'
date: 2018-02-25 13:02:08 +0530
author: ashmaroli
version: 3.7.3
categories: [release]
---
Hello Jekyllers!! :wave:
We're pleased to announce the release of `v3.7.3` which fixes a bug one might encounter while using `Jekyll - 3.7.x` along with a
Jekyll plugin that in turn uses the `I18n` library.
When [v3.7.0]({% link _posts/2018-01-02-jekyll-3-7-0-released.md %}) enhanced our `slugify` filter with a `latin` option, we also
hardcoded a default fallback locale for the `I18n` library to avoid an exception raised in the event the library fails to find
any locale. This led to issues with third-party i18n plugins for Jekyll, especially since the default locale got assigned before
the plugin was loaded, irrespective of whether the `slugify` filter was used.
Jekyll will henceforth set the default locale if and only if necessary.

View File

@@ -1,20 +0,0 @@
---
title: 'Jekyll 3.8.1 Released'
date: 2018-05-01 11:56:01 -0500
author: pathawks
version: 3.8.1
categories: [release]
---
Happy May Day :tada:
The Jekyll team is happy to announce the release of `v3.8.1`, which fixes
a couple of bugs that were introduced two weeks ago in `v3.8.0`. If you have
experienced trouble regarding post excerpts or non-published posts, this release
should be the remedy. Thanks to @Chaosed0 and @domLocalHeroes for originally
reporting these issues, and to @ashmaroli for fixing them so quickly.
As a reminder, we have started work on Jekyll 4.0. If there are any
features that you would love to see added to Jekyll, or any pain points you
would like to see removed, please do add your ideas to the [Jekyll 4.0 idea
list](https://github.com/jekyll/jekyll/issues/6948).

View File

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

View File

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

View File

@@ -261,7 +261,7 @@ toc2:
{% if item.subfolderitems[0] %}
<ul>
{% for entry in item.subfolderitems %}
<li><a href="{{ entry.url }}">{{ entry.page }}</a>
<li><a href="{{ entry.url }}">{{ entry.page }}</a></li>
{% if entry.subsubfolderitems[0] %}
<ul>
{% for subentry in entry.subsubfolderitems %}
@@ -269,7 +269,6 @@ toc2:
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
@@ -397,11 +396,9 @@ In addition to inserting items from the YAML data file into your list, you also
</style>
<div class="highlight result">
<ul>
<li class=""><a href="#">Introduction</a></li>
<li class=""><a href="#">Configuration</a></li>
<li class="active"><a href="#">Deployment</a></li>
</ul>
<li class=""><a href="#">Introduction</a></li>
<li class=""><a href="#">Configuration</a></li>
<li class="active"><a href="#">Deployment</a></li>
</div>
In this case, assume `Deployment` is the current page.

View File

@@ -1,106 +0,0 @@
---
layout: tutorials
permalink: /tutorials/using-jekyll-with-bundler/
title: Using Jekyll with Bundler
---
> Bundler provides a consistent environment for Ruby projects by tracking and
> installing the exact gems and versions that are needed.
[Bundler](https://bundler.io) can be a great tool to use with Jekyll. Because it
tracks dependencies on a per-project basis, it is particularly useful if you
need to run different versions of Jekyll in different projects, or if you don't
want to install Jekyll at the system or user level. This tutorial will show you
how to create a new Jekyll project using Bundler and without installing Jekyll
outside the project.
## Before You Begin
To complete this tutorial, you'll need to have
[Ruby](https://www.ruby-lang.org/en/) and [Bundler](https://bundler.io/)
installed. You can find the installation instructions on their websites.
## Initialize Bundler
The first thing to do is create a new directory for your project and run
`bundle init`. This creates a new Bundler project (by creating an empty
Gemfile).
```sh
mkdir my-jekyll-website
cd my-jekyll-website
bundle init
```
## Configure Bundler
This step is optional, but encouraged. We're going to configure Bundler to install
gems in the `./vendor/bundle/` project subdirectory. This allows us to install
our dependencies in an isolated environment, ensuring they don't conflict with
other gems on your system. If you skip this step, Bundler will install your
dependencies globally on your system.
```sh
bundle install --path vendor/bundle
```
<div class="note info">
<h5>Bundler Config is Persistent</h5>
<p>
This step is only required once per project. Bundler saves your config in
<code>./.bundle/config</code>, so future gems will be installed to the same
location.
</p>
</div>
## Add Jekyll
Now, we're going to use Bundler to add Jekyll as a dependency of our new
project. This command will add the Jekyll gem to our Gemfile and install it to
the `./vendor/bundle/` folder.
```sh
bundle add jekyll
```
## Create A Jekyll Scaffold
Now that Jekyll is installed, we can use it to create the scaffolding for our
site. We need the `--force` parameter because our folder isn't empty - it
already has some Bundler files in it. We run the `bundle install` separately
because Jekyll gets confused if the Gemfile already exists.
```sh
bundle exec jekyll new --force --skip-bundle .
bundle install
```
## Serve the Site
Your new website is ready! You can serve the website with
`bundle exec jekyll serve` and visit it at
[http://127.0.0.1:4000](http://127.0.0.1:4000). From here, you're ready to
continue developing the site on your own. All of the normal Jekyll commands are
available to you, but you should prefix them with `bundle exec` so that Bundler
runs the version of Jekyll that is installed in your project folder.
## Commit to Source Control
If you're storing your new site in version control, you'll want to ignore the
`./vendor/` and `./.bundle/` folders since they contain user- or
platform-specific information. New users will be able to install the correct
dependencies based on `Gemfile` and `Gemfile.lock`, which should both be checked
in. You can use this `.gitigonre` to get started, if you want.
**.gitignore**
```
# Ignore folders generated by Bundler
vendor
.bundle
# Ignore folders generated by Jekyll
.sass-cache
_site
```

View File

@@ -1 +1 @@
3.8.4
3.7.2

View File

@@ -1,47 +0,0 @@
---
layout: page
title: The Jekyll Team
---
## Core Team
*The Jekyll Core Team's responsibility is to ensure the development and
community around the Jekyll ecosystem thrive.*
1. Olivia (@oe, Lead Developer)
2. Frank (@DirtyF, Documentation)
3. Pat (@pathawks)
4. Matt (@mattr-)
## Plugin Core
*The Jekyll Plugin Core Team's responsibility is to ensure the development and
community around the core plugins thrive. They also provide guidance in
conversations about extensibility of Core Jekyll.*
1. Ashwin (@ashmaroli)
2. Florian (@Crunch09)
3. Mert (@mertkahyaoglu, jekyll-admin)
4. Alfred Xing (@alfredxing)
## Affinity Team Captains
*The Affinity Team Captains lead [Jekyll's Affinity
Teams](https://teams.jekyllrb.com/). Each team is tasked with maintaining
and addressing issues for a specific aspect of Jekyll.*
1. [Build](https://github.com/orgs/jekyll/teams/build): @mattr-
2. [Documentation](https://github.com/orgs/jekyll/teams/documentation): @DirtyF, @mattr-
3. [Ecosystem](https://github.com/orgs/jekyll/teams/ecosystem): @pathawks
4. [Performance](https://github.com/orgs/jekyll/teams/performance): @mattr-, @parkr
5. [Stability](https://github.com/orgs/jekyll/teams/stability): @oe, @parkr
6. [Windows](https://github.com/orgs/jekyll/teams/windows): @XhmikosR
## Emeritus Core Team Members
*Emeritus Core Team Members were once members of Jekyll's Core Team.*
1. Parker (@parkr)
2. Tom (@mojombo)
3. Nick (@qrush)
4. Alfred (@alfredxing)

View File

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

View File

@@ -159,127 +159,3 @@ Feature: Collections Directory
And I should see exactly "Nested Static content." in "_site/puppies/nested/static_file.txt"
And the _site/gathering directory should not exist
And the _site/_posts directory should not exist
Scenario: Rendered collection with a document that includes a relative document
Given I have a _puppies directory
And I have the following documents under the puppies collection:
| title | date | content |
| INTRO | 2007-12-31 | excerpt for all docs. |
| Rover | 2007-12-31 | {% include_relative intro.md %} |
And I have a _posts directory
And I have the following post:
| title | date | content |
| Gathered Post | 2009-03-27 | Random Content. |
And I have a "_config.yml" file with content:
"""
collections:
puppies:
output: true
"""
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And the "_site/puppies/rover.html" file should exist
And I should see "excerpt for all docs." in "_site/puppies/rover.html"
And I should see "Random Content." in "_site/2009/03/27/gathered-post.html"
Scenario: Rendered collection in custom collections_dir with a document that includes a relative document
Given I have a collections/_puppies directory
And I have the following documents under the "puppies" collection within the "collections" directory:
| title | date | content |
| INTRO | 2007-12-31 | excerpt for all docs. |
| Rover | 2007-12-31 | {% include_relative intro.md %} |
And I have a collections/_posts directory
And I have the following post within the "collections" directory:
| title | date | content |
| Gathered Post | 2009-03-27 | Random Content. |
And I have a "_config.yml" file with content:
"""
collections:
puppies:
output: true
collections_dir: collections
"""
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And the "_site/puppies/rover.html" file should exist
And I should see "excerpt for all docs." in "_site/puppies/rover.html"
And I should see "Random Content." in "_site/2009/03/27/gathered-post.html"
Scenario: Front matter defaults and custom collections directory
Given I have a gathering/_players/managers directory
And I have a gathering/_players/recruits directory
And I have a gathering/_players/standby directory
And I have the following documents nested inside "managers" directory under the "players" collection within the "gathering" directory:
| title | content |
| Tony Stark | content for Tony. |
| Steve Rogers | content for Steve. |
And I have the following documents nested inside "recruits" directory under the "players" collection within the "gathering" directory:
| title | content |
| Peter Parker | content for Peter. |
| Wanda Maximoff | content for Wanda. |
And I have the following documents nested inside "standby" directory under the "players" collection within the "gathering" directory:
| title | content |
| Thanos | content for Thanos. |
| Loki | content for Loki. |
And I have a "_config.yml" file with content:
"""
collections_dir: gathering
collections: ["players"]
defaults:
- scope:
path: ""
type: players
values:
recruit: false
manager: false
villain: false
- scope:
path: gathering/_players/standby/thanos.md
type: players
values:
villain: true
- scope:
path: gathering/_players/managers/*
type: players
values:
manager: true
- scope:
path: gathering/_players/recruits/*
type: players
values:
recruit: true
"""
And I have a "index.md" file with content:
"""
---
---
{% for player in site.players %}
<p>{{ player.title }}: Manager: {{ player.manager }}</p>
<p>{{ player.title }}: Recruit: {{ player.recruit }}</p>
<p>{{ player.title }}: Villain: {{ player.villain }}</p>
{% endfor %}
"""
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p>Tony Stark: Manager: true</p>" in "_site/index.html"
And I should see "<p>Tony Stark: Recruit: false</p>" in "_site/index.html"
And I should see "<p>Tony Stark: Villain: false</p>" in "_site/index.html"
And I should see "<p>Peter Parker: Manager: false</p>" in "_site/index.html"
And I should see "<p>Peter Parker: Recruit: true</p>" in "_site/index.html"
And I should see "<p>Peter Parker: Villain: false</p>" in "_site/index.html"
And I should see "<p>Steve Rogers: Manager: true</p>" in "_site/index.html"
And I should see "<p>Steve Rogers: Recruit: false</p>" in "_site/index.html"
And I should see "<p>Steve Rogers: Villain: false</p>" in "_site/index.html"
And I should see "<p>Wanda Maximoff: Manager: false</p>" in "_site/index.html"
And I should see "<p>Wanda Maximoff: Recruit: true</p>" in "_site/index.html"
And I should see "<p>Wanda Maximoff: Villain: false</p>" in "_site/index.html"
And I should see "<p>Thanos: Manager: false</p>" in "_site/index.html"
And I should see "<p>Thanos: Recruit: false</p>" in "_site/index.html"
And I should see "<p>Thanos: Villain: true</p>" in "_site/index.html"
And I should see "<p>Loki: Manager: false</p>" in "_site/index.html"
And I should see "<p>Loki: Recruit: false</p>" in "_site/index.html"
And I should see "<p>Loki: Villain: false</p>" in "_site/index.html"

View File

@@ -104,28 +104,3 @@ Feature: Include tags
Then I should get a zero exit status
And the _site directory should exist
And I should see "include" in "_site/index.html"
Scenario: Include a file-path with non-alphanumeric character sequences
Given I have an _includes directory
And I have an "_includes/header-en.html" file that contains "include"
And I have an "index.html" page that contains "{% include ./header-en.html %}"
When I run jekyll build
Then I should get a non-zero exit status
And I should see "Invalid syntax for include tag." in the build output
When I have an "index.html" page that contains "{% include foo/.header-en.html %}"
When I run jekyll build
Then I should get a non-zero exit status
And I should see "Invalid syntax for include tag." in the build output
When I have an "index.html" page that contains "{% include //header-en.html %}"
When I run jekyll build
Then I should get a non-zero exit status
And I should see "Invalid syntax for include tag." in the build output
When I have an "index.html" page that contains "{% include ..header-en.html %}"
When I run jekyll build
Then I should get a non-zero exit status
And I should see "Invalid syntax for include tag." in the build output
When I have an "index.html" page that contains "{% include header-en.html %}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "include" in "_site/index.html"

View File

@@ -1,78 +0,0 @@
Feature: Link Tag
As a hacker who likes to write a variety of content
I want to be able to link to pages and documents
And render them without much hassle
Scenario: Basic site with two pages
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page that contains "[Home]({% link index.md %})"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p><a href=\"/about.html\">About my projects</a></p>" in "_site/index.html"
And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about.html"
Scenario: Basic site with custom page-permalinks
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page with permalink "/about/" that contains "[Home]({% link index.md %})"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p><a href=\"/about/\">About my projects</a></p>" in "_site/index.html"
And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about/index.html"
Scenario: Basic site with custom site-wide-permalinks
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page that contains "[Home]({% link index.md %})"
And I have a configuration file with "permalink" set to "pretty"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p><a href=\"/about/\">About my projects</a></p>" in "_site/index.html"
And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about/index.html"
Scenario: Basic site with two pages and custom baseurl
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page that contains "[Home]({% link index.md %})"
And I have a configuration file with "baseurl" set to "/blog"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p><a href=\"/about.html\">About my projects</a></p>" in "_site/index.html"
And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about.html"
Scenario: Basic site with two pages and custom baseurl and permalinks
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page that contains "[Home]({% link index.md %})"
And I have a "_config.yml" file with content:
"""
baseurl: /blog
permalink: pretty
"""
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p><a href=\"/about/\">About my projects</a></p>" in "_site/index.html"
And I should see "<p><a href=\"/\">Home</a></p>" in "_site/about/index.html"
Scenario: Linking to a ghost file
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page that contains "[Contact]({% link contact.md %})"
When I run jekyll build
Then I should get a non-zero exit status
And the _site directory should not exist
And I should see "Could not find document 'contact.md' in tag 'link'" in the build output
Scenario: Complex site with a variety of files
Given I have an "index.md" page that contains "[About my projects]({% link about.md %})"
And I have an "about.md" page that contains "[Latest Hack]({% link _posts/2018-02-15-metaprogramming.md %})"
And I have a _posts directory
And I have an "_posts/2018-02-15-metaprogramming.md" page that contains "[Download This]({% link script.txt %})"
And I have a "script.txt" file that contains "Static Alert!"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p><a href=\"/about.html\">About my projects</a></p>" in "_site/index.html"
And I should see "<p><a href=\"/2018/02/15/metaprogramming.html\">Latest Hack</a></p>" in "_site/about.html"
And I should see "<p><a href=\"/script.txt\">Download This</a></p>" in "_site/2018/02/15/metaprogramming.html"
And I should see "Static Alert!" in "_site/script.txt"

View File

@@ -34,25 +34,6 @@ Feature: Post excerpts
And I should see exactly "<p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
Scenario: An excerpt with Liquid constructs from a post with a layout
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a configuration file with "baseurl" set to "/blog"
And I have a _posts directory
And I have a _layouts directory
And I have a post layout that contains "{{ page.excerpt }}"
And I have the following posts:
| title | date | layout | content |
| entry1 | 2007-12-31 | post | {{ 'assets/style.css' \| relative_url }} |
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And the _site/2007 directory should exist
And the _site/2007/12 directory should exist
And the _site/2007/12/31 directory should exist
And the "_site/2007/12/31/entry1.html" file should exist
And I should see exactly "<p>/blog/assets/style.css</p>" in "_site/2007/12/31/entry1.html"
And I should see exactly "<p>/blog/assets/style.css</p>" in "_site/index.html"
Scenario: An excerpt from a post with a layout which has context
Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
And I have a _posts directory

View File

@@ -30,50 +30,6 @@ Feature: Rendering
Then I should get a non-zero exit-status
And I should see "Liquid Exception: Liquid error \(.+/_includes/invalid\.html line 1\): wrong number of arguments (\(given 1, expected 2\)|\(1 for 2\)) included in index\.html" in the build output
Scenario: Rendering a default site containing a file with rogue Liquid constructs
Given I have a "index.html" page with title "Simple Test" that contains "{{ page.title | foobar }}\n\n{{ page.author }}"
When I run jekyll build
Then I should get a zero exit-status
And I should not see "Liquid Exception:" in the build output
Scenario: Rendering a custom site containing a file with a non-existent Liquid variable
Given I have a "index.html" file with content:
"""
---
title: Simple Test
---
{{ page.title }}
{{ page.author }}
"""
And I have a "_config.yml" file with content:
"""
liquid:
strict_variables: true
"""
When I run jekyll build
Then I should get a non-zero exit-status
And I should see "Liquid error \(line 3\): undefined variable author in index.html" in the build output
Scenario: Rendering a custom site containing a file with a non-existent Liquid filter
Given I have a "index.html" file with content:
"""
---
author: John Doe
---
{{ page.title }}
{{ page.author | foobar }}
"""
And I have a "_config.yml" file with content:
"""
liquid:
strict_filters: true
"""
When I run jekyll build
Then I should get a non-zero exit-status
And I should see "Liquid error \(line 3\): undefined filter foobar in index.html" in the build output
Scenario: Render Liquid and place in layout
Given I have a "index.html" page with layout "simple" that contains "Hi there, Jekyll {{ jekyll.environment }}!"
And I have a simple layout that contains "{{ content }}Ahoy, indeed!"

View File

@@ -36,7 +36,7 @@ end
Given(%r!^I have an? "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$!) do |file, key, value, text|
File.write(file, Jekyll::Utils.strip_heredoc(<<-DATA))
---
#{key || "layout"}: #{value || "none"}
#{key || "layout"}: #{value || "nil"}
---
#{text}
@@ -135,16 +135,6 @@ end
#
Given(%r!^I have the following documents? nested inside "(.*)" directory under the "(.*)" collection within the "(.*)" directory:$!) do |subdir, label, dir, table|
table.hashes.each do |input_hash|
title = slug(input_hash["title"])
path = File.join(dir, "_#{label}", subdir, "#{title}.md")
File.write(path, file_content_from_hash(input_hash))
end
end
#
Given(%r!^I have a configuration file with "(.*)" set to "(.*)"$!) do |key, value|
config = \
if source_dir.join("_config.yml").exist?

View File

@@ -18,6 +18,7 @@ end
require "rubygems"
# stdlib
require "pathutil"
require "forwardable"
require "fileutils"
require "time"
@@ -25,12 +26,8 @@ require "English"
require "pathname"
require "logger"
require "set"
require "csv"
require "json"
# 3rd party
require "pathutil"
require "addressable/uri"
require "safe_yaml/load"
require "liquid"
require "kramdown"

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "set"
module Jekyll
# Handles the cleanup of a site's destination before it is built.
class Cleaner
@@ -55,9 +57,9 @@ module Jekyll
#
# Returns a Set with the file paths
def new_files
@new_files ||= Set.new.tap do |files|
site.each_site_file { |item| files << item.destination(site.dest) }
end
files = Set.new
site.each_site_file { |item| files << item.destination(site.dest) }
files
end
# Private: The list of directories to be created when site is built.
@@ -65,7 +67,7 @@ module Jekyll
#
# Returns a Set with the directory paths
def new_dirs
@new_dirs ||= new_files.map { |file| parent_dirs(file) }.flatten.to_set
new_files.map { |file| parent_dirs(file) }.flatten.to_set
end
# Private: The list of parent directories of a given file

View File

@@ -210,10 +210,12 @@ module Jekyll
private
def read_document(full_path)
doc = Document.new(full_path, :site => site, :collection => self)
doc = Jekyll::Document.new(full_path, :site => site, :collection => self)
doc.read
if site.unpublished || doc.published?
if site.publisher.publish?(doc) || !write?
docs << doc
else
Jekyll.logger.debug "Skipped Publishing:", doc.relative_path
end
end

View File

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

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "addressable/uri"
module Jekyll
module Commands
class Doctor < Command
@@ -39,22 +41,9 @@ module Jekyll
!conflicting_urls(site),
!urls_only_differ_by_case(site),
proper_site_url?(site),
properly_gathered_posts?(site),
].all?
end
def properly_gathered_posts?(site)
return true if site.config["collections_dir"].empty?
posts_at_root = site.in_source_dir("_posts")
return true unless File.directory?(posts_at_root)
Jekyll.logger.warn "Warning:",
"Detected '_posts' directory outside custom `collections_dir`!"
Jekyll.logger.warn "",
"Please move '#{posts_at_root}' into the custom directory at " \
"'#{site.in_source_dir(site.config["collections_dir"])}'"
false
end
def deprecated_relative_permalinks(site)
if site.config["relative_permalinks"]
Jekyll::Deprecator.deprecation_message "Your site still uses relative" \

View File

@@ -27,9 +27,8 @@ module Jekyll
new_blog_path = File.expand_path(args.join(" "), Dir.pwd)
FileUtils.mkdir_p new_blog_path
if preserve_source_location?(new_blog_path, options)
Jekyll.logger.error "Conflict:", "#{new_blog_path} exists and is not empty."
Jekyll.logger.abort_with "", "Ensure #{new_blog_path} is empty or else " \
"try again with `--force` to proceed and overwrite any files."
Jekyll.logger.abort_with "Conflict:",
"#{new_blog_path} exists and is not empty."
end
if options["blank"]
@@ -88,10 +87,14 @@ group :jekyll_plugins do
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
RUBY
end

View File

@@ -70,7 +70,7 @@ module Jekyll
cmd.action do |_, opts|
opts["livereload_port"] ||= LIVERELOAD_PORT
opts["serving"] = true
opts["watch"] = true unless opts.key?("watch")
opts["watch" ] = true unless opts.key?("watch")
start(opts)
end
@@ -173,7 +173,6 @@ module Jekyll
@changed_pages = nil
end
end
# rubocop:enable Metrics/AbcSize
# Do a base pre-setup of WEBRick so that everything is in place
# when we get ready to party, checking for an setting up an error page
@@ -337,7 +336,7 @@ module Jekyll
require "webrick/https"
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(read_file(src, cert))
opts[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(read_file(src, key))
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(read_file(src, key))
opts[:SSLEnable] = true
end

View File

@@ -1,5 +1,6 @@
# frozen_string_literal: true
require "json"
require "em-websocket"
require_relative "websockets"
@@ -30,11 +31,11 @@ module Jekyll
EM.reactor_running?
end
def handle_websockets_event(websocket)
websocket.onopen { |handshake| connect(websocket, handshake) }
websocket.onclose { disconnect(websocket) }
websocket.onmessage { |msg| print_message(msg) }
websocket.onerror { |error| log_error(error) }
def handle_websockets_event(ws)
ws.onopen { |handshake| connect(ws, handshake) }
ws.onclose { disconnect(ws) }
ws.onmessage { |msg| print_message(msg) }
ws.onerror { |error| log_error(error) }
end
def start(opts)
@@ -81,14 +82,14 @@ module Jekyll
end
private
def connect(websocket, handshake)
def connect(ws, handshake)
@connections_count += 1
if @connections_count == 1
message = "Browser connected"
message += " over SSL/TLS" if handshake.secure?
Jekyll.logger.info "LiveReload:", message
end
websocket.send(
ws.send(
JSON.dump(
:command => "hello",
:protocols => ["http://livereload.com/protocols/official-7"],
@@ -96,12 +97,12 @@ module Jekyll
)
)
@websockets << websocket
@websockets << ws
end
private
def disconnect(websocket)
@websockets.delete(websocket)
def disconnect(ws)
@websockets.delete(ws)
end
private
@@ -115,10 +116,10 @@ module Jekyll
end
private
def log_error(error)
def log_error(e)
Jekyll.logger.error "LiveReload experienced an error. " \
"Run with --trace for more information."
raise error
raise e
end
end
end

View File

@@ -88,7 +88,6 @@ module Jekyll
end
@new_body = @new_body.join
end
# rubocop:enable Metrics/MethodLength
def template
# Unclear what "snipver" does. Doc at
@@ -176,7 +175,6 @@ module Jekyll
res.header.merge!(@headers)
rtn
end
# rubocop:enable Naming/MethodName
#

View File

@@ -74,7 +74,6 @@ module Jekyll
close_connection_after_writing
end
end
# rubocop:enable Metrics/MethodLength
end
end
end

View File

@@ -61,9 +61,7 @@ module Jekyll
"defaults" => [],
"liquid" => {
"error_mode" => "warn",
"strict_filters" => false,
"strict_variables" => false,
"error_mode" => "warn",
},
"rdiscount" => {

View File

@@ -14,6 +14,9 @@ module Jekyll
}.freeze
def initialize(config)
unless defined?(Kramdown)
Jekyll::External.require_with_graceful_fail "kramdown"
end
@main_fallback_highlighter = config["highlighter"] || "rouge"
@config = config["kramdown"] || {}
@highlighter = nil
@@ -47,12 +50,14 @@ module Jekyll
end
private
# rubocop:disable Performance/HashEachMethods
def make_accessible(hash = @config)
hash.keys.each do |key|
hash[key.to_sym] = hash[key]
make_accessible(hash[key]) if hash[key].is_a?(Hash)
end
end
# rubocop:enable Performance/HashEachMethods
# config[kramdown][syntax_higlighter] >
# config[kramdown][enable_coderay] >

View File

@@ -22,9 +22,9 @@ module Jekyll
end
private
def replace_generated_toc(rd_instance, html, toc_token)
if rd_instance.generate_toc && html.include?(toc_token)
utf8_toc = rd_instance.toc_content
def replace_generated_toc(rd, html, toc_token)
if rd.generate_toc && html.include?(toc_token)
utf8_toc = rd.toc_content
utf8_toc.force_encoding("utf-8") if utf8_toc.respond_to?(:force_encoding)
html.gsub(toc_token, utf8_toc)
else

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "set"
# Convertible provides methods for converting a pagelike item
# from a certain type of markup into actual content
#
@@ -107,6 +109,7 @@ module Jekyll
def render_liquid(content, payload, info, path)
_renderer.render_liquid(content, payload, info, path)
end
# rubocop: enable RescueException
# Convert this Convertible's data to a Hash suitable for use by Liquid.
#
@@ -162,9 +165,9 @@ module Jekyll
# Determine whether the file should be rendered with Liquid.
#
# Returns true if the file has Liquid Tags or Variables, false otherwise.
# Always returns true.
def render_with_liquid?
Jekyll::Utils.has_liquid_construct?(content)
true
end
# Determine whether the file should be placed into layouts.
@@ -224,7 +227,6 @@ module Jekyll
def write(dest)
path = destination(dest)
FileUtils.mkdir_p(File.dirname(path))
Jekyll.logger.debug "Writing:", path
File.write(path, output, :mode => "wb")
Jekyll::Hooks.trigger hook_owner, :post_write, self
end

View File

@@ -83,14 +83,15 @@ module Jekyll
# Returns a String path which represents the relative path from the collections_dir
# to this document.
def relative_path
@relative_path ||= path.sub("#{site.collections_path}/", "")
@relative_path ||=
Pathutil.new(path).relative_path_from(site.collections_path).to_s
end
# The output extension of the document.
#
# Returns the output extension
def output_ext
@output_ext ||= Jekyll::Renderer.new(site, self).output_ext
Jekyll::Renderer.new(site, self).output_ext
end
# The base filename of the document, without the file extname.
@@ -156,10 +157,9 @@ module Jekyll
# Determine whether the file should be rendered with Liquid.
#
# Returns false if the document is either an asset file or a yaml file,
# or if the document doesn't contain any Liquid Tags or Variables,
# true otherwise.
def render_with_liquid?
!(coffeescript_file? || yaml_file? || !Utils.has_liquid_construct?(content))
!(coffeescript_file? || yaml_file?)
end
# Determine whether the file should be rendered with a layout.
@@ -239,7 +239,6 @@ module Jekyll
def write(dest)
path = destination(dest)
FileUtils.mkdir_p(File.dirname(path))
Jekyll.logger.debug "Writing:", path
File.write(path, output, :mode => "wb")
trigger_hooks(:post_write)
@@ -312,10 +311,9 @@ module Jekyll
# Based on the Collection to which it belongs.
#
# True if the document has a collection and if that collection's #write?
# method returns true, and if the site's Publisher will publish the document.
# False otherwise.
# method returns true, otherwise false.
def write?
collection && collection.write? && site.publisher.publish?(self)
collection && collection.write?
end
# The Document excerpt_separator, from the YAML Front-Matter or site
@@ -360,7 +358,7 @@ module Jekyll
#
# Returns an Array of related Posts.
def related_posts
@related_posts ||= Jekyll::RelatedPosts.new(self).build
Jekyll::RelatedPosts.new(self).build
end
# Override of normal respond_to? to match method_missing's logic for
@@ -419,7 +417,7 @@ module Jekyll
def merge_categories!(other)
if other.key?("categories") && !other["categories"].nil?
if other["categories"].is_a?(String)
other["categories"] = other["categories"].split
other["categories"] = other["categories"].split(%r!\s+!).map(&:strip)
end
other["categories"] = (data["categories"] || []) | other["categories"]
end

View File

@@ -11,11 +11,12 @@ module Jekyll
def_delegators :@obj, :label, :docs, :files, :directory,
:relative_directory
private def_delegator :@obj, :metadata, :fallback_data
def to_s
docs.to_s
end
private
def_delegator :@obj, :metadata, :fallback_data
end
end
end

View File

@@ -14,8 +14,6 @@ module Jekyll
def_delegator :@obj, :relative_path, :path
def_delegators :@obj, :id, :output, :content, :to_s, :relative_path, :url
private def_delegator :@obj, :data, :fallback_data
def collection
@obj.collection.label
end
@@ -63,6 +61,9 @@ module Jekyll
result[key] = doc[key] unless NESTED_OBJECT_FIELD_BLACKLIST.include?(key)
end
end
private
def_delegator :@obj, :data, :fallback_data
end
end
end

View File

@@ -137,6 +137,7 @@ module Jekyll
#
# Returns a pretty generation of the hash representation of the Drop.
def inspect
require "json"
JSON.pretty_generate to_h
end
@@ -154,6 +155,7 @@ module Jekyll
#
# Returns a JSON representation of the Drop in a String.
def to_json(state = nil)
require "json"
JSON.generate(hash_for_json(state), state)
end

View File

@@ -25,6 +25,7 @@ module Jekyll
end
def to_json(state = nil)
require "json"
JSON.generate(to_h, state)
end
end

View File

@@ -11,8 +11,6 @@ module Jekyll
def_delegators :@obj, :time, :pages, :static_files, :documents,
:tags, :categories
private def_delegator :@obj, :config, :fallback_data
def [](key)
if @obj.collections.key?(key) && key != "posts"
@obj.collections[key].docs
@@ -39,18 +37,11 @@ module Jekyll
@site_collections ||= @obj.collections.values.sort_by(&:label).map(&:to_liquid)
end
# `{{ site.related_posts }}` is how posts can get posts related to
# them, either through LSI if it's enabled, or through the most
# recent posts.
# We should remove this in 4.0 and switch to `{{ post.related_posts }}`.
def related_posts
return nil unless @current_document.is_a?(Jekyll::Document)
@current_document.related_posts
end
attr_writer :current_document
# return nil for `{{ site.config }}` even if --config was passed via CLI
def config; end
private
def_delegator :@obj, :config, :fallback_data
end
end
end

View File

@@ -6,9 +6,8 @@ module Jekyll
extend Forwardable
def_delegators :@obj, :name, :extname, :modified_time, :basename
def_delegator :@obj, :relative_path, :path
def_delegator :@obj, :data, :fallback_data
def_delegator :@obj, :type, :collection
private def_delegator :@obj, :data, :fallback_data
end
end
end

View File

@@ -89,8 +89,8 @@ module Jekyll
# Check if an entry matches a specific pattern and return true,false.
# Returns true if path matches against any glob pattern.
# --
def glob_include?(enum, entry)
entry_path = Pathutil.new(site.in_source_dir).join(entry)
def glob_include?(enum, e)
entry = Pathutil.new(site.in_source_dir).join(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,
@@ -98,7 +98,7 @@ module Jekyll
# on them at this point.
if exp.is_a?(Regexp)
entry_path =~ exp
entry =~ exp
else
item = Pathutil.new(site.in_source_dir).join(exp)
@@ -108,14 +108,14 @@ module Jekyll
# see if the entry falls within that path and
# exclude it if that's the case.
if entry.end_with?("/")
entry_path.in_path?(
if e.end_with?("/")
entry.in_path?(
item
)
else
File.fnmatch?(item, entry_path) ||
entry_path.to_path.start_with?(
File.fnmatch?(item, entry) ||
entry.to_path.start_with?(
item
)
end

View File

@@ -8,13 +8,10 @@ module Jekyll
attr_accessor :content, :ext
attr_writer :output
def_delegators :@doc, :site, :name, :ext, :extname,
:collection, :related_posts,
:coffeescript_file?, :yaml_file?,
def_delegators :@doc, :site, :name, :ext, :relative_path, :extname,
:render_with_liquid?, :collection, :related_posts,
:url, :next_doc, :previous_doc
private :coffeescript_file?, :yaml_file?
# Initialize this Excerpt instance.
#
# doc - The Document.
@@ -44,13 +41,6 @@ module Jekyll
File.join(doc.path, "#excerpt")
end
# 'Relative Path' of the excerpt.
#
# Returns the relative_path for the doc this excerpt belongs to with #excerpt appended
def relative_path
File.join(doc.relative_path, "#excerpt")
end
# Check if excerpt includes a string
#
# Returns true if the string passed in
@@ -87,10 +77,6 @@ module Jekyll
false
end
def render_with_liquid?
!(coffeescript_file? || yaml_file? || !Utils.has_liquid_construct?(content))
end
protected
# Internal: Extract excerpt from the content
@@ -127,52 +113,14 @@ module Jekyll
# Excerpts are rendered same time as content is rendered.
#
# Returns excerpt String
LIQUID_TAG_REGEX = %r!{%-?\s*(\w+).+\s*-?%}!m
MKDWN_LINK_REF_REGEX = %r!^ {0,3}\[[^\]]+\]:.+$!
def extract_excerpt(doc_content)
head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)
# append appropriate closing tag (to a Liquid block), to the "head" if the
# partitioning resulted in leaving the closing tag somewhere in the "tail"
# partition.
if head.include?("{%")
head =~ LIQUID_TAG_REGEX
tag_name = Regexp.last_match(1)
if liquid_block?(tag_name) && head.match(%r!{%-?\s*end#{tag_name}\s*-?%}!).nil?
print_build_warning
head << "\n{% end#{tag_name} %}"
end
end
if tail.empty?
head
else
head.to_s.dup << "\n\n" << tail.scan(MKDWN_LINK_REF_REGEX).join("\n")
head.to_s.dup << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
end
end
private
def liquid_block?(tag_name)
Liquid::Template.tags[tag_name].superclass == Liquid::Block
rescue NoMethodError
Jekyll.logger.error "Error:",
"A Liquid tag in the excerpt of #{doc.relative_path} couldn't be " \
"parsed."
raise
end
def print_build_warning
Jekyll.logger.warn "Warning:", "Excerpt modified in #{doc.relative_path}!"
Jekyll.logger.warn "",
"Found a Liquid block containing separator '#{doc.excerpt_separator}' and has " \
"been modified with the appropriate closing tag."
Jekyll.logger.warn "",
"Feel free to define a custom excerpt or excerpt_separator in the document's " \
"Front Matter if the generated excerpt is unsatisfactory."
end
end
end

View File

@@ -1,12 +1,16 @@
# frozen_string_literal: true
require "addressable/uri"
require "json"
require "date"
require "liquid"
require_all "jekyll/filters"
module Jekyll
module Filters
include URLFilters
include GroupingFilters
include DateFilters
# Convert a Markdown string into HTML output.
#
@@ -14,9 +18,9 @@ module Jekyll
#
# Returns the HTML formatted String.
def markdownify(input)
@context.registers[:site].find_converter_instance(
Jekyll::Converters::Markdown
).convert(input.to_s)
site = @context.registers[:site]
converter = site.find_converter_instance(Jekyll::Converters::Markdown)
converter.convert(input.to_s)
end
# Convert quotes into smart quotes.
@@ -25,9 +29,9 @@ module Jekyll
#
# Returns the smart-quotified String.
def smartify(input)
@context.registers[:site].find_converter_instance(
Jekyll::Converters::SmartyPants
).convert(input.to_s)
site = @context.registers[:site]
converter = site.find_converter_instance(Jekyll::Converters::SmartyPants)
converter.convert(input.to_s)
end
# Convert a Sass string into CSS output.
@@ -36,9 +40,9 @@ module Jekyll
#
# Returns the CSS formatted String.
def sassify(input)
@context.registers[:site].find_converter_instance(
Jekyll::Converters::Sass
).convert(input)
site = @context.registers[:site]
converter = site.find_converter_instance(Jekyll::Converters::Sass)
converter.convert(input)
end
# Convert a Scss string into CSS output.
@@ -47,9 +51,9 @@ module Jekyll
#
# Returns the CSS formatted String.
def scssify(input)
@context.registers[:site].find_converter_instance(
Jekyll::Converters::Scss
).convert(input)
site = @context.registers[:site]
converter = site.find_converter_instance(Jekyll::Converters::Scss)
converter.convert(input)
end
# Slugify a filename or title.
@@ -63,6 +67,55 @@ module Jekyll
Utils.slugify(input, :mode => mode)
end
# Format a date in short format e.g. "27 Jan 2011".
#
# date - the Time to format.
#
# Returns the formatting String.
def date_to_string(date)
time(date).strftime("%d %b %Y")
end
# Format a date in long format e.g. "27 January 2011".
#
# date - The Time to format.
#
# Returns the formatted String.
def date_to_long_string(date)
return date if date.to_s.empty?
time(date).strftime("%d %B %Y")
end
# Format a date for use in XML.
#
# date - The Time to format.
#
# Examples
#
# date_to_xmlschema(Time.now)
# # => "2011-04-24T20:34:46+08:00"
#
# Returns the formatted String.
def date_to_xmlschema(date)
return date if date.to_s.empty?
time(date).xmlschema
end
# Format a date according to RFC-822
#
# date - The Time to format.
#
# Examples
#
# date_to_rfc822(Time.now)
# # => "Sun, 24 Apr 2011 12:34:46 +0000"
#
# Returns the formatted String.
def date_to_rfc822(date)
return date if date.to_s.empty?
time(date).rfc822
end
# XML escape a string for use. Replaces any special characters with
# appropriate HTML entity replacements.
#
@@ -167,23 +220,11 @@ module Jekyll
#
# Returns the filtered array of objects
def where(input, property, value)
return input if property.nil? || value.nil?
return input unless input.respond_to?(:select)
input = input.values if input.is_a?(Hash)
input_id = input.hash
# implement a hash based on method parameters to cache the end-result
# for given parameters.
@where_filter_cache ||= {}
@where_filter_cache[input_id] ||= {}
@where_filter_cache[input_id][property] ||= {}
# stash or retrive results to return
@where_filter_cache[input_id][property][value] ||= begin
input.select do |object|
Array(item_property(object, property)).map!(&:to_s).include?(value.to_s)
end || []
end
input = input.values if input.is_a?(Hash)
input.select do |object|
Array(item_property(object, property)).map(&:to_s).include?(value.to_s)
end || []
end
# Filters an array of objects against an expression
@@ -316,6 +357,16 @@ module Jekyll
.map!(&:last)
end
private
def time(input)
date = Liquid::Utils.to_date(input)
unless date.respond_to?(:to_time)
raise Errors::InvalidDateError,
"Invalid Date: '#{input.inspect}' is not a valid datetime."
end
date.to_time.dup.localtime
end
private
def item_property(item, property)
if item.respond_to?(:to_liquid)

View File

@@ -1,107 +0,0 @@
# frozen_string_literal: true
module Jekyll
module Filters
module DateFilters
# Format a date in short format e.g. "27 Jan 2011".
# Ordinal format is also supported, in both the UK
# (e.g. "27th Jan 2011") and US ("e.g. Jan 27th, 2011") formats.
# UK format is the default.
#
# date - the Time to format.
# type - if "ordinal" the returned String will be in ordinal format
# style - if "US" the returned String will be in US format.
# Otherwise it will be in UK format.
#
# Returns the formatting String.
def date_to_string(date, type = nil, style = nil)
stringify_date(date, "%b", type, style)
end
# Format a date in long format e.g. "27 January 2011".
# Ordinal format is also supported, in both the UK
# (e.g. "27th January 2011") and US ("e.g. January 27th, 2011") formats.
# UK format is the default.
#
# date - the Time to format.
# type - if "ordinal" the returned String will be in ordinal format
# style - if "US" the returned String will be in US format.
# Otherwise it will be in UK format.
#
# Returns the formatted String.
def date_to_long_string(date, type = nil, style = nil)
stringify_date(date, "%B", type, style)
end
# Format a date for use in XML.
#
# date - The Time to format.
#
# Examples
#
# date_to_xmlschema(Time.now)
# # => "2011-04-24T20:34:46+08:00"
#
# Returns the formatted String.
def date_to_xmlschema(date)
return date if date.to_s.empty?
time(date).xmlschema
end
# Format a date according to RFC-822
#
# date - The Time to format.
#
# Examples
#
# date_to_rfc822(Time.now)
# # => "Sun, 24 Apr 2011 12:34:46 +0000"
#
# Returns the formatted String.
def date_to_rfc822(date)
return date if date.to_s.empty?
time(date).rfc822
end
private
# month_type: Notations that evaluate to 'Month' via `Time#strftime` ("%b", "%B")
# type: nil (default) or "ordinal"
# style: nil (default) or "US"
#
# Returns a stringified date or the empty input.
def stringify_date(date, month_type, type = nil, style = nil)
return date if date.to_s.empty?
time = time(date)
if type == "ordinal"
day = time.day
ordinal_day = "#{day}#{ordinal(day)}"
return time.strftime("#{month_type} #{ordinal_day}, %Y") if style == "US"
return time.strftime("#{ordinal_day} #{month_type} %Y")
end
time.strftime("%d #{month_type} %Y")
end
private
def ordinal(number)
return "th" if (11..13).cover?(number)
case number % 10
when 1 then "st"
when 2 then "nd"
when 3 then "rd"
else "th"
end
end
private
def time(input)
date = Liquid::Utils.to_date(input)
unless date.respond_to?(:to_time)
raise Errors::InvalidDateError,
"Invalid Date: '#{input.inspect}' is not a valid datetime."
end
date.to_time.dup.localtime
end
end
end
end

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "addressable/uri"
module Jekyll
module Filters
module URLFilters

View File

@@ -108,14 +108,13 @@ module Jekyll
if scope["path"].to_s.include?("*")
Dir.glob(abs_scope_path).each do |scope_path|
scope_path = Pathname.new(scope_path).relative_path_from(site_path)
scope_path = strip_collections_dir(scope_path)
scope_path = Pathname.new(scope_path).relative_path_from site_path
Jekyll.logger.debug "Globbed Scope Path:", scope_path
return true if path_is_subpath?(sanitized_path, scope_path)
end
false
else
path_is_subpath?(sanitized_path, strip_collections_dir(rel_scope_path))
path_is_subpath?(sanitized_path, rel_scope_path)
end
end
# rubocop:enable Metrics/AbcSize
@@ -130,13 +129,6 @@ module Jekyll
false
end
def strip_collections_dir(path)
collections_dir = @site.config["collections_dir"]
slashed_coll_dir = "#{collections_dir}/"
return path if collections_dir.empty? || !path.to_s.start_with?(slashed_coll_dir)
path.sub(slashed_coll_dir, "")
end
# Determines whether the scope applies to type.
# The scope applies to the type if:
# 1. no 'type' is specified
@@ -215,14 +207,11 @@ module Jekyll
end
# Sanitizes the given path by removing a leading and adding a trailing slash
SANITIZATION_REGEX = %r!\A/|(?<=[^/])\z!
def sanitize_path(path)
if path.nil? || path.empty?
""
else
path.gsub(SANITIZATION_REGEX, "")
path.gsub(%r!\A/|(?<=[^/])\z!, "".freeze)
end
end
end

View File

@@ -5,11 +5,6 @@ require_relative "liquid_renderer/table"
module Jekyll
class LiquidRenderer
extend Forwardable
private def_delegator :@site, :in_source_dir, :source_dir
private def_delegator :@site, :in_theme_dir, :theme_dir
def initialize(site)
@site = site
Liquid::Template.error_mode = @site.config["liquid"]["error_mode"].to_sym
@@ -21,18 +16,11 @@ module Jekyll
end
def file(filename)
Jekyll.logger.info "FILENAME:", filename
filename.match(filename_regex)
filename = @site.in_source_dir(filename).sub(
%r!\A#{Regexp.escape(@site.source)}/!,
""
)
Jekyll.logger.info "CAPTURES:", Regexp.last_match.captures
puts
filename =
if Regexp.last_match(1) == theme_dir("")
::File.join(::File.basename(Regexp.last_match(1)), Regexp.last_match(2))
else
Regexp.last_match(2)
end
LiquidRenderer::File.new(self, filename).tap do
@stats[filename] ||= new_profile_hash
@stats[filename][:count] += 1
@@ -47,20 +35,15 @@ module Jekyll
@stats[filename][:time] += time
end
def stats_table(num_of_rows = 50)
LiquidRenderer::Table.new(@stats).to_s(num_of_rows)
def stats_table(n = 50)
LiquidRenderer::Table.new(@stats).to_s(n)
end
def self.format_error(error, path)
"#{error.message} in #{path}"
def self.format_error(e, path)
"#{e.message} in #{path}"
end
private
def filename_regex
@filename_regex ||= %r!\A(#{source_dir}/|#{theme_dir}/|\W*)(.*)!i
end
def new_profile_hash
Hash.new { |hash, key| hash[key] = 0 }
end

View File

@@ -6,8 +6,8 @@ module Jekyll
@stats = stats
end
def to_s(num_of_rows = 50)
data = data_for_table(num_of_rows)
def to_s(n = 50)
data = data_for_table(n)
widths = table_widths(data)
generate_table(data, widths)
end
@@ -63,16 +63,16 @@ module Jekyll
data.each do |row|
row.each_with_index do |cell, index|
widths[index] = [cell.length, widths[index]].compact.max
widths[index] = [ cell.length, widths[index] ].compact.max
end
end
widths
end
def data_for_table(num_of_rows)
def data_for_table(n)
sorted = @stats.sort_by { |_, file_stats| -file_stats[:time] }
sorted = sorted.slice(0, num_of_rows)
sorted = sorted.slice(0, n)
table = [%w(Filename Count Bytes Time)]

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "csv"
module Jekyll
class Reader
attr_reader :site
@@ -61,8 +63,8 @@ module Jekyll
# Returns nothing.
def retrieve_posts(dir)
return if outside_configured_directory?(dir)
site.posts.docs.concat(post_reader.read_posts(dir))
site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
site.posts.docs.concat(PostReader.new(site).read_posts(dir))
site.posts.docs.concat(PostReader.new(site).read_drafts(dir)) if site.show_drafts
end
# Recursively traverse directories with the read_directories function.
@@ -76,7 +78,7 @@ module Jekyll
dot_dirs.each do |file|
dir_path = site.in_source_dir(dir, file)
rel_path = File.join(dir, file)
unless @site.dest.chomp("/") == dir_path
unless @site.dest.sub(%r!/$!, "") == dir_path
@site.reader.read_directories(rel_path)
end
end
@@ -144,11 +146,5 @@ module Jekyll
collections_dir = site.config["collections_dir"]
!collections_dir.empty? && !dir.start_with?("/#{collections_dir}")
end
# Create a single PostReader instance to retrieve drafts and posts from all valid
# directories in current site.
def post_reader
@post_reader ||= PostReader.new(site)
end
end
end

View File

@@ -20,7 +20,6 @@ module Jekyll
#
# Returns a boolean.
def regenerate?(document)
return true if disabled
case document
when Page
regenerate_page?(document)
@@ -121,7 +120,6 @@ module Jekyll
# Returns nothing.
def write_metadata
unless disabled?
Jekyll.logger.debug "Writing Metadata:", ".jekyll-metadata"
File.binwrite(metadata_file, Marshal.dump(metadata))
end
end

View File

@@ -46,7 +46,7 @@ module Jekyll
end
def most_recent_posts
@most_recent_posts ||= (site.posts.docs.last(11).reverse - [post]).first(10)
@most_recent_posts ||= (site.posts.docs.reverse - [post]).first(10)
end
end
end

View File

@@ -52,7 +52,7 @@ module Jekyll
Jekyll.logger.debug "Rendering:", document.relative_path
assign_pages!
assign_current_document!
assign_related_posts!
assign_highlighter_options!
assign_layout_data!
@@ -68,11 +68,8 @@ module Jekyll
# rubocop: disable AbcSize
def render_document
info = {
:registers => { :site => site, :page => payload["page"] },
:strict_filters => liquid_options["strict_filters"],
:strict_variables => liquid_options["strict_variables"],
:registers => { :site => site, :page => payload["page"] },
}
output = document.content
if document.render_with_liquid?
Jekyll.logger.debug "Rendering Liquid:", document.relative_path
@@ -80,7 +77,7 @@ module Jekyll
end
Jekyll.logger.debug "Rendering Markup:", document.relative_path
output = convert(output.to_s)
output = convert(output)
document.content = output
if document.place_in_layout?
@@ -172,16 +169,12 @@ module Jekyll
# Returns nothing
private
def validate_layout(layout)
if invalid_layout?(layout)
Jekyll.logger.warn(
"Build Warning:",
"Layout '#{document.data["layout"]}' requested "\
"in #{document.relative_path} does not exist."
)
elsif !layout.nil?
layout_source = layout.path.start_with?(site.source) ? :site : :theme
Jekyll.logger.debug "Layout source:", layout_source
end
return unless invalid_layout?(layout)
Jekyll.logger.warn(
"Build Warning:",
"Layout '#{document.data["layout"]}' requested "\
"in #{document.relative_path} does not exist."
)
end
# Render layout content into document.output
@@ -224,8 +217,12 @@ module Jekyll
#
# Returns nothing
private
def assign_current_document!
payload["site"].current_document = document
def assign_related_posts!
if document.is_a?(Document) && document.collection.label == "posts"
payload["site"]["related_posts"] = document.related_posts
else
payload["site"]["related_posts"] = nil
end
end
# Set highlighter prefix and suffix
@@ -247,9 +244,8 @@ module Jekyll
private
def permalink_ext
document_permalink = document.permalink
if document_permalink && !document_permalink.end_with?("/")
permalink_ext = File.extname(document_permalink)
if document.permalink && !document.permalink.end_with?("/")
permalink_ext = File.extname(document.permalink)
permalink_ext unless permalink_ext.empty?
end
end
@@ -269,10 +265,5 @@ module Jekyll
c.output_ext(document.extname)
end.compact
end
private
def liquid_options
@liquid_options ||= site.config["liquid"]
end
end
end

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "csv"
module Jekyll
class Site
attr_reader :source, :dest, :config
@@ -91,12 +93,9 @@ module Jekyll
self.pages = []
self.static_files = []
self.data = {}
@site_data = nil
@collections = nil
@docs_to_write = nil
@regenerator.clear_cache
@liquid_renderer.reset
@site_cleaner = nil
if limit_posts < 0
raise ArgumentError, "limit_posts must be a non-negative number"
@@ -253,7 +252,7 @@ module Jekyll
#
# Returns the Hash to be hooked to site.data.
def site_data
@site_data ||= (config["data"] || data)
config["data"] || data
end
# The Hash payload containing site-wide data.
@@ -277,12 +276,10 @@ module Jekyll
# Get the implementation class for the given Converter.
# Returns the Converter instance implementing the given Converter.
# klass - The Class of the Converter to fetch.
def find_converter_instance(klass)
@find_converter_instance ||= {}
@find_converter_instance[klass] ||= begin
converters.find { |converter| converter.instance_of?(klass) } || \
raise("No Converters found for #{klass}")
end
converters.find { |klass_| klass_.instance_of?(klass) } || \
raise("No Converters found for #{klass}")
end
# klass - class or module containing the subclasses.
@@ -314,7 +311,7 @@ module Jekyll
#
# Returns an Array of Documents which should be written
def docs_to_write
@docs_to_write ||= documents.select(&:write?)
documents.select(&:write?)
end
# Get all the documents
@@ -461,7 +458,10 @@ module Jekyll
def render_docs(payload)
collections.each_value do |collection|
collection.docs.each do |document|
render_regenerated(document, payload)
if regenerator.regenerate?(document)
document.output = Jekyll::Renderer.new(self, document, payload).run
document.trigger_hooks(:post_render)
end
end
end
end
@@ -469,15 +469,11 @@ module Jekyll
private
def render_pages(payload)
pages.flatten.each do |page|
render_regenerated(page, payload)
if regenerator.regenerate?(page)
page.output = Jekyll::Renderer.new(self, page, payload).run
page.trigger_hooks(:post_render)
end
end
end
private
def render_regenerated(document, payload)
return unless regenerator.regenerate?(document)
document.output = Jekyll::Renderer.new(self, document, payload).run
document.trigger_hooks(:post_render)
end
end
end

View File

@@ -137,7 +137,7 @@ module Jekyll
:template => @collection.url_template,
:placeholders => placeholders,
})
end.to_s.chomp("/")
end.to_s.gsub(%r!/$!, "")
end
# Returns the type of the collection if present, nil otherwise.

View File

@@ -65,24 +65,23 @@ MSG
private
OPTIONS_REGEX = %r!(?:\w="[^"]*"|\w=\w|\w)+!
def parse_options(input)
options = {}
return options if input.empty?
# Split along 3 possible forms -- key="<quoted list>", key=value, or key
input.scan(OPTIONS_REGEX) do |opt|
key, value = opt.split("=")
# If a quoted list, convert to array
if value && value.include?('"')
value.delete!('"')
value = value.split
unless input.empty?
# Split along 3 possible forms -- key="<quoted list>", key=value, or key
input.scan(%r!(?:\w="[^"]*"|\w=\w|\w)+!) do |opt|
key, value = opt.split("=")
# If a quoted list, convert to array
if value && value.include?("\"")
value.delete!('"')
value = value.split
end
options[key.to_sym] = value || true
end
options[key.to_sym] = value || true
end
options[:linenos] = "inline" if options[:linenos] == true
if options.key?(:linenos) && options[:linenos] == true
options[:linenos] = "inline"
end
options
end

View File

@@ -19,11 +19,7 @@ module Jekyll
VARIABLE_SYNTAX = %r!
(?<variable>[^{]*(\{\{\s*[\w\-\.]+\s*(\|.*)?\}\}[^\s{}]*)+)
(?<params>.*)
!mx
FULL_VALID_SYNTAX = %r!\A\s*(?:#{VALID_SYNTAX}(?=\s|\z)\s*)*\z!
VALID_FILENAME_CHARS = %r!^[\w/\.-]+$!
INVALID_SEQUENCES = %r![./]{2,}!
!x
def initialize(tag_name, markup, tokens)
super
@@ -63,7 +59,7 @@ module Jekyll
end
def validate_file_name(file)
if file =~ INVALID_SEQUENCES || file !~ VALID_FILENAME_CHARS
if file !~ %r!^[a-zA-Z0-9_/\.-]+$! || file =~ %r!\./! || file =~ %r!/\.!
raise ArgumentError, <<-MSG
Invalid syntax for include tag. File contains invalid characters or sequences:
@@ -78,7 +74,8 @@ MSG
end
def validate_params
unless @params =~ FULL_VALID_SYNTAX
full_valid_syntax = %r!\A\s*(?:#{VALID_SYNTAX}(?=\s|\z)\s*)*\z!
unless @params =~ full_valid_syntax
raise ArgumentError, <<-MSG
Invalid syntax for include tag:
@@ -99,7 +96,7 @@ MSG
# Render the variable if required
def render_variable(context)
if @file =~ VARIABLE_SYNTAX
if @file.match(VARIABLE_SYNTAX)
partial = context.registers[:site]
.liquid_renderer
.file("(variable)")
@@ -216,15 +213,8 @@ MSG
if context.registers[:page].nil?
context.registers[:site].source
else
site = context.registers[:site]
page_payload = context.registers[:page]
resource_path = \
if page_payload["collection"].nil?
page_payload["path"]
else
File.join(site.config["collections_dir"], page_payload["path"])
end
site.in_source_dir File.dirname(resource_path)
current_doc_dir = File.dirname(context.registers[:page]["path"])
context.registers[:site].in_source_dir current_doc_dir
end
end
end

View File

@@ -8,8 +8,6 @@ module Jekyll
def initialize(name)
@name = name.downcase.strip
Jekyll.logger.debug "Theme:", name
Jekyll.logger.debug "Theme source:", root
configure_sass
end
@@ -23,19 +21,19 @@ module Jekyll
end
def includes_path
@includes_path ||= path_for "_includes".freeze
path_for "_includes".freeze
end
def layouts_path
@layouts_path ||= path_for "_layouts".freeze
path_for "_layouts".freeze
end
def sass_path
@sass_path ||= path_for "_sass".freeze
path_for "_sass".freeze
end
def assets_path
@assets_path ||= path_for "assets".freeze
path_for "assets".freeze
end
def configure_sass
@@ -56,9 +54,12 @@ module Jekyll
end
def realpath_for(folder)
File.realpath(Jekyll.sanitized_path(root, folder.to_s))
# This resolves all symlinks for the theme subfolder and then ensures
# that the directory remains inside the theme root. This prevents the
# use of symlinks for theme subfolders to escape the theme root.
# However, symlinks are allowed to point to other directories within the theme.
Jekyll.sanitized_path(root, File.realpath(Jekyll.sanitized_path(root, folder.to_s)))
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
Jekyll.logger.warn "Invalid theme folder:", folder
nil
end

View File

@@ -8,7 +8,7 @@ class Jekyll::ThemeBuilder
attr_reader :name, :path, :code_of_conduct
def initialize(theme_name, opts)
@name = theme_name.to_s.tr(" ", "_").squeeze("_")
@name = theme_name.to_s.tr(" ", "_").gsub(%r!_+!, "_")
@path = Pathname.new(File.expand_path(name, Dir.pwd))
@code_of_conduct = !!opts["code_of_conduct"]
end

View File

@@ -1,5 +1,7 @@
# frozen_string_literal: true
require "addressable/uri"
# Public: Methods that generate a URL for a resource such as a Post or a Page.
#
# Examples
@@ -70,9 +72,9 @@ module Jekyll
break result if result.index(":").nil?
if token.last.nil?
# Remove leading "/" to avoid generating urls with `//`
result.gsub("/:#{token.first}", "")
result.gsub(%r!/:#{token.first}!, "")
else
result.gsub(":#{token.first}", self.class.escape_path(token.last))
result.gsub(%r!:#{token.first}!, self.class.escape_path(token.last))
end
end
end
@@ -107,14 +109,14 @@ module Jekyll
replacement = self.class.escape_path(value)
match.sub(":#{winner}", replacement)
end.squeeze("/")
end.gsub(%r!//!, "/".freeze)
end
# Returns a sanitized String URL, stripping "../../" and multiples of "/",
# as well as the beginning "/" so we can enforce and ensure it.
def sanitize_url(str)
"/#{str}".gsub("..", "/").gsub("./", "").squeeze("/")
"/" + str.gsub(%r!/{2,}!, "/").gsub(%r!\.+/|\A/+!, "")
end
# Escapes a path to be a valid URL path segment

View File

@@ -147,14 +147,6 @@ module Jekyll
rescue EOFError
false
end
# Determine whether the given content string contains Liquid Tags or Vaiables
#
# Returns true is the string contains sequences of `{%` or `{{`
def has_liquid_construct?(content)
return false if content.nil? || content.empty?
content.include?("{%") || content.include?("{{")
end
# rubocop: enable PredicateName
# Slugify a filename or title.

View File

@@ -69,7 +69,7 @@ module Jekyll
private
def proc_version
@proc_version ||= begin
@cached_proc_version ||= begin
Pathutil.new(
"/proc/version"
).read

View File

@@ -1,12 +1,11 @@
# frozen_string_literal: true
Jekyll::External.require_with_graceful_fail("rouge")
module Jekyll
module Utils
module Rouge
def self.html_formatter(*args)
Jekyll::External.require_with_graceful_fail("rouge") unless defined?(::Rouge)
if old_api?
::Rouge::Formatters::HTML.new(*args)
else

View File

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

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