Commit Graph

100 Commits

Author SHA1 Message Date
Parker Moore 4fbbeddae2
Fix Page#relative_path so that it consistently does NOT have the prepending slash (previously inconsistent)
Fixes for #4946
2016-05-25 17:57:09 -07:00
Brint O'Hearn 3a04093e51 Rubocop cleanup for lib/jekyll/page.rb 2016-05-25 11:27:29 -05: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 9daebe8dd2 Use improved Page#dir 2016-01-27 08:32:36 -08:00
Parker Moore 38b64faeb2 Page#dir: ensure it ends in a slash 2016-01-26 16:44:30 -08:00
Zshawn Syed 4ecdf6ce10 Remove extra OR condition since a missing hash key will return a nil anyway. Added a test to catch this nil condition since it was missing to begin with. Reduced line length in test_page.rb 2016-01-21 23:44:30 -06:00
Parker Moore e75d703806 Page#write? shouldn't freeze 'true' 2016-01-18 15:33:58 -08:00
Parker Moore e5d8bdee8f Page: freeze true in write? 2016-01-18 12:47:48 -08:00
Parker Moore 0a6f289ba5 page: write? should always be true 2016-01-18 11:53:16 -08:00
Parker Moore d343da61eb Page: pipe through Renderer instead of using Convertible 2016-01-18 11:41:05 -08:00
Parker Moore b6c283a4ae wip: allow custom extensions 2016-01-04 17:42:06 -08:00
Parker Moore 735194ccaf Convertible/Page/Renderer: use payload hash accessor & setter syntax 2016-01-04 12:37:19 -08:00
Pat Hawks 04e635b10c
Rubocop: Style/SpaceInsideRangeLiteral
- Space inside range literal
2016-01-04 12:06:40 -08:00
Pat Hawks 4c5d77a4b5 Rubocop: Style/EmptyLines 2016-01-04 11:08:18 -08:00
Pat Hawks 11f0aab4b1
Rubocop: Lint/UnusedBlockArgument
- Unused block argument
2016-01-03 16:24:13 -08:00
Pat Hawks 98a19cdf2b
Rubocop: Style/PercentLiteralDelimiters
- %w-literals should be delimited by ( and )
Rubocop: Style/WordArray
 - Use %w or %W for array of words
2016-01-03 15:32:11 -08:00
Parker Moore 82c3ee365f Initial work on using Liquid::Drops instead of Hashes.
The properties of Liquid::Drops are only evaluated when they're asked for
and therefore save computation time. This prevents a lot of GC time cleaning
up objects that are not needed, because they're not created unless requested.
Additionally, this saves time for actual computation of those values because
they can be computed only if needed.

It's funny how much it helps when you only do what is needed. Far less overhead.
2015-12-21 22:47:30 -05:00
Jordon Bedwell 90865d5fc1 Fix #4082: Allow users to use .htm and .xhtml (XHTML5.) 2015-11-18 16:02:03 -06:00
Parker Moore b89f943bf2 collections: posts as collection 2015-10-26 00:29:14 -07:00
Stephen Crosby 7c4f319442 #3870 trigger hooks by owner symbol 2015-07-27 16:23:07 -07:00
Stephen Crosby 6ca9633354 prototype of jekyll hooks, encapsulated 2015-05-01 14:35:15 -07:00
Alfred Xing 9ab3c201c8 Remove relative permalinks 2015-04-28 14:03:20 -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
Parker Moore 3f3b203992 Use end_with? instead of regexp for adding index.html 2015-02-25 11:59:27 -08:00
Parker Moore 2ee8d690c4 More conversion of Jekyll.sanitized_path ~> site.in_(source|dest)_dir 2014-11-03 22:16:48 -08:00
Parker Moore 461e16f8bc More tests are passing. Hooray. 2014-11-03 22:15:40 -08:00
Parker Moore 0bc88975c8 More removal of File.join 2014-11-03 22:15:40 -08:00
Parker Moore 2eb318a929 Replace costly Hash#fetch with arity=2 with arity=1 + block. 2014-10-22 01:43:46 -07:00
Parker Moore 6bd07501e8 Merge branch 'frontmatter-defaults' of git://github.com/maul-esel/jekyll into maul-esel-frontmatter-defaults
* 'frontmatter-defaults' of git://github.com/maul-esel/jekyll:
  move self.type to convertible
  oops, fix minor indentation quirk
  document frontmatter defaults precedence
  adjust frontmatter defaults precedence handling
  change cucumber feature to test for precedence too
  fix frontmatter defaults for custom paths
  more robust cucumber features
  fix slash handling for paths
  move cucumber features to own file
  fix minor docs quirk
  improve path checking, now using Pathname instead of regex
  Add site documentation for the new feature
  add inline code docs
  improve validation code
  fix for Ruby 1.8
  Add basic cucumber features for frontmatter defaults
  Retrieve frontmatter defaults when retrieved internally
  make frontmatter defaults available to liquid
  add a class `FrontmatterDefaults` for handling of frontmatter defaults
  Add a method to retrieve type to post, page and draft

Conflicts:
	lib/jekyll.rb
	lib/jekyll/convertible.rb
	lib/jekyll/core_ext.rb
	lib/jekyll/page.rb
	lib/jekyll/post.rb
2014-04-04 15:32:27 -04:00
nitoyon c56ce248c9 Move URL escape to Jekyll::URL 2014-03-21 16:59:25 +00:00
nitoyon e3e1c11509 Fix Page#url escape
Post#url wasn't escaped at all.

For example, when we have a page named 'a#b.html',
we expect its url to be 'a%23b.html',
but it was actually 'a#b.html'.

We now use Jekyll::URL.escape_path and Jekyll::URL.unescape_path.
2014-03-21 16:57:41 +00:00
Parker Moore 7787d64bce Rename those Utils functions. 2014-03-04 15:52:05 -05:00
Parker Moore e2af1b547b Extract core extensions into a Utils module
Fixes #2111
2014-03-03 22:13:03 -05:00
Parker Moore 57d07469d3 Sanitize paths uniformly, in a Windows-friendly way.
Fixes kinda a #1948 thing.
Related to #1946.
2014-02-23 20:05:23 -05:00
Corey Ward f1c4e247a5 Remove unnecessary references to `self` 2014-02-21 16:27:21 -06:00
Parker Moore ab0ebadee3 Merge master into security-vuln-patches 2014-02-16 22:02:03 -05:00
Parker Moore 1176fc6f57 Give File.join the strings from the array 2014-02-08 00:38:59 -05:00
Parker Moore baabe7eb7e DRY up code, props @tamouse 2014-01-30 22:03:10 -05:00
Parker Moore 606c525099 Relative posts should never fail to build, even if @dir or @name is nil
Fixes https://github.com/jekyll/jekyll/issues/1963
2014-01-21 23:50:20 -05:00
Ben Balter e3be74e376 sanity check for pages permalink traversal
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 22:21:30 -08:00
Aidan Feldman 2bfafb3b33 make non-data properties/methods accessible to Liquid
per https://github.com/jekyll/jekyll/pull/1849/files#r8490593
2013-12-22 03:38:32 -05:00
maul.esel 960e01cba8 move self.type to convertible 2013-12-05 09:14:31 +01:00
maul.esel fb911af2cd Retrieve frontmatter defaults when retrieved internally
This is for example possible for layout defaults to take effect.
2013-09-11 00:57:18 +02:00
maul.esel 3ccd8dad31 Add a method to retrieve type to post, page and draft 2013-09-11 00:48:05 +02:00
Matt Rogers a9e2a74ea6 Merge pull request #1341 from maul-esel/minor-refactors
Minor refactors
2013-08-29 20:21:08 -07:00
Lucas Jenss a23e94ad48 Improve comment for url_placeholders method 2013-07-31 23:17:06 +02:00
Lucas Jenss cce58159ce Use symbols for all placeholders
See https://github.com/mojombo/jekyll/pull/944#discussion_r5443105
for a discussion.
2013-07-31 23:11:51 +02:00
Lucas Jenss f5d0be9660 Move URL generation to own class instead of a module
As suggested by @parkr in #944
2013-07-25 22:44:27 +02:00
maul.esel 6c6dd173c7 Post + Page: extract real path retrieval into separate method (@parkr) 2013-07-24 16:30:24 +02:00