Previously you could do, e.g. {{ site | jsonify }}, but with the introduction of Liquid Drops, this didn't work anymore.
This PR adds the ability to render drops as JSON. You can safely run drop.to_json and it should Do the Right Thing.
This commit cleans up rubocop violations for the following files:
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
* 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.)
* 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.
...
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.
Update Rake and disable verbosity when running the specs because we have some
deprecated usage (for now -- however, see: jekyll/jekyll#4719) and because
Rouge, and Liquid throw out thousands (probably hyperbolic) of warnigns when the
specs are being ran. We need upstream to fix their problems while we fix ours
or we'll all have a bad day, not that we aren't already.
* 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
...
This removes the following warnings:
- /lib/jekyll/configuration.rb:151: warning: instance variable @default_config_file not initialized
- /lib/jekyll/converter.rb:12: warning: instance variable @highlighter_prefix not initialized
- /lib/jekyll/converter.rb:24: warning: instance variable @highlighter_suffix not initialized
- /lib/jekyll/converters/markdown.rb:9: warning: instance variable @setup not initialized
- /lib/jekyll/converters/markdown/kramdown_parser.rb:60: warning: instance variable @highlighter not initialized
- /lib/jekyll/frontmatter_defaults.rb:97: warning: shadowing outer local variable - path
- /lib/jekyll/plugin.rb:66: warning: instance variable @safe not initialized
- /lib/jekyll/regenerator.rb:147: warning: instance variable @disabled not initialized
- /test/test_convertible.rb:40: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_filters.rb:154: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_new_command.rb:84: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_site.rb:234: warning: assigned but unused variable - site
- /test/test_site.rb:240: warning: assigned but unused variable - site
- /test/test_site.rb:522: warning: assigned but unused variable - source
- /test/test_tags.rb:153: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:425: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:449: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:496: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:496: warning: instance variable @result not initialized
- /test/test_tags.rb:511: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:773: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_tags.rb:773: warning: instance variable @result not initialized
- /test/test_tags.rb:788: warning: ambiguous first argument; put parentheses or a space even after `/' operator
- /test/test_url.rb:66: warning: shadowing outer local variable - doc
- /lib/jekyll/url.rb:119:in `escape_path': warning: URI.escape is obsolete
Previously `titleize` used `capitalize!` which has the side effect of
returning `nil` for anything already starting with a capital letter. This
commit changes it to just `capitalize`.
Example, before:
A file "2016-01-01-This-is-a-title-with-Capitals.markdown" would return "Is A
Title With" for `post.title`
Example, after:
A file "2016-01-01-This-is-a-title-with-Capitals.markdown" will return "This Is A
Title With Capitals" for `post.title`
Tests added for `titleize_slug` in test_utils.rb
Fix problem introduced in 67f842546e
References #4525
Previously, even if the document permalink was a folder, it would look for
an extension on that. For example, if I have:
permalink: "/new-version-jekyll-v3.0.0/"
the output_ext would be ".0". Now, the output_ext honors the trailing
slash and will report based on the converters instead.
This reverts a bit of the work @willnorris had made to support
extensionless permalinks. Using the ‘permalink’ front matter will no
longer work as it must allow non-html extensions to be written.
Occasionally, extra spaces at the end of the YAML front matter prologue are
saved to a file and it goes missing without telling the user why. This
should simply accept those changes without any detriment to the user,
allowing anyone to add as many spaces as they like to the end of their
front matter prologues.
* akoeplinger-doctor-permalink-same-case-warning:
Added tests for new jekyll doctor warning
Incorporate code review feedback
Incorporate code review feedback
Add a Jekyll doctor warning for URLs that only differ by case
* Add support for SSL through command line switches.
* Add suppport for file/index.html > file.html > directory.
* Add support for custom-headers through configuration.
* Modernize and split up the serve.
* Add a few basic tests.
which works the same way as Dir.glob but seperating the input
into two parts ('dir' + '/' + 'pattern') to make sure
the first part('dir') does not act as a pattern.
Disable the feature as it's still not 100% working 100% of the time. Feature
can be re-enabled by specifying `full_rebuild: false` in the configuration
Fix the code coverage reporting when using `.bundle` to store my gems in
by having SimpleCov ignore that directory. Use of `.bundle` to store my
gems consolidates things since since that directory also holds the
bundler config file. It also keeps a `vendor` directory out of the
project tree for non-Rails projects. Simplecov was not ignoring that
directory though, which meant that the code coverage numbers I were
seeing locally were wrong (and very frightening). With this change, all
is right with the world once again. 😃
When a post does not contain an excerpt_separator, meaning the excerpt
includes the entire post, the excerpt should contain exactly the post
content.
This is desirable both from a correctness standpoint, that the excerpt
should not introduce any new content, and more practically to allow fast
and easy detection of whole-post excerpts in Liquid templates using
`post.excerpt == post.content`. A common use-case is deciding whether
to render "Read More" links on a page containing post excerpts.
This commit does exactly that. It avoids adding additional newlines to
the excerpt content when the excerpt includes the whole post and adds
tests to ensure that this behavior is correct and preserved going
forward.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Non-string input was being missed as a result of poor comparison.
Converting inputs to strings ensure numerical and boolean values are
properly compared.
Fixes#3911.
This enables files such as images and PDFs to show up in the same relative
output directory as other HTML and Markdown documents in the same collection.
It also enables static files to be hidden using defaults from _config.yml in
the same way that other documents in the same collection and directories may
be hidden using `published: false`.
When looking for related posts, Jekyll was indexing `Jekyll::Post`
objects, but finding related posts based on `Jekyll::Post#content`. This
caused two problems:
1. Ruby 2.2 will warn on == if <=> throws an exception (and future Ruby
versions will surface that exception). Because `String`s can't be
compared with `Jekyll::Post`s, this warning was appearing all the time
while searching for related posts.
2. LSI won't return a post itself when searching for related posts. But
LSI could never tell that we were searching on a post, since Jekyll
passed post content, not a post object. With this fix, we can remove the
`- [post]` from `Jekyll::RelatedPosts#find_related`.
This is a more accurate fix for #3484.
When adding a dependency, also add the dependency to the metadata hash.
Addresses part 1 of #3591. Prior to this fix, the regnerator only paid attention the mtime of the first dependency it checked, so for posts/pages with N multiple dependencies (i.e., every layout file used to render them), it continues to regenerate the post/page approximately N times, at which point it's seen all of the dependencies.
Two tests for the regenerator cache clearing changes:
1. Intrusively test that the regnerator.clear_cache actually clears the cache ( in test/test_regenerator.rb )
2. Test that incremental building regenerates files that have changed that previously were unchanged ( in test/test_site.rb )
- Replaced occurrences of #array += with concat
operations.(performance)
- Corrected alignment.
- Removed rebase artifact.
Signed-off-by: Martin Rogalla <martin@martinrogalla.com>
Organized the draft, post and layout reader into the *readers* classes.
Fixed all references and ran tests.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
After carefully looking at these two methods, as of right now they do not
belong in the reader, as they should also be used by the writer. Thus the
decision was made to move them back into the class containing the source
and dest fields, site.rb.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
Extracted `in_source_dir` from site.rb into reader.rb.
Updated all the references and tests.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
This updates the default permalink style for pages and collections to
match the site-wide 'permalink' setting. If the permalink setting
contains a trailing slash, either explicitly or by being set to
':pretty', then pages and collections permalinks will contain trailing
slashes by default as well. Similarly, if the permalink setting
contains a trailing ':output_ext', so will pages and collections. If
the permalink setting contains neither a trailing slash or extension,
neither will pages or collections.
This impacts only the default permalink structure for pages and
collections. Permalinks set in the frontmatter of an individual page
take precedence, as does the permalink setting for a specific
collection.
Fixes#2691
This ensures that destination files for HTML posts, pages and
collections always include the proper file extension (as defined by
output_ext) regardless of permalink structure. This allows for URLs
that contain no extension or trailing slash to still result in proper
destination files with .html extensions.
Because this change relies so heavily on output_ext accurately
identifying the extension of the destination file, this change also
removes the feature test that tested support for permalinks with a .htm
extension. In order to support alternate file extensions, a future
patch or plugin will need to modify the output_ext value, at which point
everything else should work as expected.
- Added a test to check if the sort filter will raise the correct
exception on given nil input.
- Improved error message and used "nil" consistently.
Signed-off-by: Martin Jorn Rogalla <martin@martinrogalla.com>
* fabianrbz-remove_adapters_deprecation_warning:
Add minitest/profile to profile 10 slowest tests
Move simplecov_custom_profile to test/ & gate with TRAVIS env
Remove unused groups from simplecov's profile
Removes the following deprecation warning: 'method adapters is deprecated. use profiles instead'
Textile support was removed from jekyll core in #3319, and most of the
tests switched to markdown at that time. This changes the remaining
tests to use markdown as well. The vast majority of the test cases were
testing things in the file name or front matter, so it doesn't really
matter what markup format they use. The one test that was claiming to
test that textile was transformed had actually been moved to markdown as
well, just not renamed.
Fixes#3507
'method adapters is deprecated. use profiles instead'
This warning was showing up because the project was using
the gem 'simplecov-gem-adapter' which uses the old syntax.
* Remove the gem dependency
* Add a profile with the same setup that the gem has
* nitoyon-slugify-new-param:
Remove superfluous Sass declarations.
Move the slugify options out to their own section so as to fix the formatting.
Document the mode parameter of slugify Liquid filter
Add tests for mode parameters of slugify Liquid filter
Add mode parameter to slugify Liquid filter
Conflicts:
lib/jekyll/utils.rb
---> Hadn't added UTF-8 support in nitoyon's PR.
* davidized-collection_yaml_dots:
Move YAML Front Matter regexp into a constant.
Add support for collections documents to have YAML front matter ending in dots.
Conflicts:
test/test_collections.rb
* majioa-devel:
Ensure Post#excerpt_separator always returns a string.
get procedure for default excerpt separator for both cases site and page was moved to the post's specific method :excerpt_separator.
Added per post excerpt_separator functionality, so you are able to specify :excerpt_separator (as well as just :excerpt) key direct inside the post YAML, to make an excerpt based on the value in the post. Tests were also added.
specify :excerpt_separator (as well as just :excerpt) key direct inside
the post YAML, to make an excerpt based on the value in the post. Tests
were also added.
Document#destination wasn't unescaped properly.
For example, when we have a document named '_langs/c#.md',
we expect its url to be '/langs/c#.html',
but it was actually '/langs/c%23.html'.
We now unecape URL at Document#destination like Post#destination and
Page#destination.