Commit Graph

60 Commits

Author SHA1 Message Date
Ashwin Maroli
9adac3a11e Fix Rubocop offences in test files (#7128)
Merge pull request 7128
2018-07-12 10:21:23 -04:00
Pat Hawks
4c7dbb6915 Fix tests to have "expected value" as the first argument passed to assert_equal (#7104)
* assert_equal(exp, act)

* improve clarity of PageWithoutAFile test

* Hoist invariant out of loop
2018-07-09 11:10:35 -05:00
ashmaroli
f8a66ca76c Improve handling non-default collection documents rendering and writing (#6795)
Merge pull request 6795
2018-03-09 21:11:24 -05:00
Florian Thomas
cf5c689d94 Fix timezone incosistencies between different ruby version (#6697)
Merge pull request 6697
2018-01-25 10:43:56 -05:00
Frank Taillandier
363bd6c7eb Problematic UTF+bom files (#6322)
Merge pull request 6322
2017-10-17 23:15:26 -04:00
Parker Moore
7cf5f51ca2 Enforce Style/FrozenStringLiteralComment. (#6265)
Merge pull request 6265
2017-08-03 21:27:32 -04:00
Ben Balter
f91b614793 Static files contain front matter default keys when to_liquid'd (#6162)
Merge pull request 6162
2017-06-30 21:51:55 -04:00
Anatoliy Yastreb
d3b00cb84c Bump Rubocop to 0.49.1 (#6093)
Merge pull request 6093
2017-06-15 08:29:35 -04:00
ashmaroli
7d7a312b33 Bump Rubocop to v0.48 (#5997)
Merge pull request 5997
2017-04-09 07:24:45 -04:00
Pat Hawks
1d885911bc Rubocop: Require consistent comma in multiline literals 2017-01-12 17:52:29 -06:00
Pat Hawks
69c4a8a1aa Use assert_nil instead of assert_equal nil
Fixes #5648
2016-12-10 11:31:04 -06:00
jona
fac041933c fix date parsing in file names 2016-11-29 09:14:03 +01:00
XhmikosR
dbc0349909 tests: Typo fixes. 2016-07-18 21:20:47 +03:00
Pat Hawks
5291bd0498 Rubocop: test/test_document.rb 2016-05-25 21:59:33 -05:00
Parker Moore
aff1430608 Fix tests for document drop JSONification based on master updates. /cc #4914 2016-05-25 16:04:16 -07:00
Parker Moore
17d8c96a63 Add ability to render drops as JSON
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.
2016-05-24 19:08:46 -05:00
Parker Moore
40e3a04704 test_document: scopes are based on relative_path 2016-04-18 13:56:02 -07:00
Parker Moore
3aa80b7d04 Allow collections to have documents that have no file extension 2016-02-19 13:40:17 -08:00
Parker Moore
d7ff4234f0 Renderer#output_ext: honor folders when looking for ext
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.
2016-01-25 15:32:44 -08:00
Parker Moore
b6c283a4ae wip: allow custom extensions 2016-01-04 17:42:06 -08:00
rebornix
6a98ab2a15 Make :title cased for backwards compability and add :slug for uncased usage. 2015-11-18 10:43:13 +08:00
Jordon Bedwell
e5f26b5a36 Fix test warnings when doing rake {test,spec} or script/test 2015-10-29 15:18:19 -05:00
Parker Moore
b89f943bf2 collections: posts as collection 2015-10-26 00:29:14 -07:00
Will Norris
0d1586a5c4 Improved permalinks for pages and collections
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
2015-03-04 09:38:23 -08:00
Will Norris
669c803912 always include file extension on destination files
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.
2015-03-02 21:20:54 -08:00
Alfred Xing
422fd7d304 Use fixture_site for Document tests
Should fix #3500
2015-02-24 20:31:16 -08:00
Parker Moore
7ad0597bff Make our own Minitest::Test subclass for further subclassing 2015-02-21 00:33:47 -08:00
Parker Moore
4b59eb4175 Fix the test inheritance for the tests. 2015-02-20 13:35:02 -08:00
Parker Moore
0c624eb11b The :title URL placeholder for collections should be the filename slug.
This mimicks posts most closely. It can be overridden by the
YAML front matter.

Undoes some of #2864.
2015-01-30 01:53:11 -08:00
Parker Moore
b2099ac763 Merge branch 'davidized-collection_yaml_dots'
* 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
2015-01-17 15:24:33 -08:00
Parker Moore
502fd94f2c Merge pull request #3172 from alfredxing/docs-output-overrides 2015-01-05 23:19:12 -08:00
Alfred Xing
7655b533c9 Allow documents to set published in front matter 2015-01-05 16:11:02 -08:00
nitoyon
5e10958faa Unescape Document output path
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.
2014-12-29 22:38:50 +09:00
Parker Moore
e39dfa3f0b Merge pull request #2908 from alfredxing/document-path 2014-12-29 00:26:35 -05:00
Alfred Xing
dc30114605 Use site.in_source_dir 2014-11-23 16:16:19 -08:00
Alfred Xing
ac03af3229 Implement @mattr-'s suggestions 2014-11-21 22:12:21 -08:00
Alfred Xing
fe6bfc6f1b Fix failing tests 2014-11-21 22:12:21 -08:00
David Williamson
d7e3d4df8f Add support for collections documents to have YAML front matter ending in dots. 2014-11-20 14:38:17 -06:00
Parker Moore
4078bde3ba More passing tests. 2014-11-03 22:15:41 -08:00
Parker Moore
461e16f8bc More tests are passing. Hooray. 2014-11-03 22:15:40 -08:00
Parker Moore
73ca205a5c Add test for Document#basename_without_ext 2014-10-12 14:33:13 -07:00
Alfred Xing
6c0e791236 Use relative path for path Liquid variable in Documents 2014-09-10 21:04:40 -07:00
Chris Frederick
be2b16507e Test documents without a title 2014-09-01 13:32:31 +09:00
Chris Frederick
a5e51cfdbe Properly handle titles with trailing punctuation 2014-09-01 13:25:38 +09:00
Chris Frederick
4dec3c8c6b Test titles in document permalinks 2014-09-01 13:04:54 +09:00
Chris Frederick
cc4a0d1704 Change :title to :name 2014-08-26 11:26:19 +09:00
Chris Frederick
e8b00fb6f2 Add the 'title' variable to collection permalinks 2014-08-23 14:50:55 +09:00
Parker Moore
530e049d2d Read in static files info collection.files as StaticFiles. 2014-08-12 15:59:45 -04:00
Parker Moore
81807cb5af Merge pull request #2615 from alfredxing/collections-static-files 2014-08-02 14:44:45 -04:00
Alfred Xing
bd59fa14f3 Add tests for static files in collections 2014-08-02 09:00:03 -07:00