Compare commits

..

171 Commits

Author SHA1 Message Date
Jordon Bedwell
6baccbc43e Create an un-mergable commit to demonstrate Pathutil. 2016-05-14 06:44:04 -05:00
jekyllbot
96ac1185a1 Update history to reflect merge of #4892 [ci skip] 2016-05-13 12:50:41 -05:00
jekyllbot
6dc9665573 Merge pull request #4892 from derekgottlieb/rubocop-cleaner
Merge pull request 4892
2016-05-13 12:50:41 -05:00
Derek Gottlieb
83f8df49ab Fixing rubocop offenses in lib/jekyll/cleaner.rb 2016-05-13 12:34:11 -05:00
Parker Moore
6a2ffbac62 Add note about being unreleased to the Themes documentation.
Fixes #4510.
2016-05-13 11:49:59 -05:00
jekyllbot
64219cc11a Update history to reflect merge of #4890 [ci skip] 2016-05-13 10:12:36 -05:00
jekyllbot
b40524fbc3 Merge pull request #4890 from dinamicoplus/patch-1
Merge pull request 4890
2016-05-13 10:12:36 -05:00
Marcos Brito
1e89aa7a13 Removed extra </p> from site/_docs/permalinks.md
It seems there's an extra </p> in the html code, in the line number 103.
2016-05-13 14:39:56 +02:00
jekyllbot
f2bad8524f Update history to reflect merge of #4849 [ci skip] 2016-05-12 15:25:10 -05:00
jekyllbot
8c9492d5fa Merge pull request #4849 from envygeeks/master
Merge pull request 4849
2016-05-12 15:25:10 -05:00
jekyllbot
207e4df3de Update history to reflect merge of #4887 [ci skip] 2016-05-12 14:56:49 -05:00
jekyllbot
f615475378 Merge pull request #4887 from jekyll/pull/add-jekyll-tips
Merge pull request 4887
2016-05-12 14:56:48 -05:00
Parker Moore
5258f78a51 Add Jekyll Tips and the Cheatsheet to the list of resources 2016-05-12 14:54:40 -05:00
jekyllbot
73ae01b4e5 Update history to reflect merge of #4886 [ci skip] 2016-05-12 14:45:02 -05:00
jekyllbot
13eaa4fd77 Merge pull request #4886 from jekyll/enable-rubocop
Merge pull request 4886
2016-05-12 14:45:00 -05:00
Parker Moore
3b021c6046 Move Rubocop gem to :test group in Gemfile 2016-05-12 14:33:48 -05:00
Parker Moore
419c670947 travis: run one script/fmt job 2016-05-12 14:17:45 -05:00
Parker Moore
cddc40fef4 rubocop: exclude test and features files that fail 2016-05-12 14:14:44 -05:00
Parker Moore
85e3ce37af rubocop: %r should use exclamation marks as delimeters 2016-05-12 14:11:59 -05:00
Parker Moore
fa3323ec92 rubocop: default for Lint/AmbiguousRegexpLiteral 2016-05-12 14:05:16 -05:00
Parker Moore
ffe6e0d996 rubocop: enforce Style/StringLiterals 2016-05-12 14:00:49 -05:00
Parker Moore
b28e14bcd6 create script/fmt to format the code 2016-05-12 13:42:05 -05:00
Parker Moore
917b470459 merge rubocop rules with the ones from pages-gem 2016-05-12 13:41:53 -05:00
Parker Moore
1ae4f513d8 Add 'ruby' to pre-filled Gemfile for 'jekyll new'
Fixes #4839
2016-05-12 12:19:46 -05:00
jekyllbot
209cd6b729 Update history to reflect merge of #4859 [ci skip] 2016-05-12 12:16:35 -05:00
jekyllbot
1504864d9e Merge pull request #4859 from jekyll/feature/allow-excludes-to-leave-the-insane-asylum
Merge pull request 4859
2016-05-12 12:16:35 -05:00
Jordon Bedwell
3751b47c50 Cleanup EntryFilter and make it far more robust.
* Allow users to filter directories by ending their path with "/"
* Allow users to filter with a Regexp, some scenariors can really require it.
* Use Pathutil#in_path? for Symlink verification, it real/expand.

This also requires some downstream work in "jekyll-watch" which at this time is
not very robust, it doesn't recognize the difference either, and should probably
start doing so (what I mean is detecting "/" and using the full path.)
2016-05-10 20:01:02 -05:00
jekyllbot
92720363e1 Update history to reflect merge of #4863 [ci skip] 2016-05-10 12:35:42 -07:00
jekyllbot
4986cb78a3 Merge pull request #4863 from xHN35RQ/patch-1
Merge pull request 4863
2016-05-10 12:35:42 -07:00
jekyllbot
7f3a9e1f40 Update history to reflect merge of #4872 [ci skip] 2016-05-10 12:34:02 -07:00
jekyllbot
cd861d7fc5 Merge pull request #4872 from mdxprograms/patch-1
Merge pull request 4872
2016-05-10 12:34:01 -07:00
jekyllbot
4dab3dd423 Update history to reflect merge of #4874 [ci skip] 2016-05-10 12:33:15 -07:00
jekyllbot
8f79551da3 Merge pull request #4874 from git-no/master
Merge pull request 4874
2016-05-10 12:33:14 -07:00
No
d9ab71cb59 Breadcrumbs integration for Jekyll 3.x 2016-05-07 20:15:16 +02:00
Josh Waller
770b6ab073 Adding pug plugin
Jade has been moved to Pug https://github.com/pugjs/pug
This was forked from the previous Jade plugin and merged the pug update to maintain the newer version and avoid deprecation usage.
2016-05-07 08:37:34 -04:00
Jordon Bedwell
b7bf19ff31 Merge pull request #4867 from dudepare/master
Fixed a typo
2016-05-05 03:32:51 -05:00
Andrew Artajos
2d8a228b59 Fixed a typo
Fixed a typo from indend to indent. Just making the code more readable.
2016-05-05 09:14:03 +10:00
Nick
55734ee482 Add jekyll-ideal-image-slider 2016-05-03 12:27:37 -07:00
jekyllbot
53d6b91fc8 Update history to reflect merge of #4857 [ci skip] 2016-04-29 12:22:47 -07:00
jekyllbot
6c081427c4 Merge pull request #4857 from jekyll/fix/dont-rescue-load-error-for-bundler
Merge pull request 4857
2016-04-29 12:22:46 -07:00
Jordon Bedwell
44cf61d241 Fix #4856: Don't rescue LoadError or bundler load errors for Bundler.
When it comes to bundler it's smart enough to know what to require, and in casees it's not, it's smart enough to accept :require.  In most cases when bundler has a LoadError (or otherwise) it's because there is a problem inside of the Gem itself and when this happens, Jekyll will happily let that error slip when it shouldn't, resulting in a badly placed error that is actually wrong. This corrects that so errors can surface properly.
2016-04-29 06:37:57 -05:00
jekyllbot
b8e7669228 Update history to reflect merge of #4855 [ci skip] 2016-04-28 19:07:17 -07:00
jekyllbot
51c0c934d3 Merge pull request #4855 from jekyll/upgrade/update-colorator-to-1.0
Merge pull request 4855
2016-04-28 19:07:16 -07:00
Jordon Bedwell
46f54e6b94 Update Colorator to 1.0 2016-04-28 20:58:05 -05:00
jekyllbot
0ee1a75d16 Update history to reflect merge of #4854 [ci skip] 2016-04-28 18:27:57 -07:00
jekyllbot
c9d5c7d30a Merge pull request #4854 from jekyll/site-improvements
Merge pull request 4854
2016-04-28 18:27:56 -07:00
Parker Moore
342d5a4250 site: optimize liquid for whitespace removal 2016-04-28 18:26:44 -07:00
Parker Moore
19b566e6ea site: use rouge instead of pygments 2016-04-28 18:26:29 -07:00
Parker Moore
d74f8d6dd9 Fix spacing on the msg in Configuration#renamed_key 2016-04-28 17:55:15 -07:00
Jordon Bedwell
035352feff Update the ISSUE_TEMPLATE.md file.
* Link to jekyllrb.com as @parkr suggested.
* Add a few more directions and hints for Github Pages users who have errors.
* Add words that were missing and made stuff make no sense.
2016-04-28 04:28:15 -05:00
Jordon Bedwell
a04c45a2b6 Make the issue template more robust.
This makes the issue template more robust, making check boxes so users can submit and check or check as they go.  It also starts using HTML comments so that directions for the users aren't always displayed to us (gotta love Markdown.) And provides the users with more hints on what we would like from them when filing a ticket.
2016-04-27 13:36:37 -05:00
Parker Moore
6ed193277d Merge pull request #4847 from jekyll/3-0-5-release-post
Add release notes for v3.0.5
2016-04-26 18:01:01 -07:00
Parker Moore
960342eb38 Add link to history doc. 2016-04-26 18:00:33 -07:00
Parker Moore
008e694732 Compile history. 2016-04-26 17:59:05 -07:00
Parker Moore
4d264b5b9c Add release notes for v3.0.5 2016-04-26 17:57:07 -07:00
Jordon Bedwell
b45f575ffe Move to the Rubocop Gem, they've 2.3+ support and TargetVersion deployed now.
Previously we relied on the Git version of Rubocop so that we could get 2.3+ and TargetVersion support in our .rubocop.yml, they have since updated stable and made this available to the general public.
2016-04-26 19:19:53 -05:00
jekyllbot
f535497d90 Update history to reflect merge of #4844 [ci skip] 2016-04-26 17:13:18 -07:00
jekyllbot
70fb98f777 Merge pull request #4844 from ahanselka/formkeep
Merge pull request 4844
2016-04-26 17:13:18 -07:00
Alex Hanselka
514fdc7610 update formkeep url 2016-04-26 16:23:52 -05:00
Parker Moore
605cd265c0 Disable IRC build notifications. 2016-04-25 15:08:06 -07:00
jekyllbot
6d0bab5d59 Update history to reflect merge of #4710 [ci skip] 2016-04-21 17:38:01 -07:00
jekyllbot
1d788203df Merge pull request #4710 from fenollp/safe-symlinks
Merge pull request 4710
2016-04-21 17:38:00 -07:00
jekyllbot
1ac9c21956 Update history to reflect merge of #4808 [ci skip] 2016-04-21 17:20:03 -07:00
jekyllbot
298d56aab2 Merge pull request #4808 from jekyll/fix-collection-defaults-
Merge pull request 4808
2016-04-21 17:20:02 -07:00
jekyllbot
d8dc0b6333 Update history to reflect merge of #4595 [ci skip] 2016-04-21 17:19:00 -07:00
jekyllbot
30f2bdff5b Merge pull request #4595 from jekyll/themes
Merge pull request 4595
2016-04-21 17:18:59 -07:00
Parker Moore
685abf109b Merge pull request #4819 from jekyll/release-posts
Release posts for v3.0.4 and v3.1.3
2016-04-21 17:17:31 -07:00
Parker Moore
e4057e0c81 Write release posts. 2016-04-21 17:17:13 -07:00
Parker Moore
57ccbe08ea Ensure symlinks work as expected (and secured). 2016-04-21 16:32:52 -07:00
Parker Moore
bac65ea8c5 C'mon travis 2016-04-21 16:16:46 -07:00
Parker Moore
49a3f543f3 Theme: configure sass at initialize time so we don't forget 2016-04-21 16:11:09 -07:00
Parker Moore
3b2d68d333 LayoutReader: read proper item from theme class 2016-04-21 16:10:43 -07:00
Parker Moore
2b73696d03 Set @path and @base_dir on the Layout per whether it's in the theme 2016-04-21 16:10:19 -07:00
Parker Moore
d5dd423bfd Add cucumber specs. 2016-04-21 16:09:23 -07:00
Parker Moore
42cc2445a5 Merge branch 'master' into themes
* master: (58 commits)
  Update history to reflect merge of #4792 [ci skip]
  Update history to reflect merge of #4793 [ci skip]
  Update history to reflect merge of #4804 [ci skip]
  Update history to reflect merge of #4754 [ci skip]
  Update history to reflect merge of #4813 [ci skip]
  Added missing single quote on rsync client side command
  Add v3.0.4 and v3.1.3 to the history.
  Fixed typo
  Add jekyll-autoprefixer plugin
  Explicitly require Filters rather than implicitly.
  Update history to reflect merge of #4786 [ci skip]
  Update history to reflect merge of #4789 [ci skip]
  updates example domain in config template
  Globalize Jekyll's Filters.
  Update JRuby to 9.0.5.0; Drop the double digit test.
  Update Rack-Jekyll Heroku deployment blog post url
  convertible: use Document::YAML_FRONT_MATTER_REGEXP to parse transformable files
  Update history to reflect merge of #4734 [ci skip]
  Update history to reflect merge of #4478 [ci skip]
  Fix rubocop warning.
  ...
2016-04-21 11:43:35 -07:00
Parker Moore
f67f771a45 Empty release posts 2016-04-21 11:41:54 -07:00
Parker Moore
655ffd45be Use source_dir instead of my own computer's path 2016-04-21 11:26:33 -07:00
jekyllbot
0d89b77dae Update history to reflect merge of #4792 [ci skip] 2016-04-20 14:06:11 -07:00
jekyllbot
341407ef2a Merge pull request #4792 from jekyll/feature/globalize-filters
Merge pull request 4792
2016-04-20 14:06:10 -07:00
jekyllbot
1d55558956 Update history to reflect merge of #4793 [ci skip] 2016-04-20 14:03:36 -07:00
jekyllbot
46b2ab8e88 Merge pull request #4793 from sl4m/change-example-domain-url
Merge pull request 4793
2016-04-20 14:03:36 -07:00
jekyllbot
823a84fec9 Merge pull request #4799 from vwochnik/patch-1
Merge pull request 4799
2016-04-20 14:01:22 -07:00
jekyllbot
1ec64f568d Update history to reflect merge of #4804 [ci skip] 2016-04-20 13:57:26 -07:00
jekyllbot
f6f0d39b81 Merge pull request #4804 from henrywright/patch-1
Merge pull request 4804
2016-04-20 13:57:25 -07:00
jekyllbot
94647af1f4 Update history to reflect merge of #4754 [ci skip] 2016-04-20 12:31:10 -07:00
jekyllbot
894b356619 Merge pull request #4754 from lexoyo/patch-1
Merge pull request 4754
2016-04-20 12:31:08 -07:00
jekyllbot
f61ba8abf7 Update history to reflect merge of #4813 [ci skip] 2016-04-19 11:02:18 -07:00
jekyllbot
ccd5c9e106 Merge pull request #4813 from joshaidan/patch-1
Merge pull request 4813
2016-04-19 11:02:17 -07:00
Brian Jones
4e09375531 Added missing single quote on rsync client side command
The rsync command was missing a single quote around the --rsh='ssh -p2222' parameter.
2016-04-19 13:59:23 -04:00
Parker Moore
9315cdb473 Add v3.0.4 and v3.1.3 to the history. 2016-04-18 14:34:29 -07:00
Parker Moore
40e3a04704 test_document: scopes are based on relative_path 2016-04-18 13:56:02 -07:00
Parker Moore
87825e1e14 Document#read: frontmatter.all should get relative_path not URL 2016-04-18 13:55:57 -07:00
Florian Thomas
46dd5cf5a2 add failing test for scope values in subdirs
ref #4458
2016-04-18 13:55:51 -07:00
Henry Wright
adc6a491b9 Fixed typo
Add an apostrophe.
2016-04-17 20:39:20 +01:00
Vincent Wochnik
6f794ae320 Add jekyll-autoprefixer plugin 2016-04-16 14:48:35 +02:00
Jordon Bedwell
27366f2e30 Explicitly require Filters rather than implicitly. 2016-04-15 12:02:25 -05:00
jekyllbot
8257f0abd9 Update history to reflect merge of #4786 [ci skip] 2016-04-15 09:15:14 -07:00
jekyllbot
f922e8994a Merge pull request #4786 from jekyll/convertible-use-doc-frontmatter-regexp
Merge pull request 4786
2016-04-15 09:15:13 -07:00
jekyllbot
b97d9b688e Update history to reflect merge of #4789 [ci skip] 2016-04-15 09:14:33 -07:00
jekyllbot
5e302d7ec6 Merge pull request #4789 from duksis/master
Merge pull request 4789
2016-04-15 09:14:32 -07:00
skim
b122148acf updates example domain in config template 2016-04-15 09:29:39 +01:00
Jordon Bedwell
1e74c7a547 Globalize Jekyll's Filters.
As it stands Jekyll does not globalize it's filters.  So anybody wishing to go
into Jekyll's context to process their own Liquid (say in a plugin) may be taken
aback when they find out that Jekyll's filters are not available.
See: jekyll/jekyll-assets#252.
2016-04-14 20:36:22 -05:00
Jordon Bedwell
8144e7620f Update JRuby to 9.0.5.0; Drop the double digit test.
We've tested enough of the double digit stuff, it's only slowing down our specs and we've got an idea about what's going on with it.
2016-04-14 14:32:16 -05:00
Hugo Duksis
bb307bf6c1 Update Rack-Jekyll Heroku deployment blog post url
Failed to deploy to heroku by following old blog post  
but after stumbling up on https://github.com/adaoraul/rack-jekyll/issues/20
managed to do it and would like to avoid the trouble for others.
2016-04-14 18:24:46 +02:00
Parker Moore
f210cafdf2 convertible: use Document::YAML_FRONT_MATTER_REGEXP to parse transformable files 2016-04-13 23:22:05 -04:00
jekyllbot
519c3eb51f Update history to reflect merge of #4734 [ci skip] 2016-04-13 20:18:12 -07:00
jekyllbot
1cf5c8abd7 Merge pull request #4734 from nsgonultas/master
Merge pull request 4734
2016-04-13 20:18:12 -07:00
jekyllbot
7635d08ecf Update history to reflect merge of #4478 [ci skip] 2016-04-13 13:37:29 -07:00
jekyllbot
fc0d440201 Merge pull request #4478 from edgemaster/where-exp
Merge pull request 4478
2016-04-13 13:37:29 -07:00
Thomas Wood
e470cae6da Fix rubocop warning. 2016-04-12 19:11:59 +01:00
Thomas Wood
1ef7653fed Fix minor code style recommendations and typos. 2016-04-12 18:59:56 +01:00
Thomas Wood
66c4ff8800 Add a where_exp filter for filtering by expression
This commit introduces a where_exp filter, which can be used as follows:
  `{{ array | where_exp: "item", "item == 10" }}`
  `{{ array | where_exp: "item", "item.field > 10" }}`
  `{{ site.posts | where_exp: "post", "post contains 'field'" }}`
  `{{ site.posts | where_exp: "post", "post.array contains 'giraffes'" }}`

This permits a variety of use cases, such as reported in: jekyll#4467,
jekyll#4385, jekyll#2787.
2016-04-12 18:52:58 +01:00
Parker Moore
64d1a81968 Fix history for #4693 & its cherry-pick into master which doesn't need a history line 2016-04-12 13:40:24 -04:00
Jordon Bedwell
61b17d3dc8 Update History.markdown to reflect the cherry-pick of 2b9e849. 2016-04-12 03:02:34 -05:00
Jordon Bedwell
1efb1d7a58 Fix #4689: Use SSLEnable instead of EnableSSL and make URL HTTPS. 2016-04-12 02:59:48 -05:00
jekyllbot
4907b4c9f2 Update history to reflect merge of #4769 [ci skip] 2016-04-11 19:21:20 -07:00
jekyllbot
1bc8a83774 Merge pull request #4769 from lorentrogers/lr/update_collection_docs
Merge pull request 4769
2016-04-11 19:21:20 -07:00
jekyllbot
b0c3e3fa47 Update history to reflect merge of #4771 [ci skip] 2016-04-11 19:17:20 -07:00
jekyllbot
1430b6901d Merge pull request #4771 from menatankush/patch-1
Merge pull request 4771
2016-04-11 19:17:20 -07:00
jekyllbot
9880cea627 Update history to reflect merge of #4775 [ci skip] 2016-04-11 19:16:32 -07:00
jekyllbot
42b68261da Merge pull request #4775 from KrzysiekJ/jekyll-i18n_tags
Merge pull request 4775
2016-04-11 19:16:31 -07:00
jekyllbot
b1a6b21dad Update history to reflect merge of #4781 [ci skip] 2016-04-11 12:09:55 -07:00
jekyllbot
b35a2dd66d Merge pull request #4781 from kevee/docs-data-file-format
Merge pull request 4781
2016-04-11 12:09:54 -07:00
Kevin Miller
6f000c3807 Made statement about data file format more explicit
The doc read “These files must be YAML files…” then lists a few
extensions that are not YAML.
2016-04-10 09:53:50 -07:00
Krzysztof Jurewicz
499339548d Add jekyll-i18n_tags plugin 2016-04-09 13:56:55 +02:00
Ankush Menat
cd1d7afd59 Removed Leonard Lamprecht's website
Removed Leonard Lamprecht's website, he isn't using Jekyll for blogging anymore. Ref - https://medium.com/@leo/jekyll-medium-41a058ac2c91#.36e95k7de
2016-04-08 14:19:51 +05:30
Loren Rogers
f17d0076e0 Updates documentation for collections
Closes #4687
2016-04-07 20:28:16 -04:00
Jordon Bedwell
0daf1f5514 Revert moving to 2.1.9
It seems that Travis has made available 2.1.10 which is for double digit testing but skipped 2.1.10 (for some reason.) This reverts us back to 2.1.8 so that we can maintain a working build since we are triggering no known bugs in 2.1 at this time.
2016-04-07 16:09:23 -05:00
Jordon Bedwell
5e212648f6 2.1.8 => 2.1.9 2016-04-07 15:57:24 -05:00
Jordon Bedwell
129a0b6b7d Do as Ruby maintainers requested.
Lets see if anything breaks by using a 2 digit Ruby version number, they are looking for people to see if stuff breaks because this.
2016-04-07 15:53:32 -05:00
jekyllbot
a42d0ad9e9 Update history to reflect merge of #4756 [ci skip] 2016-04-06 18:25:00 -07:00
jekyllbot
ec105b3e54 Merge pull request #4756 from keegoid/master
Merge pull request 4756
2016-04-06 18:24:59 -07:00
Keegan Mullaney
19a8473023 fix typo
lcoally => locally

 Changes to be committed:
	modified:   .github/CONTRIBUTING.markdown
	modified:   site/_docs/contributing.md
2016-04-05 16:49:38 +08:00
Alex Hoyau
eb4e9dd347 more form baas 2016-04-04 19:07:57 +02:00
Enes Gönültaş
d576d7bfae Added an explicit rerun note 2016-03-30 17:16:25 +03:00
Pierre Fenoll
9347e90a67 Use EntryFilter throughout & update tests 2016-03-26 16:40:19 +01:00
Pierre Fenoll
4aadfe9fd7 Add test that filters out symlink pointing outside site source 2016-03-26 14:16:43 +01:00
Pierre Fenoll
bbd2a2b7f1 Rename EntryFilter#bad_symlink? to EntryFilter#symlink_outside_site_source? 2016-03-26 13:12:08 +01:00
Parker Moore
33255e3ac3 IncludeTag: implement multiple load paths 2016-03-25 17:44:29 -07:00
Parker Moore
0920d2b48a LayoutReader#read: read in Theme layouts if they aren't already registered 2016-03-25 17:06:26 -07:00
Parker Moore
a30068bf3f Merge remote-tracking branch 'origin/master' into themes
* origin/master: (65 commits)
  Update history to reflect merge of #4703 [ci skip]
  Update history to reflect merge of #4712 [ci skip]
  Highlight the test code
  Update history to reflect merge of #4640 [ci skip]
  readded "env=prod"-condition
  Update history to reflect merge of #3849 [ci skip]
  Update history to reflect merge of #4624 [ci skip]
  Update history to reflect merge of #4704 [ci skip]
  Update history to reflect merge of #4706 [ci skip]
  Checks for link file extension in tests
  Updating assets documentation
  Fix test teardown for cleaner.
  Update history to reflect merge of #4542 [ci skip]
  Add explanation of site variables in the example _config.yml
  Use double quotes in the gemfile
  Add test for creation of Gemfile by 'jekyll new'
  Add comment about github-pages
  Update history to reflect merge of #4533 [ci skip]
  Ensure Rouge closes its div/figure properly after highlighting ends.
  Add Site#config= which can be used to set the config
  ...
2016-03-25 16:30:25 -07:00
Parker Moore
a1a4b3937a Add Layout#relative_path so the layout can tell us what its path is for error messages 2016-03-25 16:29:37 -07:00
Parker Moore
6aae64c985 Update test_theme.rb 2016-03-25 15:22:29 -07:00
Ben Balter
0f90fe67d2 but who will test the testers? 2016-03-25 15:00:42 -04:00
Ben Balter
4a70382d5b test that themes register with sass 2016-03-25 14:48:44 -04:00
Ben Balter
bdaa0c3b5b register sass path 2016-03-25 14:46:00 -04:00
Pierre Fenoll
f60d3a8dbc Allow symlinks iff they point to stuff inside site.source 2016-03-25 15:14:04 +01:00
Ben Balter
285aa54445 remove even more asset support 2016-03-11 16:18:11 -05:00
Parker Moore
ceace852b0 Merge pull request #4655 from spudowiar/themes
Fix invalid theme test, really
2016-03-11 13:05:07 -08:00
Saleem Rashid
64e4984ff5 theme: fix invalid theme test, really 2016-03-11 20:59:54 +00:00
Ben Balter
5f8ae36380 Merge pull request #4654 from spudowiar/themes
Fix invalid theme test
2016-03-11 15:52:57 -05:00
Saleem Rashid
7b63c8d201 theme: fix invalid theme test 2016-03-11 20:45:22 +00:00
Ben Balter
0a04932020 remove assets dir from theme fixture 2016-03-11 14:46:05 -05:00
Ben Balter
f89fbbe9e6 rebuild site 2016-03-11 14:45:14 -05:00
Ben Balter
e3c71ea407 Merge branch 'master' into themes 2016-03-11 14:44:44 -05:00
Ben Balter
1a203a0598 use variables in the docs 2016-03-11 14:43:44 -05:00
Ben Balter
92168954d2 remove asset support 2016-03-11 14:41:26 -05:00
Ben Balter
b29ce257c3 fix for history file title 2016-03-08 12:08:22 -05:00
Ben Balter
78acdc72e2 fix for history not having a title 2016-03-08 12:03:22 -05:00
Ben Balter
678d494d90 no GFM for you 2016-03-08 12:03:14 -05:00
Ben Balter
eb341514a7 use def_delegator 2016-03-08 11:55:16 -05:00
Ben Balter
e8617cf7cd better theme-not-found handling 2016-03-08 11:53:29 -05:00
Ben Balter
ea84ac9b04 use rocket hashes 2016-03-08 11:52:33 -05:00
Ben Balter
06ee9bcff4 remove title of history file 2016-03-08 11:52:17 -05:00
Ben Balter
c86fba6fb3 use /assets for theme assets, not _assets 2016-03-06 15:42:08 -05:00
Ben Balter
ff3df203c4 document how to use themes 2016-03-06 15:32:26 -05:00
Ben Balter
8b880cb993 add theme tests 2016-03-05 13:35:52 -05:00
Ben Balter
ada7c4f441 revert layout reader 2016-03-05 13:05:57 -05:00
Ben Balter
47416169c3 add sass path 2016-03-05 13:05:11 -05:00
Ben Balter
8bfb9e51f3 Merge branch 'master' into themes 2016-03-05 13:04:15 -05:00
Ben Balter
91b348966e add theme class 2016-02-26 14:25:29 -05:00
77 changed files with 1217 additions and 318 deletions

View File

@@ -49,7 +49,7 @@ That's it! You'll be automatically subscribed to receive updates as others revie
### Submitting a pull request via Git command line
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
2. Clone the repository lcoally `git clone https://github.com/<you-username>/jekyll`.
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
4. Hack away, add tests. Not necessarily in that order.
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)

View File

@@ -1,20 +1,78 @@
###### What version of Jekyll are you using (`jekyll -v`)?
<!--
Hi! Thanks for considering to file a bug with Jekyll. Please take the time to
answer the basic questions. You can convert `[ ]` into `[x]` to check boxes (or submit
and check.) If there is no need for certain fields like output and redirection, please delete
those headers before submitting. We know not all tickets require those steps.
Otherwise, please try to be as detailed as possible.
If you are unsure this is a bug in Jekyll, or this is a bug caused
by a plugin that isn't directly related to Jekyll, or if this is just
a generic usage question, please consider asking your question at
https://talk.jekyllrb.com where non-bug questions go.
Thanks!
-->
- [ ] I believe this to be a bug, not a question about using Jekyll.
- [ ] I Updated to the latest Jekyll (or) if on Github Pages to the latest `github-pages`
- [ ] I Read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
- [ ] This is a feature request.
---
###### What operating system are you using?
- [ ] I am on (or have tested on) ***Mac OS*** 10+
- [ ] I am on (or have tested on) ***Debian/Ubuntu*** GNU/Linux
- [ ] I am on (or have tested on) ***Fedora*** GNU/Linux
- [ ] I am on (or have tested on) ***Arch*** GNU/Linux
- [ ] I am on (or have tested on) ***Other*** GNU/Linux
- [ ] I am on (or have tested on) ***Windows*** 10+
<!--
Other GNU/Linux includes Scientific GNU/Linux, CentOS GNU/Linux, and others.
If you are on a minor sub-distro (such as ElementaryOS which does not diverge from
Ubuntu much, please check the parent distro. Kubuntu, Edubuntu, Lubuntu should
also be flagged as Ubuntu as their packages come from upstream Ubuntu.
-->
---
###### What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
- [ ] I was trying to install.
- [ ] There is a broken Plugin API.
- [ ] I had an error on Github Pages, and I have not tested locally.
- [ ] I had an error on Github Pages, and Github Support said it was a Jekyll Bug.
- [ ] I had an error on Github Pages and I did not test it locally.
- [ ] I was trying to build.
- [ ] It was another bug.
## My Reproduction Steps
<!--
If this error occured on Github Pages, please try to provide us with logs,
and look at them yourself, to determine if this is an actual Jekyll bug. In
the event you are unsure, file a ticket, however, when you do please provide
the logs (strip them of personal information.)
If you have trouble finding your logs, please email support@github.com and
they will happily help you. If you cannot find logs, please try your best to
replicate it locally because we cannot fix a problem if we do not know
exactly what caused it, or within a relatively close distance.
-->
###### What did you expect to see?
<!--
Insert the steps you took to for this problem to exist. Such as the
directories you created and, the full command you ran, and include any
plugins you have installed, this is very important.
If your steps are complicated, you can also submit a Github
repository (please no zips, they will be removed and rejected by maintainers,)
and just supply a command for us to reproduce it ourselves.
-->
## The Output I Wanted
###### What did you see instead?
<!--
Insert the output from the command. Alter it as little as you can.
The minimum should be personal information. Though we normally don't log
anything like that so there should be no need to alter it.
-->

View File

@@ -1,80 +1,235 @@
Metrics/MethodLength: { Max: 24 }
Metrics/ClassLength: { Max: 240 }
Metrics/ModuleLength: { Max: 240 }
Metrics/LineLength: { Max: 112 }
Metrics/CyclomaticComplexity: { Max: 8 }
Metrics/PerceivedComplexity: { Max: 8 }
Metrics/ParameterLists: { Max: 4 }
Metrics/MethodLength: { Max: 24 }
Metrics/AbcSize: { Max: 20 }
Style/IndentHash: { EnforcedStyle: consistent }
Style/HashSyntax: { EnforcedStyle: hash_rockets }
Style/SignalException: { EnforcedStyle: only_raise }
Style/AlignParameters: { EnforcedStyle: with_fixed_indentation }
Style/StringLiteralsInInterpolation: { EnforcedStyle: double_quotes }
Style/MultilineMethodCallIndentation: { EnforcedStyle: indented }
Style/MultilineOperationIndentation: { EnforcedStyle: indented }
Style/FirstParameterIndentation: { EnforcedStyle: consistent }
Style/StringLiterals: { EnforcedStyle: double_quotes }
Style/RegexpLiteral: { EnforcedStyle: slashes }
Style/IndentArray: { EnforcedStyle: consistent }
Style/ExtraSpacing: { AllowForAlignment: true }
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%q': '{}'
'%Q': '{}'
'%r': '!!'
'%s': '()'
'%w': '()'
'%W': '()'
'%x': '()'
Style/AlignArray: { Enabled: false }
Style/StringLiterals: { Enabled: false }
Style/Documentation: { Enabled: false }
Style/DoubleNegation: { Enabled: false }
Style/UnneededCapitalW: { Enabled: false }
Style/EmptyLinesAroundModuleBody: { Enabled: false }
Style/EmptyLinesAroundAccessModifier: { Enabled: false }
Style/BracesAroundHashParameters: { Enabled: false }
Style/SpaceInsideBrackets: { Enabled: false }
Style/IfUnlessModifier: { Enabled: false }
Style/ModuleFunction: { Enabled: false }
Style/RescueModifier: { Enabled: false }
Style/GuardClause: { Enabled: false }
Style/FileName: { Enabled: false }
Lint/UselessAccessModifier: { Enabled: false }
Style/SpaceAroundOperators: { Enabled: false }
Style/RedundantReturn: { Enabled: false }
Style/SingleLineMethods: { Enabled: false }
---
AllCops:
TargetRubyVersion: 2.0
Include:
- lib/**/*.rb
Exclude:
- .rubocop.yml
- .codeclimate.yml
- .travis.yml
- .gitignore
- .rspec
- Gemfile.lock
- CHANGELOG.{md,markdown,txt,textile}
- CONTRIBUTING.{md,markdown,txt,textile}
- readme.{md,markdown,txt,textile}
- README.{md,markdown,txt,textile}
- Readme.{md,markdown,txt,textile}
- ReadMe.{md,markdown,txt,textile}
- COPYING
- LICENSE
- site/**/*
- test/**/*
- vendor/**/*
- features/**/*
- lib/jekyll/collection.rb
- lib/jekyll/command.rb
- lib/jekyll/commands/build.rb
- lib/jekyll/commands/clean.rb
- lib/jekyll/commands/doctor.rb
- lib/jekyll/commands/help.rb
- lib/jekyll/commands/new.rb
- lib/jekyll/commands/serve
- lib/jekyll/commands/serve/servlet.rb
- lib/jekyll/commands/serve.rb
- lib/jekyll/configuration.rb
- lib/jekyll/converter.rb
- lib/jekyll/converters/identity.rb
- lib/jekyll/converters/markdown
- lib/jekyll/converters/markdown/kramdown_parser.rb
- lib/jekyll/converters/markdown/rdiscount_parser.rb
- lib/jekyll/converters/markdown/redcarpet_parser.rb
- lib/jekyll/converters/markdown.rb
- lib/jekyll/converters/smartypants.rb
- lib/jekyll/convertible.rb
- lib/jekyll/deprecator.rb
- lib/jekyll/document.rb
- lib/jekyll/drops/collection_drop.rb
- lib/jekyll/drops/document_drop.rb
- lib/jekyll/drops/drop.rb
- lib/jekyll/drops/jekyll_drop.rb
- lib/jekyll/drops/site_drop.rb
- lib/jekyll/drops/unified_payload_drop.rb
- lib/jekyll/drops/url_drop.rb
- lib/jekyll/entry_filter.rb
- lib/jekyll/errors.rb
- lib/jekyll/excerpt.rb
- lib/jekyll/external.rb
- lib/jekyll/filters.rb
- lib/jekyll/frontmatter_defaults.rb
- lib/jekyll/generator.rb
- lib/jekyll/hooks.rb
- lib/jekyll/layout.rb
- lib/jekyll/liquid_extensions.rb
- lib/jekyll/liquid_renderer/file.rb
- lib/jekyll/liquid_renderer/table.rb
- lib/jekyll/liquid_renderer.rb
- lib/jekyll/log_adapter.rb
- lib/jekyll/page.rb
- lib/jekyll/plugin.rb
- lib/jekyll/plugin_manager.rb
- lib/jekyll/publisher.rb
- lib/jekyll/reader.rb
- lib/jekyll/readers/collection_reader.rb
- lib/jekyll/readers/data_reader.rb
- lib/jekyll/readers/layout_reader.rb
- lib/jekyll/readers/page_reader.rb
- lib/jekyll/readers/post_reader.rb
- lib/jekyll/readers/static_file_reader.rb
- lib/jekyll/regenerator.rb
- lib/jekyll/related_posts.rb
- lib/jekyll/renderer.rb
- lib/jekyll/site.rb
- lib/jekyll/static_file.rb
- lib/jekyll/stevenson.rb
- lib/jekyll/tags/highlight.rb
- lib/jekyll/tags/include.rb
- lib/jekyll/tags/link.rb
- lib/jekyll/tags/post_url.rb
- lib/jekyll/theme.rb
- lib/jekyll/url.rb
- lib/jekyll/utils/ansi.rb
- lib/jekyll/utils/platforms.rb
- lib/jekyll/utils.rb
- lib/jekyll/version.rb
- lib/jekyll.rb
- features/step_definitions.rb
- features/support/formatter.rb
- features/support/helpers.rb
- test/helper.rb
- test/simplecov_custom_profile.rb
- test/test_ansi.rb
- test/test_cleaner.rb
- test/test_coffeescript.rb
- test/test_collections.rb
- test/test_command.rb
- test/test_commands_serve.rb
- test/test_configuration.rb
- test/test_convertible.rb
- test/test_doctor_command.rb
- test/test_document.rb
- test/test_entry_filter.rb
- test/test_excerpt.rb
- test/test_filters.rb
- test/test_front_matter_defaults.rb
- test/test_generated_site.rb
- test/test_kramdown.rb
- test/test_layout_reader.rb
- test/test_liquid_extensions.rb
- test/test_liquid_renderer.rb
- test/test_log_adapter.rb
- test/test_new_command.rb
- test/test_page.rb
- test/test_path_sanitization.rb
- test/test_plugin_manager.rb
- test/test_rdiscount.rb
- test/test_redcarpet.rb
- test/test_regenerator.rb
- test/test_related_posts.rb
- test/test_sass.rb
- test/test_site.rb
- test/test_static_file.rb
- test/test_tags.rb
- test/test_theme.rb
- test/test_url.rb
- test/test_utils.rb
- bin/**/*
- benchmark/**/*
- script/**/*
- spec/**/*
- vendor/**/*
Lint/EndAlignment:
Severity: error
Lint/UnreachableCode:
Severity: error
Lint/UselessAccessModifier:
Enabled: false
Metrics/AbcSize:
Max: 20
Metrics/ClassLength:
Max: 240
Exclude:
- !ruby/regexp /features\/.*.rb$/
Metrics/CyclomaticComplexity:
Max: 8
Metrics/LineLength:
Max: 90
Severity: warning
Exclude:
- !ruby/regexp /features\/.*.rb/
Metrics/MethodLength:
Max: 20
CountComments: false
Severity: error
Metrics/ModuleLength:
Max: 240
Metrics/ParameterLists:
Max: 4
Metrics/PerceivedComplexity:
Max: 8
Style/Alias:
Enabled: false
Style/AlignArray:
Enabled: false
Style/AlignHash:
SupportedLastArgumentHashStyles: always_ignore
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation
Enabled: false
Style/AndOr:
Severity: error
Style/Attr:
Enabled: false
Style/BracesAroundHashParameters:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
Exclude:
- !ruby/regexp /features\/.*.rb$/
Style/DoubleNegation:
Enabled: false
Style/EmptyLinesAroundAccessModifier:
Enabled: false
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/ExtraSpacing:
AllowForAlignment: true
Style/FileName:
Enabled: false
Style/FirstParameterIndentation:
EnforcedStyle: consistent
Style/GuardClause:
Enabled: false
Style/HashSyntax:
EnforcedStyle: hash_rockets
Severity: error
Style/IfUnlessModifier:
Enabled: false
Style/IndentArray:
EnforcedStyle: consistent
Style/IndentHash:
EnforcedStyle: consistent
Style/IndentationWidth:
Severity: error
Style/ModuleFunction:
Enabled: false
Style/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/MultilineOperationIndentation:
EnforcedStyle: indented
Style/MultilineTernaryOperator:
Severity: error
Style/PercentLiteralDelimiters:
PreferredDelimiters:
"%q": "{}"
"%Q": "{}"
"%r": "!!"
"%s": "()"
"%w": "()"
"%W": "()"
"%x": "()"
Style/RedundantReturn:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/RegexpLiteral:
EnforcedStyle: slashes
Style/RescueModifier:
Enabled: false
Style/SignalException:
EnforcedStyle: only_raise
Style/SingleLineMethods:
Enabled: false
Style/SpaceAroundOperators:
Enabled: false
Style/SpaceInsideBrackets:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/UnneededCapitalW:
Enabled: false

View File

@@ -9,7 +9,7 @@ rvm:
- &ruby1 2.3.0
- &ruby2 2.2.4
- &ruby3 2.1.8
- &jruby jruby-9.0.4.0
- &jruby jruby-9.0.5.0
- &rhead ruby-head
matrix:
@@ -17,6 +17,9 @@ matrix:
allow_failures:
- rvm: *jruby
- rvm: *rhead
include:
- rvm: 2.3.0
env: TEST_SUITE=fmt
env:
matrix:
- TEST_SUITE=test
@@ -25,12 +28,9 @@ env:
branches:
only:
- master
- themes
notifications:
irc:
template: "%{repository}#%{build_number} (%{branch}) %{message} %{build_url}"
channels: irc.freenode.org#jekyll
email:
recipients:
- jordon@envygeeks.io

View File

@@ -4,7 +4,6 @@ gemspec :name => "jekyll"
gem "rake", "~> 11.0"
group :development do
gem "launchy", "~> 2.3"
gem "rubocop", :branch => :master, :github => "bbatsov/rubocop"
gem "pry"
unless RUBY_ENGINE == "jruby"
@@ -15,6 +14,7 @@ end
#
group :test do
gem "rubocop"
gem "cucumber", "~> 2.1"
gem "jekyll_test_plugin"
gem "jekyll_test_plugin_malicious"
@@ -22,6 +22,7 @@ group :test do
gem "rspec-mocks"
gem "nokogiri"
gem "rspec"
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
end
#

View File

@@ -19,6 +19,12 @@
* Allow static files to be symlinked in unsafe mode or non-prod environments (#4640)
* Add `:after_init` hook & add `Site#config=` to make resetting config easy (#4703)
* DocumentDrop: add `#<=>` which sorts by date (falling back to path) (#4741)
* Add a where_exp filter for filtering by expression (#4478)
* Globalize Jekyll's Filters. (#4792)
* Gem-based themes (#4595)
* Allow symlinks if they point to stuff inside site.source (#4710)
* Update colorator dependency to v1.x (#4855)
* Move EntryFilter to use Pathutil & fix `glob_include?` (#4859)
### Bug Fixes
@@ -30,6 +36,11 @@
* Ensures related_posts are only set for a post (#4620)
* EntryFilter#special?: ignore filenames which begin with '~' (#4491)
* Cleaner: `keep_files` should only apply to the beginning of paths, not substrings with index > 0 (#3849)
* Use SSLEnable instead of EnableSSL and make URL HTTPS. (#4693)
* convertible: use Document::YAML_FRONT_MATTER_REGEXP to parse transformable files (#4786)
* Example in the site template should be IANA-approved example.com (#4793)
* 3.2.x/master: Fix defaults for Documents (posts/collection docs) (#4808)
* Don't rescue LoadError or bundler load errors for Bundler. (#4857)
### Development Fixes
@@ -41,6 +52,10 @@
* Update Rake & disable warnings when running tests (#4720)
* Fix many warnings (#4537)
* Don't blindly assume the last system when determining "open" cmd (#4717)
* Fix "locally" typo in contributing documentation (#4756)
* Update Rubocop rules (#4886)
* Flesh out the issue template to be much more detailed (#4849)
* Fixing rubocop offenses in lib/jekyll/cleaner.rb (#4892)
### Site Enhancements
@@ -65,6 +80,27 @@
* Add Hawkins to the list of third-party plugins (#4755)
* Fix a typo in pagination doc (#4763)
* Switch second GitHub Pages link to HTTPS (#4760)
* Explain data file format requirements more clearly in documentation (#4781)
* Add jekyll-i18n_tags to list of third-party plugins (#4775)
* Remove Leonard Lamprecht's website from Sites page (#4771)
* Updates documentation for collections to include `date` property (#4769)
* Added an explicit rerun note to configuration.md, defaults section (#4734)
* Update Rack-Jekyll Heroku deployment blog post url (#4789)
* Added missing single quote on rsync client side command (#4813)
* Organize Form Platforms-as-a-Service into unified list & add FormSpree.io (#4754)
* Fixed typo on Configuration page (#4804)
* Update FormKeep URL on the Resources doc (#4844)
* site: use liquid & reduce some whitespace noise (#4854)
* Add jekyll-breadcrumbs to list of third-party plugins (#4874)
* Added Pug converter to list of third-party plugins (#4872)
* Add jekyll-ideal-image-slider to list of third-party plugins (#4863)
* Add Jekyll Tips and the Cheatsheet to the list of resources (#4887)
* Removed extra `</p>` from `site/_docs/permalinks.md` (#4890)
## 3.1.3 / 2016-04-18
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4807)
* Use SSLEnable instead of EnableSSL and make URL HTTPS (WEBrick) (#4693)
## 3.1.2 / 2016-02-19
@@ -213,6 +249,15 @@
* Add Contentful Extension to list of third-party plugins (#4390)
* Correct Minor spelling error (#4394)
## 3.0.5 / 2016-04-26
* Remove call to `#backwards_compatibilize` in `Configuration.from` (#4846)
## 3.0.4 / 2016-04-18
* Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` (#4806)
* Configuration: allow users to specify a `collections.posts.permalink` directly without `permalink` clobbering it (#4753)
## 3.0.3 / 2016-02-08
### Bug Fixes

View File

@@ -80,6 +80,26 @@ Feature: frontmatter defaults
And I should see "main: <p>content of site/special/2013/10/14/about1.html</p>" in "_site/special/2013/10/14/about1.html"
And I should see "main: <p>content of site/special/2013/10/14/about2.html</p>" in "_site/special/2013/10/14/about2.html"
Scenario: Use frontmatter scopes for subdirectories
Given I have a _layouts directory
And I have a main layout that contains "main: {{ content }}"
And I have a _posts/en directory
And I have the following post under "en":
| title | date | content |
| helloworld | 2014-09-01 | {{page.lang}} is the current language |
And I have a _posts/de directory
And I have the following post under "de":
| title | date | content |
| hallowelt | 2014-09-01 | {{page.lang}} is the current language |
And I have a configuration file with "defaults" set to "[{scope: {path: "_posts/en"}, values: {layout: "main", lang: "en"}}, {scope: {path: "_posts/de"}, values: {layout: "main", lang: "de"}}]"
When I run jekyll build
Then the _site directory should exist
And I should see "main: <p>en is the current language</p>" in "_site/2014/09/01/helloworld.html"
And I should see "main: <p>de is the current language</p>" in "_site/2014/09/01/hallowelt.html"
Scenario: Override frontmatter defaults by type
Given I have a _posts directory
And I have the following post:

View File

@@ -82,9 +82,9 @@ module Jekyll
#
def background_name(keyword, name, source_line, indend)
def background_name(keyword, name, source_line, indent)
print_feature_element_name(
keyword, name, source_line, indend
keyword, name, source_line, indent
)
end

61
features/theme.feature Normal file
View File

@@ -0,0 +1,61 @@
Feature: Writing themes
As a hacker who likes to share my expertise
I want to be able to make a gemified theme
In order to share my awesome style skillz with other Jekyllites
Scenario: A theme with SCSS
Given I have a configuration file with "theme" set to "test-theme"
And I have a css directory
And I have a "css/main.scss" page that contains "@import 'style';"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see ".sample {\n color: black; }" in "_site/css/main.css"
Scenario: A theme with an include
Given I have a configuration file with "theme" set to "test-theme"
And I have an _includes directory
And I have an "_includes/in_project.html" file that contains "I'm in the project."
And I have an "index.html" page that contains "{% include in_project.html %} {% include include.html %}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "I'm in the project." in "_site/index.html"
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/index.html"
Scenario: A theme with a layout
Given I have a configuration file with "theme" set to "test-theme"
And I have an _layouts directory
And I have an "_layouts/post.html" file that contains "post.html from the project: {{ content }}"
And I have an "index.html" page with layout "default" that contains "I'm content."
And I have a "post.html" page with layout "post" that contains "I'm more content."
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "default.html from test-theme: I'm content." in "_site/index.html"
And I should see "post.html from the project: I'm more content." in "_site/post.html"
Scenario: Complicated site that puts it all together
Given I have a configuration file with "theme" set to "test-theme"
And I have a _posts directory
And I have the following posts:
| title | date | layout | content |
| entry1 | 2016-04-21 | post | I am using a local layout. {% include include.html %} |
| entry2 | 2016-04-21 | default | I am using a themed layout. {% include include.html %} {% include in_project.html %} |
And I have a _layouts directory
And I have a "_layouts/post.html" page with layout "default" that contains "I am a post layout! {{ content }}"
And I have an _includes directory
And I have an "_includes/in_project.html" file that contains "I am in the project, not the theme."
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "I am in the project, not the theme." in "_site/2016/04/21/entry2.html"
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry2.html"
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry2.html"
And I should see "I am using a themed layout." in "_site/2016/04/21/entry2.html"
And I should not see "I am a post layout!" in "_site/2016/04/21/entry2.html"
And I should not see "I am in the project, not the theme." in "_site/2016/04/21/entry1.html"
And I should see "<span class=\"sample\">include.html from test-theme</span>" in "_site/2016/04/21/entry1.html"
And I should see "default.html from test-theme:" in "_site/2016/04/21/entry1.html"
And I should see "I am using a local layout." in "_site/2016/04/21/entry1.html"
And I should see "I am a post layout!" in "_site/2016/04/21/entry1.html"

View File

@@ -32,8 +32,9 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('kramdown', '~> 1.3')
s.add_runtime_dependency('mercenary', '~> 0.3.3')
s.add_runtime_dependency('safe_yaml', '~> 1.0')
s.add_runtime_dependency('colorator', '~> 0.1')
s.add_runtime_dependency('colorator', '~> 1.0')
s.add_runtime_dependency('rouge', '~> 1.7')
s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0')
s.add_runtime_dependency('jekyll-watch', '~> 1.1')
s.add_runtime_dependency("pathutil", "~> 0.12")
end

View File

@@ -14,13 +14,18 @@ end
# rubygems
require 'rubygems'
require "pathname"
# DO NOT MERGE THIS COMMIT.
require "pathutil"
Pathname = Pathutil
# stdlib
require 'forwardable'
require 'fileutils'
require 'time'
require 'English'
require 'pathname'
require 'logger'
require 'set'
@@ -45,7 +50,6 @@ module Jekyll
autoload :Errors, 'jekyll/errors'
autoload :Excerpt, 'jekyll/excerpt'
autoload :External, 'jekyll/external'
autoload :Filters, 'jekyll/filters'
autoload :FrontmatterDefaults, 'jekyll/frontmatter_defaults'
autoload :Hooks, 'jekyll/hooks'
autoload :Layout, 'jekyll/layout'
@@ -67,6 +71,7 @@ module Jekyll
autoload :Site, 'jekyll/site'
autoload :StaticFile, 'jekyll/static_file'
autoload :Stevenson, 'jekyll/stevenson'
autoload :Theme, 'jekyll/theme'
autoload :URL, 'jekyll/url'
autoload :Utils, 'jekyll/utils'
autoload :VERSION, 'jekyll/version'
@@ -77,6 +82,7 @@ module Jekyll
require 'jekyll/generator'
require 'jekyll/command'
require 'jekyll/liquid_extensions'
require "jekyll/filters"
class << self
# Public: Tells you which Jekyll environment you are building in so you can skip tasks

View File

@@ -1,9 +1,9 @@
require 'set'
require "set"
module Jekyll
# Handles the cleanup of a site's destination before it is built.
class Cleaner
HIDDEN_FILE_REGEX = /\/\.{1,2}$/
HIDDEN_FILE_REGEX = %r!\/\.{1,2}$!
attr_reader :site
def initialize(site)
@@ -32,7 +32,8 @@ module Jekyll
[site.regenerator.metadata_file]
end
# Private: The list of existing files, apart from those included in keep_files and hidden files.
# Private: The list of existing files, apart from those included in
# keep_files and hidden files.
#
# Returns a Set with the file paths
def existing_files
@@ -77,15 +78,16 @@ module Jekyll
end
end
# Private: The list of existing files that will be replaced by a directory during build
# Private: The list of existing files that will be replaced by a directory
# during build
#
# Returns a Set with the file paths
def replaced_files
new_dirs.select { |dir| File.file?(dir) }.to_set
end
# Private: The list of directories that need to be kept because they are parent directories
# of files specified in keep_files
# Private: The list of directories that need to be kept because they are
# parent directories of files specified in keep_files
#
# Returns a Set with the directory paths
def keep_dirs
@@ -95,12 +97,12 @@ module Jekyll
# Private: Creates a regular expression from the config's keep_files array
#
# Examples
# ['.git','.svn'] with site.dest "/myblog/_site" creates
# ['.git','.svn'] with site.dest "/myblog/_site" creates
# the following regex: /\A\/myblog\/_site\/(\.git|\/.svn)/
#
# Returns the regular expression
def keep_file_regex
/\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/
%r!\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})!
end
end
end

View File

@@ -94,7 +94,7 @@ module Jekyll
Dir.chdir(directory) do
entry_filter.filter(entries).reject do |f|
path = collection_dir(f)
File.directory?(path) || (File.symlink?(f) && site.safe)
File.directory?(path) || entry_filter.symlink?(f)
end
end
end
@@ -135,7 +135,7 @@ module Jekyll
# Returns false if the directory doesn't exist or if it's a symlink
# and we're in safe mode.
def exists?
File.directory?(directory) && !(File.symlink?(directory) && site.safe)
File.directory?(directory) && !entry_filter.symlink?(directory)
end
# The entry filter for this collection.

View File

@@ -35,7 +35,7 @@ module Jekyll
File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f|
f.write(scaffold_post_content)
end
File.open(File.expand_path("Gemfile", new_blog_path), "w") do |f|
f.write(gemfile_contents)
end
@@ -63,11 +63,12 @@ module Jekyll
end
private
def gemfile_contents
<<-RUBY
source "https://rubygems.org"
ruby RUBY_VERSION
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
@@ -81,7 +82,7 @@ gem "jekyll", "#{Jekyll::VERSION}"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
# group :jekyll_plugins do
# gem "jekyll-github-metadata", "~> 1.0"

View File

@@ -116,11 +116,12 @@ module Jekyll
private
def server_address(server, opts)
address = server.config[:BindAddress]
baseurl = "#{opts["baseurl"]}/" if opts["baseurl"]
port = server.config[:Port]
"http://#{address}:#{port}#{baseurl}"
"%{prefix}://%{address}:%{port}%{baseurl}" % {
:prefix => server.config[:SSLEnable] ? "https" : "http",
:baseurl => opts["baseurl"] ? "#{opts["baseurl"]}/" : "",
:address => server.config[:BindAddress],
:port => server.config[:Port]
}
end
#
@@ -182,7 +183,7 @@ module Jekyll
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(File.read(source_key))
opts[:EnableSSL] = true
opts[:SSLEnable] = true
end
private

View File

@@ -286,8 +286,8 @@ module Jekyll
def renamed_key(old, new, config, _ = nil)
if config.key?(old)
Jekyll::Deprecator.deprecation_message "The '#{old}' configuration" \
"option has been renamed to '#{new}'. Please update your config " \
"file accordingly."
" option has been renamed to '#{new}'. Please update your config" \
" file accordingly."
config[new] = config.delete(old)
end
end

View File

@@ -39,9 +39,9 @@ module Jekyll
filename = File.join(base, name)
begin
self.content = File.read(site.in_source_dir(base, name),
self.content = File.read(@path || site.in_source_dir(base, name),
Utils.merged_file_read_opts(site, opts))
if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
if content =~ Document::YAML_FRONT_MATTER_REGEXP
self.content = $POSTMATCH
self.data = SafeYAML.load(Regexp.last_match(1))
end
@@ -215,9 +215,9 @@ module Jekyll
payload["layout"] = Utils.deep_merge_hashes(payload["layout"] || {}, layout.data)
self.output = render_liquid(layout.content,
payload,
info,
File.join(site.config['layouts_dir'], layout.name))
payload,
info,
layout.relative_path)
# Add layout to dependency tree
site.regenerator.add_dependency(

View File

@@ -263,7 +263,7 @@ module Jekyll
@data = SafeYAML.load_file(path)
else
begin
defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
defaults = @site.frontmatter_defaults.all(relative_path, collection.label.to_sym)
merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))

View File

@@ -1,12 +1,15 @@
module Jekyll
class EntryFilter
SPECIAL_LEADING_CHARACTERS = ['.', '_', '#', '~'].freeze
attr_reader :site
SPECIAL_LEADING_CHARACTERS = [
'.', '_', '#', '~'
].freeze
def initialize(site, base_directory = nil)
@site = site
@base_directory = derive_base_directory(@site, base_directory.to_s.dup)
@base_directory = derive_base_directory(
@site, base_directory.to_s.dup
)
end
def base_directory
@@ -14,14 +17,14 @@ module Jekyll
end
def derive_base_directory(site, base_dir)
if base_dir.start_with?(site.source)
base_dir[site.source] = ""
end
base_dir[site.source] = "" if base_dir.start_with?(site.source)
base_dir
end
def relative_to_source(entry)
File.join(base_directory, entry)
File.join(
base_directory, entry
)
end
def filter(entries)
@@ -33,7 +36,9 @@ module Jekyll
end
def included?(entry)
glob_include?(site.include, entry)
glob_include?(site.include,
entry
)
end
def special?(entry)
@@ -51,21 +56,62 @@ module Jekyll
excluded
end
# --
# Check if a file is a symlink.
# NOTE: This can be converted to allowing even in safe,
# since we use Pathutil#in_path? now.
# --
def symlink?(entry)
File.symlink?(entry) && site.safe
site.safe && File.symlink?(entry) && symlink_outside_site_source?(entry)
end
def ensure_leading_slash(path)
path[0..0] == "/" ? path : "/#{path}"
# --
# NOTE: Pathutil#in_path? gets the realpath.
# @param [<Anything>] entry the entry you want to validate.
# Check if a path is outside of our given root.
# --
def symlink_outside_site_source?(entry)
!Pathutil.new(entry).in_path?(
site.in_source_dir
)
end
# --
# Check if an entry matches a specific pattern and return true,false.
# Returns true if path matches against any glob pattern.
# Look for more detail about glob pattern in method File::fnmatch.
# --
def glob_include?(enum, e)
entry = ensure_leading_slash(e)
entry = Pathutil.new(site.in_source_dir).join(e)
enum.any? do |exp|
item = ensure_leading_slash(exp)
File.fnmatch?(item, entry) || entry.start_with?(item)
# Users who send a Regexp knows what they want to
# exclude, so let them send a Regexp to exclude files,
# we will not bother caring if it works or not, it's
# on them at this point.
if exp.is_a?(Regexp)
entry =~ exp
else
item = Pathutil.new(site.in_source_dir).join(exp)
# If it's a directory they want to exclude, AKA
# ends with a "/" then we will go on to check and
# see if the entry falls within that path and
# exclude it if that's the case.
if e.end_with?("/")
entry.in_path?(
item
)
else
File.fnmatch?(item, entry) ||
entry.to_path.start_with?(
item
)
end
end
end
end
end

View File

@@ -1,6 +1,7 @@
require 'uri'
require 'json'
require 'date'
require 'liquid'
module Jekyll
module Filters
@@ -225,6 +226,26 @@ module Jekyll
input.select { |object| Array(item_property(object, property)).map(&:to_s).include?(value.to_s) }
end
# Filters an array of objects against an expression
#
# input - the object array
# variable - the variable to assign each item to in the expression
# expression - a Liquid comparison expression passed in as a string
#
# Returns the filtered array of objects
def where_exp(input, variable, expression)
return input unless input.is_a?(Enumerable)
input = input.values if input.is_a?(Hash) # FIXME
condition = parse_condition(expression)
@context.stack do
input.select do |object|
@context[variable] = object
condition.evaluate(@context)
end
end
end
# Sort an array of objects
#
# input - the object array
@@ -363,5 +384,25 @@ module Jekyll
end
end
end
# Parse a string to a Liquid Condition
def parse_condition(exp)
parser = Liquid::Parser.new(exp)
left_expr = parser.expression
operator = parser.consume?(:comparison)
condition =
if operator
Liquid::Condition.new(left_expr, operator, parser.expression)
else
Liquid::Condition.new(left_expr)
end
parser.consume(:end_of_string)
condition
end
end
end
Liquid::Template.register_filter(
Jekyll::Filters
)

View File

@@ -29,7 +29,14 @@ module Jekyll
@site = site
@base = base
@name = name
@path = site.in_source_dir(base, name)
if site.theme && site.theme.layouts_path.eql?(base)
@base_dir = site.theme.root
@path = site.in_theme_dir(base, name)
else
@base_dir = site.source
@path = site.in_source_dir(base, name)
end
self.data = {}
@@ -45,5 +52,13 @@ module Jekyll
def process(name)
self.ext = File.extname(name)
end
# The path to the layout, relative to the site source.
#
# Returns a String path which represents the relative path
# from the site source to this layout
def relative_path
@relative_path ||= Pathname.new(path).relative_path_from(Pathname.new(@base_dir)).to_s
end
end
end

View File

@@ -40,6 +40,7 @@ module Jekyll
@base = base
@dir = dir
@name = name
@path = site.in_source_dir(base, dir, name)
process(name)
read_yaml(File.join(base, dir), name)

View File

@@ -30,16 +30,16 @@ module Jekyll
def self.require_from_bundler
if !ENV["JEKYLL_NO_BUNDLER_REQUIRE"] && File.file?("Gemfile")
require "bundler"
Bundler.setup # puts all groups on the load path
required_gems = Bundler.require(:jekyll_plugins) # requires the gems in this group only
Bundler.setup
required_gems = Bundler.require(:jekyll_plugins)
Jekyll.logger.debug("PluginManager:", "Required #{required_gems.map(&:name).join(', ')}")
ENV["JEKYLL_NO_BUNDLER_REQUIRE"] = "true"
true
else
false
end
rescue LoadError, Bundler::GemfileNotFound
false
end
# Check whether a gem plugin is allowed to be used during this build.

View File

@@ -4,6 +4,7 @@ module Jekyll
def initialize(site)
@site = site
@content = {}
@entry_filter = EntryFilter.new(site)
end
# Read all the files in <source>/<dir>/_drafts and create a new Draft
@@ -26,7 +27,7 @@ module Jekyll
#
# Returns nothing
def read_data_to(dir, data)
return unless File.directory?(dir) && (!site.safe || !File.symlink?(dir))
return unless File.directory?(dir) && !@entry_filter.symlink?(dir)
entries = Dir.chdir(dir) do
Dir['*.{yaml,yml,json,csv}'] + Dir['*'].select { |fn| File.directory?(fn) }
@@ -34,7 +35,7 @@ module Jekyll
entries.each do |entry|
path = @site.in_source_dir(dir, entry)
next if File.symlink?(path) && site.safe
next if @entry_filter.symlink?(path)
key = sanitize_filename(File.basename(entry, '.*'))
if File.directory?(path)

View File

@@ -7,8 +7,12 @@ module Jekyll
end
def read
layout_entries.each do |f|
@layouts[layout_name(f)] = Layout.new(site, layout_directory, f)
layout_entries.each do |layout_file|
@layouts[layout_name(layout_file)] = Layout.new(site, layout_directory, layout_file)
end
theme_layout_entries.each do |layout_file|
@layouts[layout_name(layout_file)] ||= Layout.new(site, theme_layout_directory, layout_file)
end
@layouts
@@ -18,11 +22,23 @@ module Jekyll
@layout_directory ||= (layout_directory_in_cwd || layout_directory_inside_source)
end
def theme_layout_directory
@theme_layout_directory ||= site.theme.layouts_path if site.theme
end
private
def layout_entries
entries_in layout_directory
end
def theme_layout_entries
theme_layout_directory ? entries_in(theme_layout_directory) : []
end
def entries_in(dir)
entries = []
within(layout_directory) do
within(dir) do
entries = EntryFilter.new(site).filter(Dir['**/*.*'])
end
entries

View File

@@ -52,7 +52,6 @@ module Jekyll
document.trigger_hooks(:pre_render, payload)
info = {
:filters => [Jekyll::Filters],
:registers => { :site => site, :page => payload['page'] }
}
@@ -146,7 +145,7 @@ module Jekyll
layout.content,
payload,
info,
File.join(site.config['layouts_dir'], layout.name)
layout.relative_path
)
# Add layout to dependency tree

View File

@@ -8,10 +8,10 @@ module Jekyll
:exclude, :include, :lsi, :highlighter, :permalink_style,
:time, :future, :unpublished, :safe, :plugins, :limit_posts,
:show_drafts, :keep_files, :baseurl, :data, :file_read_opts,
:gems, :plugin_manager
:gems, :plugin_manager, :theme
attr_accessor :converters, :generators, :reader
attr_reader :regenerator, :liquid_renderer
attr_reader :regenerator, :liquid_renderer, :includes_load_paths
# Public: Initialize a new Site.
#
@@ -52,6 +52,12 @@ module Jekyll
self.plugin_manager = Jekyll::PluginManager.new(self)
self.plugins = plugin_manager.plugins_path
self.theme = nil
self.theme = Jekyll::Theme.new(config["theme"]) if config["theme"]
@includes_load_paths = Array(in_source_dir(config["includes_dir"].to_s))
@includes_load_paths << theme.includes_path if self.theme
self.file_read_opts = {}
self.file_read_opts[:encoding] = config['encoding'] if config['encoding']
@@ -367,6 +373,19 @@ module Jekyll
end
end
# Public: Prefix a given path with the theme directory.
#
# paths - (optional) path elements to a file or directory within the
# theme directory
#
# Returns a path which is prefixed with the theme root directory.
def in_theme_dir(*paths)
return nil unless theme
paths.reduce(theme.root) do |base, path|
Jekyll.sanitized_path(base, path)
end
end
# Public: Prefix a given path with the destination directory.
#
# paths - (optional) path elements to a file or directory within the

View File

@@ -12,8 +12,6 @@ module Jekyll
end
class IncludeTag < Liquid::Tag
attr_reader :includes_dir
VALID_SYNTAX = /([\w-]+)\s*=\s*(?:"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([\w\.-]+))/
VARIABLE_SYNTAX = /(?<variable>[^{]*(\{\{\s*[\w\-\.]+\s*(\|.*)?\}\}[^\s{}]*)+)(?<params>.*)/
@@ -98,20 +96,29 @@ eos
end
end
def tag_includes_dir(context)
context.registers[:site].config['includes_dir'].freeze
def tag_includes_dirs(context)
context.registers[:site].includes_load_paths.freeze
end
def locate_include_file(context, file, safe)
includes_dirs = tag_includes_dirs(context)
includes_dirs.each do |dir|
path = File.join(dir, file)
return path if valid_include_file?(path, dir, safe)
end
raise IOError, "Could not locate the included file '#{file}' in any of #{includes_dirs}." \
" Ensure it exists in one of those directories and, if it is a symlink, " \
"does not point outside your site source."
end
def render(context)
site = context.registers[:site]
@includes_dir = tag_includes_dir(context)
dir = resolved_includes_dir(context)
file = render_variable(context) || @file
validate_file_name(file)
path = File.join(dir, file)
validate_path(path, dir, site.safe)
path = locate_include_file(context, file, site.safe)
return unless path
# Add include to dependency tree
if context.registers[:page] && context.registers[:page].key?("path")
@@ -121,16 +128,16 @@ eos
)
end
begin
#begin
partial = load_cached_partial(path, context)
context.stack do
context['include'] = parse_params(context) if @params
partial.render!(context)
end
rescue => e
raise IncludeTagError.new e.message, File.join(@includes_dir, @file)
end
#rescue => e
#raise IncludeTagError.new e.message, path
#end
end
def load_cached_partial(path, context)
@@ -144,24 +151,18 @@ eos
end
end
def resolved_includes_dir(context)
context.registers[:site].in_source_dir(@includes_dir)
def valid_include_file?(path, dir, safe)
!(outside_site_source?(path, dir, safe) || !File.exist?(path))
end
def validate_path(path, dir, safe)
if safe && !realpath_prefixed_with?(path, dir)
raise IOError.new "The included file '#{path}' should exist and should not be a symlink"
elsif !File.exist?(path)
raise IOError.new "Included file '#{path_relative_to_source(dir, path)}' not found"
end
end
def path_relative_to_source(dir, path)
File.join(@includes_dir, path.sub(Regexp.new("^#{dir}"), ""))
def outside_site_source?(path, dir, safe)
safe && !realpath_prefixed_with?(path, dir)
end
def realpath_prefixed_with?(path, dir)
File.exist?(path) && File.realpath(path).start_with?(dir)
rescue
false
end
# This method allows to modify the file content by inheriting from the class.
@@ -171,16 +172,17 @@ eos
end
class IncludeRelativeTag < IncludeTag
def tag_includes_dir(context)
'.'.freeze
def tag_includes_dirs(context)
Array(page_path(context)).freeze
end
def page_path(context)
context.registers[:page].nil? ? includes_dir : File.dirname(context.registers[:page]["path"])
end
def resolved_includes_dir(context)
context.registers[:site].in_source_dir(page_path(context))
if context.registers[:page].nil?
context.registers[:site].source
else
current_doc_dir = File.dirname(context.registers[:page]["path"])
context.registers[:site].in_source_dir current_doc_dir
end
end
end
end

56
lib/jekyll/theme.rb Normal file
View File

@@ -0,0 +1,56 @@
module Jekyll
class Theme
extend Forwardable
attr_reader :name
def_delegator :gemspec, :version, :version
def initialize(name)
@name = name.downcase.strip
configure_sass
end
def root
@root ||= gemspec.full_gem_path
end
def includes_path
path_for :includes
end
def layouts_path
path_for :layouts
end
def sass_path
path_for :sass
end
def configure_sass
return unless sass_path
require 'sass'
Sass.load_paths << sass_path
end
private
def path_for(folder)
resolved_dir = realpath_for(folder)
return unless resolved_dir
path = Jekyll.sanitized_path(root, resolved_dir)
path if Dir.exists?(path)
end
def realpath_for(folder)
File.realpath(Jekyll.sanitized_path(root, "_#{folder}"))
rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP
nil
end
def gemspec
@gemspec ||= Gem::Specification.find_by_name(name)
rescue Gem::LoadError
raise Jekyll::Errors::MissingDependencyException, "The #{name} theme could not be found."
end
end
end

View File

@@ -19,7 +19,7 @@ description: > # this means to ignore newlines until "baseurl:"
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "http://yourdomain.com" # the base hostname & protocol for your site
url: "http://example.com" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll

View File

@@ -103,7 +103,7 @@ namespace :site do
desc "Create a nicely formatted history page for the jekyll site based on the repo history."
task :history do
siteify_file('History.markdown')
siteify_file('History.markdown', { "title" => "History" })
end
desc "Copy the Code of Conduct"

3
script/fmt Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
bundle exec rubocop -D $@

View File

@@ -1,5 +1,5 @@
markdown: kramdown
highlighter: pygments
highlighter: rouge
permalink: /news/:year/:month/:day/:title/
excerpt_separator: ""

View File

@@ -26,6 +26,7 @@
- permalinks
- pagination
- plugins
- themes
- extras
- title: Deployment

View File

@@ -317,6 +317,16 @@ file, each document has the following attributes:
</p>
</td>
</tr>
<tr>
<td>
<p><code>date</code></p>
</td>
<td>
<p>
The date of the document's collection.
</p>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -435,7 +435,7 @@ Using [YAML Front Matter](../frontmatter/) is one way that you can specify confi
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your projects root directory.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
@@ -450,6 +450,18 @@ defaults:
layout: "default"
{% endhighlight %}
<div class="note info">
<h5>Please stop and rerun `jekyll serve` command.</h5>
<p>
The <code>_config.yml</code> master configuration file contains global configurations
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
during automatic regeneration are not loaded until the next execution.
</p>
<p>
Note <a href="../datafiles">Data Files</a> are included and reloaded during automatic regeneration.
</p>
</div>
Here, we are scoping the `values` to any file that exists in the scopes path. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
{% highlight yaml %}

View File

@@ -38,7 +38,7 @@ Save the commands you want to run and succeed in a file: `./script/cibuild`
### The HTML Proofer Executable
{% highlight bash %}
{% highlight shell %}
#!/usr/bin/env bash
set -e # halt script on error
@@ -52,7 +52,7 @@ Some options can be specified via command-line switches. Check out the
For example to avoid testing external sites, use this command:
{% highlight bash %}
{% highlight shell %}
$ bundle exec htmlproofer ./_site --disable-external
{% endhighlight %}

View File

@@ -11,8 +11,8 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
* More resources are listed on our [Help page](https://jekyllrb.com/help/)
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
## Ways to contribute
@@ -33,7 +33,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/)
* Pull request are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
@@ -41,7 +41,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
Many small changes can be made entirely through the github.com web interface.
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit
1. Navigate to the file within [`jekyll/jekyll`](https://github.com/jekyll/jekyll) that you'd like to edit.
2. Click the pencil icon in the top right corner to edit the file
3. Make your proposed changes
4. Click "Propose file change"
@@ -53,13 +53,13 @@ That's it! You'll be automatically subscribed to receive updates as others revie
### Submitting a pull request via Git command line
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll)
2. Clone the repository lcoally `git clone https://github.com/<you-username>/jekyll`
1. Fork the project by clicking "Fork" in the top right corner of [`jekyll/jekyll`](https://github.com/jekyll/jekyll).
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
4. Hack away, add tests. Not necessarily in that order.
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
6. Push the branch up ( `git push origin my-awesome-feature` ).
7. Create a pull request by visiting https://github.com/<your-username>/jekyll/ and following the instructions at the top of the screen.
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
## Proposing updates to the documentation

View File

@@ -21,8 +21,8 @@ Plugins/themes can also leverage Data Files to set configuration variables.
As explained on the [directory structure](../structure/) page, the `_data`
folder is where you can store additional data for Jekyll to use when generating
your site. These files must be YAML files
(using either the `.yml`, `.yaml`, `.json` or `csv` extension) and they will be
your site. These files must be YAML, JSON, or CSV files (using either
the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be
accessible via `site.data`.
## Example: List of members

View File

@@ -35,7 +35,7 @@ this](http://web.archive.org/web/20091223025644/http://www.taknado.com/en/2009/0
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
{% highlight bash %}
{% highlight shell %}
laptop$ ssh deployer@example.com
server$ mkdir myrepo.git
server$ cd myrepo.git
@@ -47,7 +47,7 @@ server$ mkdir /var/www/myrepo
Next, add the following lines to hooks/post-receive and be sure Jekyll is
installed on the server:
{% highlight bash %}
{% highlight shell %}
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
PUBLIC_WWW=/var/www/myrepo
@@ -61,14 +61,14 @@ exit
Finally, run the following command on any users laptop that needs to be able to
deploy using this hook:
{% highlight bash %}
{% highlight shell %}
laptops$ git remote add deploy deployer@example.com:~/myrepo.git
{% endhighlight %}
Deploying is now as easy as telling nginx or Apache to look at
`/var/www/myrepo` and running the following:
{% highlight bash %}
{% highlight shell %}
laptops$ git push deploy master
{% endhighlight %}
@@ -129,7 +129,7 @@ is to put the restriction to certificate-based authorization in
`~/.ssh/authorized_keys`. Then, launch `rrsync` and supply
it with the folder it shall have read-write access to:
{% highlight bash %}
{% highlight shell %}
command="$HOME/bin/rrsync <folder>",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa <cert>
{% endhighlight %}
@@ -139,10 +139,10 @@ command="$HOME/bin/rrsync <folder>",no-agent-forwarding,no-port-forwarding,no-pt
Add the `deploy` script to the site source folder:
{% highlight bash %}
{% highlight shell %}
#!/bin/sh
rsync -crvz --rsh=ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
{% endhighlight %}
Command line parameters are:
@@ -155,7 +155,7 @@ your host uses a different port than the default (e.g, HostGator)
Using this setup, you might run the following command:
{% highlight bash %}
{% highlight shell %}
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded _site/ hostuser@example.org:
{% endhighlight %}
@@ -186,7 +186,7 @@ script executes.
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
Read [this post](http://blog.crowdint.com/2010/08/02/instant-blog-using-jekyll-and-heroku.html) on how to deploy to Heroku using Rack-Jekyll.
Read [this post](http://andycroll.com/ruby/serving-a-jekyll-blog-using-heroku) on how to deploy to Heroku using Rack-Jekyll.
## Jekyll-Admin for Rails

View File

@@ -5,6 +5,13 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 3.1.3 / 2016-04-18
{: #v3-1-3}
- Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` ([#4807]({{ site.repository }}/issues/4807))
- Use SSLEnable instead of EnableSSL and make URL HTTPS (WEBrick) ([#4693]({{ site.repository }}/issues/4693))
## 3.1.2 / 2016-02-19
{: #v3-1-2}
@@ -168,6 +175,19 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Correct Minor spelling error ([#4394]({{ site.repository }}/issues/4394))
## 3.0.5 / 2016-04-26
{: #v3-0-5}
- Remove call to `#backwards_compatibilize` in `Configuration.from` ([#4846]({{ site.repository }}/issues/4846))
## 3.0.4 / 2016-04-18
{: #v3-0-4}
- Fix defaults for Documents to lookup defaults based on `relative_path` instead of `url` ([#4806]({{ site.repository }}/issues/4806))
- Configuration: allow users to specify a `collections.posts.permalink` directly without `permalink` clobbering it ([#4753]({{ site.repository }}/issues/4753))
## 3.0.3 / 2016-02-08
{: #v3-0-3}

View File

@@ -37,7 +37,7 @@ The best way to install Jekyll is via
[RubyGems](http://rubygems.org/pages/download). At the terminal prompt,
simply run the following command to install Jekyll:
{% highlight bash %}
{% highlight shell %}
$ gem install jekyll
{% endhighlight %}
@@ -62,14 +62,14 @@ community can improve the experience for everyone.
In order to install a pre-release, make sure you have all the requirements
installed properly and run:
{% highlight bash %}
{% highlight shell %}
gem install jekyll --pre
{% endhighlight %}
This will install the latest pre-release. If you want a particular pre-release,
use the `-v` switch to indicate the version you'd like to install:
{% highlight bash %}
{% highlight shell %}
gem install jekyll -v '2.0.0.alpha.1'
{% endhighlight %}
@@ -77,7 +77,7 @@ If you'd like to install a development version of Jekyll, the process is a bit
more involved. This gives you the advantage of having the latest and greatest,
but may be unstable.
{% highlight bash %}
{% highlight shell %}
$ git clone git://github.com/jekyll/jekyll.git
$ cd jekyll
$ script/bootstrap

View File

@@ -46,7 +46,7 @@ directory with a suitable name for the page you want to create. For a site with
a homepage, an about page, and a contact page, heres what the root directory
and associated URLs might look like:
{% highlight bash %}
{% highlight shell %}
.
|-- _config.yml
|-- _includes/
@@ -69,7 +69,7 @@ the page URL ends up being the folder name, and the web server will serve up
the respective `index.html` file. Here's an example of what this structure
might look like:
{% highlight bash %}
{% highlight shell %}
.
├── _config.yml
├── _includes/

View File

@@ -101,7 +101,6 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti
<p>
Second of the minute from the posts <code>date</code> front matter. (00..59)
</p>
</p>
</td>
</tr>
<tr>

View File

@@ -757,6 +757,7 @@ LESS.js files during generation.
- [Textile converter](https://github.com/jekyll/jekyll-textile-converter): Convert `.textile` files into HTML. Also includes the `textilize` Liquid filter.
- [Slim plugin](https://github.com/slim-template/jekyll-slim): Slim converter and includes for Jekyll with support for Liquid tags.
- [Jade plugin by John Papandriopoulos](https://github.com/snappylabs/jade-jekyll-plugin): Jade converter for Jekyll.
- [Pug plugin by Josh Waller](https://github.com/mdxprograms/pug-jekyll-plugin): Pug (previously Jade) converter for Jekyll.
- [HAML plugin by Sam Z](https://gist.github.com/517556): HAML converter for Jekyll.
- [HAML-Sass Converter by Adam Pearson](https://gist.github.com/481456): Simple HAML-Sass converter for Jekyll. [Fork](https://gist.github.com/528642) by Sam X.
- [Sass SCSS Converter by Mark Wolfe](https://gist.github.com/960150): Sass converter which uses the new CSS compatible syntax, based Sam Xs fork above.
@@ -858,6 +859,8 @@ LESS.js files during generation.
- [Jekyll Flickr Plugin](https://github.com/lawmurray/indii-jekyll-flickr) by [Lawrence Murray](http://www.indii.org): Embeds Flickr photosets (albums) as a gallery of thumbnails, with lightbox links to larger images.
- [jekyll-figure](https://github.com/paulrobertlloyd/jekyll-figure): A liquid tag for Jekyll that generates `<figure>` elements.
- [Jekyll Video Embed](https://github.com/eug/jekyll-video-embed): It provides several tags to easily embed videos (e.g. Youtube, Vimeo, UStream and Ted Talks)
- [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags): Translate your templates.
- [Jekyll Ideal Image Slider](https://github.com/xHN35RQ/jekyll-ideal-image-slider): Liquid tag plugin to create image sliders using [Ideal Image Slider](https://github.com/gilbitron/Ideal-Image-Slider).
#### Collections
@@ -899,6 +902,8 @@ LESS.js files during generation.
- [Official Contentful Jekyll Plugin](https://github.com/contentful/jekyll-contentful-data-import): Adds a `contentful` sub-command to Jekyll to import data from Contentful.
- [jekyll-paspagon](https://github.com/KrzysiekJ/jekyll-paspagon): Sell your posts in various formats for cryptocurrencies.
- [Hawkins](https://github.com/awood/hawkins): Adds a `liveserve` sub-command to Jekyll that incorporates [LiveReload](http://livereload.com/) into your pages while you preview them. No more hitting the refresh button in your browser!
- [Jekyll Autoprefixer](https://github.com/vwochnik/jekyll-autoprefixer): Autoprefixer integration for Jekyll
- [Jekyll-breadcrumbs](https://github.com/git-no/jekyll-breadcrumbs): Creates breadcrumbs for Jekyll 3.x, includes features like SEO optimization, optional breadcrumb item translation and more.
#### Editors

View File

@@ -27,7 +27,7 @@ To create a new post, all you need to do is create a file in the `_posts`
directory. How you name files in this folder is important. Jekyll requires blog
post files to be named according to the following format:
{% highlight bash %}
{% highlight shell %}
YEAR-MONTH-DAY-title.MARKUP
{% endhighlight %}
@@ -35,7 +35,7 @@ Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit
numbers, and `MARKUP` is the file extension representing the format used in the
file. For example, the following are examples of valid post filenames:
{% highlight bash %}
{% highlight shell %}
2011-12-31-new-years-eve-is-awesome.md
2012-09-12-how-to-write-a-blog.textile
{% endhighlight %}

View File

@@ -6,7 +6,7 @@ permalink: /docs/quickstart/
For the impatient, here's how to get a boilerplate Jekyll site up and running.
{% highlight bash %}
{% highlight shell %}
~ $ gem install jekyll
~ $ jekyll new myblog
~ $ cd myblog

View File

@@ -8,6 +8,8 @@ Jekylls growing use is producing a wide variety of tutorials, frameworks, ext
### Useful Guides
- [Jekyll Tips](http://jekyll.tips) is a set of resources created by [CloudCannon](https://cloudcannon.com) to help folks get up and running with Jekyll. The cover all skill levels, and even include some great video tutorials.
- [Jekyll Cheatsheet](http://cheat.jekyll.tips) is a single-page resource for Jekyll filters, variables, and the like.
- [“Creating and Hosting a Personal Site on GitHub”](http://jmcglone.com/guides/github-pages/)
- [Build A Blog With Jekyll And GitHub Pages on Smashing Magazine](http://www.smashingmagazine.com/2014/08/01/build-blog-jekyll-github-pages/)
- Publishing to GitHub Pages? [Check out our documentation page for just that purpose](/docs/github-pages/).
@@ -16,8 +18,10 @@ Jekylls growing use is producing a wide variety of tutorials, frameworks, ext
### Integrations
- [Use FormKeep as a backend for forms (contact forms, hiring forms, etc.)](https://formkeep.com/guides/how-to-make-a-contact-form-in-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
- [Use Simple Form to add a simple contact form](http://getsimpleform.com/)
- Use a saas service as a backend for forms (contact forms, hiring forms, etc.)
- [Formspree (also open source)](http://formspree.io/)
- [FormKeep](https://formkeep.com/guides/contact-form-jekyll?utm_source=github&utm_medium=jekyll-docs&utm_campaign=contact-form-jekyll)
- [Simple Form](http://getsimpleform.com/)
- [Jekyll Bootstrap](http://jekyllbootstrap.com), 0 to Blog in 3 minutes. Provides detailed explanations, examples, and helper-code to make getting started with Jekyll easier.
- [Integrating Twitter with Jekyll](http://www.justkez.com/integrating-twitter-with-jekyll/)
> “Having migrated Justkez.com to be based on Jekyll, I was pondering how I might include my recent twitterings on the front page of the site. In the WordPress world, this would have been done via a plugin which may or may not have hung the loading of the page, might have employed caching, but would certainly have had some overheads. … Not in Jekyll.”

View File

@@ -14,8 +14,6 @@ learning purposes.
([source](https://github.com/github/training-kit))
- [Rasmus Andersson](http://rsms.me/)
([source](https://github.com/rsms/rsms.github.com))
- [Leonard Lamprecht](http://leo.im)
([source](https://github.com/leo/leo.github.io))
If you would like to explore more examples, you can find a list of sites
and their sources on the ["Sites" page in the Jekyll wiki][jekyll-sites].

View File

@@ -14,7 +14,7 @@ product.
A basic Jekyll site usually looks something like this:
{% highlight bash %}
{% highlight shell %}
.
├── _config.yml
├── _drafts

View File

@@ -88,6 +88,22 @@ common tasks easier.
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Where Expression</strong></p>
<p>Select all the objects in an array where the expression is true.</p>
</td>
<td class="align-center">
<p>
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
"item.graduation_year == 2014" }}{% endraw %}</code>
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
"item.graduation_year < 2014" }}{% endraw %}</code>
<code class="filter">{% raw %}{{ site.members | where_exp:"item",
"item.projects contains 'foo'" }}{% endraw %}</code>
</p>
</td>
</tr>
<tr>
<td>
<p class="name"><strong>Group By</strong></p>
@@ -325,7 +341,7 @@ The default is `default`. They are as follows (with what they filter):
If you have small page fragments that you wish to include in multiple places on
your site, you can use the `include` tag.
{% highlight ruby %}
{% highlight liquid %}
{% raw %}{% include footer.html %}{% endraw %}
{% endhighlight %}
@@ -346,13 +362,13 @@ root of your source directory. This will embed the contents of
You can also pass parameters to an include. Omit the quotation marks to send a variable's value. Liquid curly brackets should not be used here:
{% highlight ruby %}
{% highlight liquid %}
{% raw %}{% include footer.html param="value" variable-param=page.variable %}{% endraw %}
{% endhighlight %}
These parameters are available via Liquid in the include:
{% highlight ruby %}
{% highlight liquid %}
{% raw %}{{ include.param }}{% endraw %}
{% endhighlight %}
@@ -360,7 +376,7 @@ These parameters are available via Liquid in the include:
You can also choose to include file fragments relative to the current file:
{% highlight ruby %}
{% highlight liquid %}
{% raw %}{% include_relative somedir/footer.html %}{% endraw %}
{% endhighlight %}
@@ -388,7 +404,7 @@ languages](http://pygments.org/languages/)
To render a code block with syntax highlighting, surround your code as follows:
{% highlight text %}
{% highlight liquid %}
{% raw %}
{% highlight ruby %}
def foo
@@ -411,7 +427,7 @@ Including the `linenos` argument will force the highlighted code to include line
numbers. For instance, the following code block would include line numbers next
to each line:
{% highlight text %}
{% highlight liquid %}
{% raw %}
{% highlight ruby linenos %}
def foo
@@ -436,7 +452,7 @@ numbers from the highlighted code.
If you would like to include a link to a post on your site, the `post_url` tag
will generate the correct permalink URL for the post you specify.
{% highlight text %}
{% highlight liquid %}
{% raw %}
{% post_url 2010-07-21-name-of-post %}
{% endraw %}
@@ -445,7 +461,7 @@ will generate the correct permalink URL for the post you specify.
If you organize your posts in subdirectories, you need to include subdirectory
path to the post:
{% highlight text %}
{% highlight liquid %}
{% raw %}
{% post_url /subdir/2010-07-21-name-of-post %}
{% endraw %}
@@ -455,7 +471,7 @@ There is no need to include the file extension when using the `post_url` tag.
You can also use this tag to create a link to a post in Markdown as follows:
{% highlight text %}
{% highlight liquid %}
{% raw %}
[Name of Link]({% post_url 2010-07-21-name-of-post %})
{% endraw %}
@@ -466,7 +482,7 @@ You can also use this tag to create a link to a post in Markdown as follows:
Use the `gist` tag to easily embed a GitHub Gist onto your site. This works
with public or secret gists:
{% highlight text %}
{% highlight liquid %}
{% raw %}
{% gist parkr/931c1c8d465a04042403 %}
{% endraw %}
@@ -474,7 +490,7 @@ with public or secret gists:
You may also optionally specify the filename in the gist to display:
{% highlight text %}
{% highlight liquid %}
{% raw %}
{% gist parkr/931c1c8d465a04042403 jekyll-private-gist.markdown %}
{% endraw %}

98
site/_docs/themes.md Normal file
View File

@@ -0,0 +1,98 @@
---
layout: docs
title: Themes
permalink: /docs/themes/
---
<div class="note unreleased">
<h5>This feature is unreleased!</h5>
<p>
Jekyll 3.0 and 3.1 do NOT have the ability to add themes in this way.
The documentation below is for an unreleased version of Jekyll and
cannot be used at the moment.
</p>
</div>
Jekyll has an extensive theme system, which allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site's content.
## Installing a theme
1. To install a theme, first, add the theme to your site's `Gemfile`:
gem 'my-awesome-jekyll-theme'
2. Save the changes to your `Gemfile`
3. Run the command `bundle install` to install the theme
4. Finally, activate the theme by adding the following to your site's `_config.yml`:
theme: my-awesome-jekyll-theme
You can have multiple themes listed in your site's Gemfile, but only one theme can be selected in your site's `_config.yml`.
{: .note .info }
## Overriding theme defaults
Jekyll themes set default layouts, includes, and stylesheets, that can be overridden by your site's content. For example, if your selected theme has a `page` layout, you can override the theme's layout by creating your own `page` layout in the `_layouts` folder (e.g., `_layouts/page.html`).
Jekyll will look first to your site's content, before looking to the theme's defaults, for any requested file in the following folders:
* `/_layouts`
* `/_includes`
* `/_sass`
Refer to your selected theme's documentation and source repository for more information on what files you can override.
{: .note .info}
## Creating a theme
Jekyll themes are distributed as Ruby gems. The only required file is the [Ruby Gemspec](http://guides.rubygems.org/specification-reference/). Here's an example of a minimal Gemspec for the `my-awesome-jekyll-theme` theme, saved as `/my-awsome-jekyll-theme.gemspec`:
{% highlight ruby %}
Gem::Specification.new do |s|
s.name = '<THEME TITLE>'
s.version = '0.1.0'
s.license = 'MIT'
s.summary = '<THEME DESCRIPTION>'
s.author = '<YOUR NAME>'
s.email = '<YOUR EMAIL>'
s.homepage = 'https://github.com/jekyll/my-awesome-jekyll-theme'
s.files = `git ls-files -z`.split("\x0").grep(%r{^_(sass|includes|layouts)/})
end
{% endhighlight %}
### Layouts and includes
Theme layouts and includes work just like they work in any Jekyll site. Place layouts in your theme's `/_layouts` folder, and place includes in your themes `/_includes` folder.
For example, if your theme has a `/_layouts/page.html` file, and a page has `layout: page` in its YAML front matter, Jekyll will first look to the site's `_layouts` folder for a the `page` layout, and if none exists, will use your theme's `page` layout.
### Stylesheets
Your theme's stylesheets should be placed in your theme's `/_sass` folder, again, just as you would when authoring a Jekyll site. Your theme's styles can be included in the user's stylesheet using the `@import` directive.
### Documenting your theme
Your theme should include a `/README.md` file, which explains how site authors can install and use your theme. What layouts are included? What includes? Do they need to add anything special to their site's configuration file?
### Adding a screenshot
Themes are visual. Show users what your theme looks like by including a screenshot as `/screenshot.png` within your theme's repository where it can be retrieved programatically. You can also include this screenshot within your theme's documentation.
### Previewing your theme
To preview your theme as you're authoring it, it may be helpful to add dummy content in, for example, `/index.html` and `/page.html` files. This will allow you to use the `jekyll build` and `jekyll serve` commands to preview your theme, just as you'd preview a Jekyll site.
If you do preview your theme locally, be sure to add `/_site` to your theme's `.gitignore` file to prevent the compiled site from also being included when you distribute your theme.
{: .info .note}
### Publishing your theme
Themes are published via [RubyGems.org](https://rubygems.org). You'll need a RubyGems account, which you can [create for free](https://rubygems.org/sign_up).
1. First, package your theme, by running the following command, replacing `my-awesome-jekyll-theme` with the name of your theme:
gem build my-awesome-jekyll-theme.gemspec
2. Next, push your packaged theme up to the RubyGems service, by running the following command, again replacing `my-awesome-jekyll-theme` with the name of your theme:
gem push my-awesome-jekyll-theme-*.gem

View File

@@ -20,19 +20,19 @@ If you encounter errors during gem installation, you may need to install
the header files for compiling extension modules for Ruby 2.0.0. This
can be done on Ubuntu or Debian by running:
{% highlight bash %}
{% highlight shell %}
sudo apt-get install ruby2.0.0-dev
{% endhighlight %}
On Red Hat, CentOS, and Fedora systems you can do this by running:
{% highlight bash %}
{% highlight shell %}
sudo yum install ruby-devel
{% endhighlight %}
If you installed the above - specifically on Fedora 23 - but the extensions would still not compile, you are probably running a Fedora image that misses the `redhat-rpm-config` package. To solve this, simply run:
{% highlight bash %}
{% highlight shell %}
sudo dnf install redhat-rpm-config
{% endhighlight %}
@@ -40,7 +40,7 @@ sudo dnf install redhat-rpm-config
On [NearlyFreeSpeech](https://www.nearlyfreespeech.net/) you need to run the
following commands before installing Jekyll:
{% highlight bash %}
{% highlight shell %}
export GEM_HOME=/home/private/gems
export GEM_PATH=/home/private/gems:/usr/local/lib/ruby/gems/1.8/
export PATH=$PATH:/home/private/gems/bin
@@ -49,7 +49,7 @@ export RB_USER_INSTALL='true'
To install RubyGems on Gentoo:
{% highlight bash %}
{% highlight shell %}
sudo emerge -av dev-ruby/rubygems
{% endhighlight %}
@@ -58,21 +58,21 @@ DevKit](https://wiki.github.com/oneclick/rubyinstaller/development-kit).
On Mac OS X, you may need to update RubyGems (using `sudo` only if necessary):
{% highlight bash %}
{% highlight shell %}
sudo gem update --system
{% endhighlight %}
If you still have issues, you can download and install new Command Line
Tools (such as `gcc`) using the command
{% highlight bash %}
{% highlight shell %}
xcode-select --install
{% endhighlight %}
which may allow you to install native gems using this command (again using
`sudo` only if necessary):
{% highlight bash %}
{% highlight shell %}
sudo gem install jekyll
{% endhighlight %}
@@ -90,20 +90,20 @@ longer available. Given these changes, there are a couple of simple ways to get
up and running. One option is to change the location where the gem will be
installed (again using `sudo` only if necessary):
{% highlight bash %}
{% highlight shell %}
sudo gem install -n /usr/local/bin jekyll
{% endhighlight %}
Alternatively, Homebrew can be installed and used to set up Ruby. This can be
done as follows:
{% highlight bash %}
{% highlight shell %}
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
{% endhighlight %}
Once Homebrew is installed, the second step is easy:
{% highlight bash %}
{% highlight shell %}
brew install ruby
{% endhighlight %}
@@ -119,13 +119,13 @@ which to install Jekyll.
If you elect to use one of the above methods to install Ruby, it might be
necessary to modify your `$PATH` variable using the following command:
{% highlight bash %}
{% highlight shell %}
export PATH=/usr/local/bin:$PATH
{% endhighlight %}
GUI apps can modify the `$PATH` as follows:
{% highlight bash %}
{% highlight shell %}
launchctl setenv PATH "/usr/local/bin:$PATH"
{% endhighlight %}
@@ -151,19 +151,19 @@ in order to have the `jekyll` executable be available in your Terminal.
If you are using base-url option like:
{% highlight bash %}
{% highlight shell %}
jekyll serve --baseurl '/blog'
{% endhighlight %}
… then make sure that you access the site at:
{% highlight bash %}
{% highlight shell %}
http://localhost:4000/blog/index.html
{% endhighlight %}
It wont work to just access:
{% highlight bash %}
{% highlight shell %}
http://localhost:4000/blog
{% endhighlight %}
@@ -192,7 +192,7 @@ The latest version, version 2.0, seems to break the use of `{{ "{{" }}` in
templates. Unlike previous versions, using `{{ "{{" }}` in 2.0 triggers the
following error:
{% highlight bash %}
{% highlight shell %}
'{{ "{{" }}' was not properly terminated with regexp: /\}\}/ (Liquid::SyntaxError)
{% endhighlight %}

View File

@@ -9,7 +9,7 @@ and 2.0 that you'll want to know about.
Before we dive in, go ahead and fetch the latest version of Jekyll:
{% highlight bash %}
{% highlight shell %}
$ gem update jekyll
{% endhighlight %}

View File

@@ -9,7 +9,7 @@ that you'll want to know about.
Before we dive in, go ahead and fetch the latest version of Jekyll:
{% highlight bash %}
{% highlight shell %}
$ gem update jekyll
{% endhighlight %}

View File

@@ -7,7 +7,7 @@ permalink: /docs/usage/
The Jekyll gem makes a `jekyll` executable available to you in your Terminal
window. You can use this command in a number of ways:
{% highlight bash %}
{% highlight shell %}
$ jekyll build
# => The current folder will be generated into ./_site
@@ -52,7 +52,7 @@ $ jekyll build --watch
Jekyll also comes with a built-in development server that will allow you to
preview what the generated site will look like in your browser locally.
{% highlight bash %}
{% highlight shell %}
$ jekyll serve
# => A development server will run at http://localhost:4000/
# Auto-regeneration: enabled. Use `--no-watch` to disable.
@@ -70,7 +70,7 @@ $ jekyll serve --detach
</p>
</div>
{% highlight bash %}
{% highlight shell %}
$ jekyll serve --no-watch
# => Same as `jekyll serve` but will not watch for changes.
{% endhighlight %}
@@ -89,7 +89,7 @@ destination: _deploy
Then the following two commands will be equivalent:
{% highlight bash %}
{% highlight shell %}
$ jekyll build
$ jekyll build --source _source --destination _deploy
{% endhighlight %}

View File

@@ -27,7 +27,7 @@ Additionally, you might need to change the code page of the console window to UT
in case you get a "Liquid Exception: Incompatible character encoding" error during
the site generation process. It can be done with the following command:
{% highlight bash %}
{% highlight shell %}
$ chcp 65001
{% endhighlight %}

View File

@@ -1,11 +1,5 @@
{% assign items = include.items %}
{% for item in items %}
{% for item in include.items %}
{% assign item_url = item | prepend:"/docs/" | append:"/" %}
{% for p in site.docs %}
{% if p.url == item_url %}
<option value="{{ site.url }}{{ p.url }}">{{ p.title }}</option>
{% endif %}
{% endfor %}
{% assign doc = site.docs | where: "url", item_url | first %}
<option value="{{ site.url }}{{ doc.url }}">{{ doc.title }}</option>
{% endfor %}

View File

@@ -1,17 +1,7 @@
{% assign items = include.items %}
<ul>
{% for item in items %}
{% for item in include.items %}
{% assign item_url = item | prepend:"/docs/" | append:"/" %}
{% if item_url == page.url %}
{% assign c = "current" %}
{% else %}
{% assign c = "" %}
{% endif %}
{% assign p = site.docs | where:"url",item_url | first %}
<li class="{{ c }}"><a href="{{ site.url }}{{ p.url }}">{{ p.title }}</a></li>
{% assign p = site.docs | where:"url", item_url | first %}
<li class="{% if item_url == page.url %}current{% endif %}"><a href="{{ site.url }}{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
</ul>

View File

@@ -20,7 +20,7 @@ to get a feel for what changes are afoot. Key features:
To install just run:
{% highlight bash %}
{% highlight shell %}
$ gem install jekyll --pre
{% endhighlight %}

View File

@@ -0,0 +1,24 @@
---
layout: news_item
title: 'Jekyll 3.0.4 Released'
date: 2016-04-19 10:26:12 -0700
author: parkr
version: 3.0.4
categories: [release]
---
v3.0.4 is a patch release which fixes the follow two issues:
- Front matter defaults may not have worked for collection documents and posts due to a problem where they were looked up by their URL rather than their path relative to the site source
- Configuration for the posts permalink might be borked when a user specified a value for `collections.posts.permalink` directly. This forced the use of `permalink` at the top level, which also affected pages. To configure a permalink _just for posts_, you can do so with:
{% highlight yaml %}
collections:
posts:
output: true
permalink: /blog/:year/:title/
{% endhighlight %}
Both of these issues have been resolved. For more information, check out [the full history](/docs/history/#v3-0-4).
Happy Jekylling!

View File

@@ -0,0 +1,18 @@
---
layout: news_item
title: 'Jekyll 3.1.3 Released'
date: 2016-04-19 10:26:16 -0700
author: parkr
version: 3.1.3
categories: [release]
---
v3.1.3 is a patch release which fixes the follow two issues:
- Front matter defaults may not have worked for collection documents and posts due to a problem where they were looked up by their URL rather than their path relative to the site source
- Running `jekyll serve` with SSL enabled was broken due to a bad configuration.
Both of these issues have been resolved. For more information, check out [the full history](/docs/history/#v3-1-3).
Happy Jekylling!

View File

@@ -0,0 +1,25 @@
---
layout: news_item
title: 'Jekyll 3.0.5 Released'
date: 2016-04-26 17:40:44 -0700
author: parkr
version: 3.0.5
categories: [release]
---
This version fixes a bug affecting only v3.0.4 where autoregeneration was
*always* disabled when running Jekyll locally. This feature is a huge
reason why Jekyll (or any static site generator, for that matter) is a joy
to use. Sorry for the regression!
If you're using GitHub Pages, [you can follow the progress of the upgrade
on the github/pages-gem repo](https://github.com/github/pages-gem/pull/285).
As always, our [history doc](/docs/history/#v3-0-5) has links to the pull
requests and issues associated with the release for your perusal.
We're looking forward to the upcoming release of v3.2 which [has some
excellent goodies](https://github.com/jekyll/jekyll/blob/master/History.markdown#head)
we think you'll love.
Happy Jekylling!

View File

@@ -1,20 +0,0 @@
---
layout: page
title: Roadmap
---
This is a high-level roadmap for Jekyll. It is a list of things we're
planning for each release. While plans are subject to change, this should
offer a bit of an overview for anyone interested in future features.
If you'd like to discuss any of the items, visit the link next to each
item and leave us a comment! We'd love to hear your thoughts.
- [v3.2](#v32)
- [v3.3](#v33)
## v3.2
For v3.2, we're interested in shipping:
1. **Gem-based themes.** This will allow users to ship layouts, includes, and sass (to start with) in a way that is more easily consumable and versionable. ([discuss]({{ site.repository }}/issues/4510))

View File

@@ -0,0 +1 @@
<span class="sample">include.html from test-theme</span>

View File

@@ -0,0 +1 @@
default.html from test-theme: {{ content }}

View File

@@ -0,0 +1,3 @@
.sample {
color: black;
}

1
test/fixtures/test-theme/_symlink vendored Symbolic link
View File

@@ -0,0 +1 @@
_layouts

View File

@@ -0,0 +1,9 @@
Gem::Specification.new do |s|
s.name = 'test-theme'
s.version = '0.1.0'
s.licenses = ['MIT']
s.summary = "This is a theme used to test Jekyll"
s.authors = ["Jekyll"]
s.files = ["lib/example.rb"]
s.homepage = 'https://github.com/jekyll/jekyll'
end

View File

@@ -179,13 +179,13 @@ class TestCollections < JekyllUnitTest
@collection = @site.collections["methods"]
end
should "not allow symlinks" do
refute_includes @collection.filtered_entries, "um_hi.md"
should "include the symlinked file as it resolves to inside site.source" do
assert_includes @collection.filtered_entries, "um_hi.md"
refute_includes @collection.filtered_entries, "/um_hi.md"
end
should "not include the symlinked file in the list of docs" do
refute_includes @collection.docs.map(&:relative_path), "_methods/um_hi.md"
should "include the symlinked file in the list of docs as it resolves to inside site.source" do
assert_includes @collection.docs.map(&:relative_path), "_methods/um_hi.md"
end
end

View File

@@ -110,7 +110,7 @@ class TestCommandsServe < JekyllUnitTest
"ssl_key" => "bar"
})
assert result[:EnableSSL]
assert result[:SSLEnable]
assert_equal result[:SSLPrivateKey ], "c2"
assert_equal result[:SSLCertificate], "c1"
end

View File

@@ -122,7 +122,7 @@ class TestDocument < JekyllUnitTest
@site = fixture_site({
"collections" => ["slides"],
"defaults" => [{
"scope"=> {"path"=>"slides", "type"=>"slides"},
"scope"=> {"path"=>"_slides", "type"=>"slides"},
"values"=> {
"nested"=> {
"key"=>"value123",

View File

@@ -14,6 +14,17 @@ class TestEntryFilter < JekyllUnitTest
assert_equal %w[foo.markdown bar.markdown baz.markdown .htaccess], entries
end
should "allow regexp filtering" do
files = %w(README.md)
@site.exclude = excludes = [
/README/
]
assert_empty @site.reader.filter_entries(
files
)
end
should "filter entries with exclude" do
excludes = %w[README TODO vendor/bundle]
files = %w[index.html site.css .htaccess vendor]
@@ -46,11 +57,11 @@ class TestEntryFilter < JekyllUnitTest
assert_equal files, @site.reader.filter_entries(files)
end
should "filter symlink entries when safe mode enabled" do
should "keep safe symlink entries when safe mode enabled" do
site = Site.new(site_configuration('safe' => true))
allow(File).to receive(:symlink?).with('symlink.js').and_return(true)
files = %w[symlink.js]
assert_equal [], site.reader.filter_entries(files)
assert_equal files, @site.reader.filter_entries(files)
end
should "not filter symlink entries when safe mode disabled" do
@@ -59,12 +70,18 @@ class TestEntryFilter < JekyllUnitTest
assert_equal files, @site.reader.filter_entries(files)
end
should "not include symlinks in safe mode" do
should "filter symlink pointing outside site source" do
ent1 = %w[_includes/tmp]
entries = EntryFilter.new(@site).filter(ent1)
assert_equal %w[], entries
end
should "include only safe symlinks in safe mode" do
site = Site.new(site_configuration('safe' => true))
site.reader.read_directories("symlink-test")
assert_equal [], site.pages
assert_equal [], site.static_files
assert_equal %w[main.scss symlinked-file].length, site.pages.length
refute_equal [], site.static_files
end
should "include symlinks in unsafe mode" do

View File

@@ -354,6 +354,64 @@ class TestFilters < JekyllUnitTest
end
end
context "where_exp filter" do
should "return any input that is not an array" do
assert_equal "some string", @filter.where_exp("some string", "la", "le")
end
should "filter objects in a hash appropriately" do
hash = {"a"=>{"color"=>"red"}, "b"=>{"color"=>"blue"}}
assert_equal 1, @filter.where_exp(hash, "item", "item.color == 'red'").length
assert_equal [{"color"=>"red"}], @filter.where_exp(hash, "item", "item.color == 'red'")
end
should "filter objects appropriately" do
assert_equal 2, @filter.where_exp(@array_of_objects, "item", "item.color == 'red'").length
end
should "stringify during comparison for compatibility with liquid parsing" do
hash = {
"The Words" => {"rating" => 1.2, "featured" => false},
"Limitless" => {"rating" => 9.2, "featured" => true},
"Hustle" => {"rating" => 4.7, "featured" => true},
}
results = @filter.where_exp(hash, "item", "item.featured == true")
assert_equal 2, results.length
assert_equal 9.2, results[0]["rating"]
assert_equal 4.7, results[1]["rating"]
results = @filter.where_exp(hash, "item", "item.rating == 4.7")
assert_equal 1, results.length
assert_equal 4.7, results[0]["rating"]
end
should "filter with other operators" do
assert_equal [3, 4, 5], @filter.where_exp([ 1, 2, 3, 4, 5 ], "n", "n >= 3")
end
objects = [
{ "id" => "a", "groups" => [1, 2] },
{ "id" => "b", "groups" => [2, 3] },
{ "id" => "c" },
{ "id" => "d", "groups" => [1, 3] }
]
should "filter with the contains operator over arrays" do
results = @filter.where_exp(objects, "obj", "obj.groups contains 1")
assert_equal 2, results.length
assert_equal "a", results[0]["id"]
assert_equal "d", results[1]["id"]
end
should "filter with the contains operator over hash keys" do
results = @filter.where_exp(objects, "obj", "obj contains 'groups'")
assert_equal 3, results.length
assert_equal "a", results[0]["id"]
assert_equal "b", results[1]["id"]
assert_equal "d", results[2]["id"]
end
end
context "sort filter" do
should "raise Exception when input is nil" do
err = assert_raises ArgumentError do

View File

@@ -418,12 +418,12 @@ class TestSite < JekyllUnitTest
assert_equal site.site_payload['site']['data']['products'], file_content
end
should "not load symlink files in safe mode" do
should "load the symlink files in safe mode, as they resolve to inside site.source" do
site = Site.new(site_configuration('safe' => true))
site.process
assert_nil site.data['products']
assert_nil site.site_payload['site']['data']['products']
file_content = SafeYAML.load_file(File.join(source_dir, '_data', 'products.yml'))
assert_equal site.data['products'], file_content
assert_equal site.site_payload['site']['data']['products'], file_content
end
end

View File

@@ -616,7 +616,7 @@ title: Include symlink
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
end
assert_match(/should exist and should not be a symlink/, ex.message)
assert_match "Could not locate the included file 'tmp/pages-test-does-not-exist' in any of [\"#{source_dir}/_includes\"].", ex.message
end
end
@@ -757,7 +757,7 @@ CONTENT
exception = assert_raises IOError do
create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
end
assert_equal 'Included file \'_includes/missing.html\' not found', exception.message
assert_match "Could not locate the included file 'missing.html' in any of [\"#{source_dir}/_includes\"].", exception.message
end
end
@@ -839,7 +839,7 @@ CONTENT
exception = assert_raises IOError do
create_post(@content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
end
assert_equal 'Included file \'./missing.html\' not found', exception.message
assert_match "Could not locate the included file 'missing.html' in any of [\"#{source_dir}\"].", exception.message
end
end
@@ -894,7 +894,7 @@ title: Include symlink
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
end
assert_match(/should exist and should not be a symlink/, ex.message)
assert_match /Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source./, ex.message
end
end
end

65
test/test_theme.rb Normal file
View File

@@ -0,0 +1,65 @@
require 'helper'
class TestTheme < JekyllUnitTest
def setup
@theme = Theme.new('test-theme')
@expected_root = File.expand_path "./fixtures/test-theme", File.dirname(__FILE__)
end
context "initializing" do
should "normalize the theme name" do
theme = Theme.new(' Test-Theme ')
assert_equal "test-theme", theme.name
end
should "know the theme root" do
assert_equal @expected_root, @theme.root
end
should "know the theme version" do
assert_equal Gem::Version.new("0.1.0"), @theme.version
end
should "raise an error for invalid themes" do
assert_raises Jekyll::Errors::MissingDependencyException do
Theme.new("foo").version
end
end
should "add itself to sass's load path" do
@theme.configure_sass
assert Sass.load_paths.include?(@theme.sass_path), "Sass load paths should include the theme sass dir"
end
end
context "path generation" do
[:layouts, :includes, :sass].each do |folder|
should "know the #{folder} path" do
expected = File.expand_path("_#{folder}", @expected_root)
assert_equal expected, @theme.public_send("#{folder}_path")
end
end
should "generate folder paths" do
expected = File.expand_path("./_sass", @expected_root)
assert_equal expected, @theme.send(:path_for, :sass)
end
should "not allow paths outside of the theme root" do
assert_equal nil, @theme.send(:path_for, "../../source")
end
should "return nil for paths that don't exist" do
assert_equal nil, @theme.send(:path_for, "foo")
end
should "return the resolved path when a symlink & resolved path exists" do
expected = File.expand_path("./_layouts", @expected_root)
assert_equal expected, @theme.send(:path_for, :symlink)
end
end
should "retrieve the gemspec" do
assert_equal "test-theme-0.1.0", @theme.send(:gemspec).full_name
end
end