Commit Graph

132 Commits

Author SHA1 Message Date
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
maul.esel 75d6587d27 Move #to_liquid to Convertible 2013-07-22 16:34:01 +02:00
maul.esel 5d777eb9e9 With the move of path handling, Page#to_liquid can be simplified 2013-07-22 16:02:50 +02:00
maul.esel 08567b1091 move path handling in pages to the `path` method, as in posts 2013-07-22 16:02:50 +02:00
maul.esel f0e2468249 simplify some code with Hash#fetch 2013-07-22 16:02:42 +02:00
Lucas Jenss 2ac98a7358 Merge branch 'master' into permalink-special-characters
Conflicts:
	lib/jekyll/page.rb
	lib/jekyll/post.rb
2013-07-14 23:58:22 +02:00
Anand Narayan 5c47014c90 removed cgi unescape in page destination 2013-06-15 18:38:14 +05:30
Parker Moore d9f0dce67d make sure relative_permalinks is set to TRUE 2013-05-12 01:16:52 +02:00
Parker Moore 2e1316ec8b Ensure the page is in a subdir. That's the only time it's eff'd. 2013-05-12 01:08:33 +02:00
Parker Moore 0e82b4eb2f Use site config to determine whether permalinks should be relative. 2013-05-11 18:26:20 +02:00
Parker Moore 1f23bc4dc0 Add support for relative permalinks 2013-05-11 18:03:03 +02:00
Parker Moore b355ef6469 Add jekyll doctor command 2013-05-11 17:49:20 +02:00
Parker Moore e22b1bb74a Add deprecation support for pages in subfolders with relative permalinks. 2013-05-11 17:40:00 +02:00
maul.esel d73841c961 always ADD a leading slash to page.url or post.url 2013-04-20 13:15:40 +02:00
maul.esel c6df2e150a remove leading slash from page.url and post.url 2013-04-19 16:37:48 +02:00
Parker Moore 6ed41e373c Remove code duplication: #write in Page and Post is the same. 2013-04-16 02:55:31 +02:00
Parker Moore e7546a98f6 Remove unnecessary override of #read_yaml in Page. 2013-04-15 19:24:23 +02:00
maul.esel b7064a4bc3 remove 'post' and 'page' default layouts 2013-04-15 17:24:09 +02:00
maul.esel 968f3b0911 allow overriding page.path in YAML frontmatter 2013-04-13 00:05:49 +02:00
maul.esel d64fd1e8fe expose file path relative to source dir to liquid
Fixes #633.
2013-04-12 17:37:16 +02:00
Lucas Jenss cfcbe1f830 Refactor URL processing/generation into separate module
This is done to prepare for improved permalink generation
for URLs containing special characters, as proposed in
issue #782
2013-04-09 23:53:46 +02:00
Parker Moore 725b127f9b Merge pull request #536 from fotos/fix_page_dir
Added path in url.
2013-03-09 17:07:16 -08:00
Fotos Georgiadis f79662719b Fix indentation. 2013-03-09 15:07:27 +02:00
Fotos Georgiadis 441eddf1ca Fix pretty url style paths.
Ignore the basename if the page is an index page, preserve it if it's just an
html page and use the full path in every other case.
2013-02-28 03:49:39 +02:00
Tom Bell 517e6f81d3 Remove new lines between module and class 2013-01-20 00:00:49 +00:00
Parker Moore 5a3e05dbff Ensuring that layout is only set to the default value if layout is not specified 2013-01-12 15:31:14 -08:00
7rans e8c74fe7a8 Layouts default to page or post depending upon type. 2013-01-12 13:49:45 -08:00
Fotos Georgiadis 4090500c5a Added path in url.
Page#dir was returning the wrong dir ('/') for pages in directories.
2012-04-09 03:08:41 +03:00
Lee Jarvis 6a756881f9 clean up some warnings 2011-06-03 23:38:39 +01:00
Tom Preston-Werner a428acec1c TomDoc some things. 2011-05-08 14:49:19 -07:00
Aman Gupta 13cc44fb12 sanitize urls and ignore symlinks 2011-03-10 20:14:38 -08:00
Stefan Schüßler 5b680f8dd8 remove orphaned files in destination 2010-12-01 18:04:50 +01:00
Leandro Lisboa Penz b1049c84cd Correctly generates file basename. Fixes #208.
The previous procedure generated invalid basenames when the filename had
more than one dot.
2010-09-05 18:11:09 -03:00
Tom Preston-Werner f35d287c66 Fix page.url to include full relative path. Fixes #181. 2010-06-25 15:12:39 -07:00
Kris Brown 1261840769 generate phase added to site#process and pagination is now a generator 2010-02-27 15:31:59 +00:00
Kris Brown ef2fabb189 also provide html_pages. this is better for sitemaps should you wish to auto-populate page entries 2010-02-27 14:09:07 +00:00
Kris Brown e8971b2999 Merge branch 'issue_64_broken' into enh_pages_in_payload 2010-02-27 09:38:05 +00:00
Kris Brown f73dac1582 fixes problem in issue 64 fix where pages like about.md would be output as about.md/index.html. provides the output extension as a method rather than replacing the ext attribute as part of transform 2010-02-27 09:27:36 +00:00
Kris Brown 5a807aa12e pages now present in the site payload and can be used through the site.pages variable 2010-02-27 08:09:13 +00:00
Tom Preston-Werner b68149c7bc fix pagination to adhere to read/render/write paradigm 2010-01-12 14:43:28 -08:00
Jeffry Degrande 176c047ff1 bugfix for permalinks
Signed-off-by: Nick Quaranto <nick@quaran.to>
2009-07-14 19:17:44 -04:00
Simon Chiang ca98cd0152 updated convertible to allow for posts with no, or empty YAML 2009-06-23 20:55:13 -06:00
eugenebolshakov 49c39f43a1 the index page should always have index.html permalink no matter what 2009-05-10 15:29:05 +04:00
eugenebolshakov ee0167d706 Made pages respect permalinks style and permalinks in yml front matter 2009-05-10 14:53:00 +04:00
David Calavera 808d6c6a62 posts' pagination 2009-04-04 12:43:46 +02:00
Tom Preston-Werner 73d42b24ad Huge refactor to move all config into Jekyll::Site
This commit makes Jekyll threadsafe (or at least makes it possible to be so).
It also makes it a ton easier to use Jekyll as a library for scripted site
transformation. I did, however, break all the tests. =(
2009-03-12 19:05:43 -07:00
Tom Preston-Werner dd8054411c deep merge hashes so as to not lose data 2008-12-24 22:06:42 -08:00
Tom Preston-Werner c46ea4096d simplify and correct rendering pipeline 2008-12-24 13:17:28 -08:00
Jack Danger Canty f3a1aa99e2 updating some comments in Page that referred to Post 2008-12-10 15:24:49 -08:00
Chris Van Pelt 4fc33a6dfe Got rid of the templating step in the initialize method 2008-11-23 23:39:16 -08:00
Tom Preston-Werner bffdeee637 rename to Jekyll 2008-11-17 11:07:54 -08:00