Commit Graph

62 Commits

Author SHA1 Message Date
Ashwin Maroli c4142c4c77 add a utility submodule to define 'TZ' on Windows 2016-12-06 15:38:18 +05:30
Parker Moore c1e6f1fb94
Fix rubocop errors & add one more test for slugify 'ascii' mode (#4680) 2016-09-07 17:50:14 -07:00
Parker Moore 9164973a6c
Merge branch 'jussikinnula-master'
* jussikinnula-master:
  Fix slugify test
  One final "urlsafe" replaced with "ascii"
  Change urlsafe to ascii also when actually slugifying
  Add tests for ascii slugify mode
  Rename urlsafe to ascii, and document it (on utils.rb)
  Add urlsafe to accepted slugify modes
  Add urlsafe method for slugify
2016-09-07 16:50:32 -07:00
XhmikosR 5ca080ac6f Whitespace cleanup. 2016-07-18 21:31:17 +03:00
Parker Moore 9278eb8fce
utils: check that the object is a hash when merging default_proc
Follow-up to #5026.
2016-06-22 12:15:07 -07:00
Anatoliy Yastreb 08b883b268 rubocop: fix code style 2016-06-20 16:03:42 +03:00
Parker Moore d84844c223 Freeze configuration defaults & duplicate in deep_merge_hashes if need be. 2016-05-24 18:49:05 -05:00
Jussi Kinnula 4c65772c44 One final "urlsafe" replaced with "ascii" 2016-03-29 10:01:08 +03:00
Jussi Kinnula 764a2c1b39 Change urlsafe to ascii also when actually slugifying 2016-03-29 09:46:42 +03:00
Jussi Kinnula e823ac5180 Rename urlsafe to ascii, and document it (on utils.rb) 2016-03-29 09:07:12 +03:00
Jussi Kinnula c0dec091a2 Add urlsafe to accepted slugify modes 2016-03-18 17:14:54 +02:00
Jussi Kinnula 36dc8c2169 Add urlsafe method for slugify 2016-03-18 11:13:06 +02:00
Parker Moore 97efa0f0ce Clean up Tags::PostUrl a bit 2016-03-15 16:06:25 -07:00
atomicules e4aa45b03f Fix titleize_slug so already capitalized words are not dropped
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
2016-02-15 21:22:50 +00:00
Parker Moore aad54c9a87 Add Utils.merged_file_read_opts to unify reading & strip the BOM 2016-01-26 17:08:54 -08:00
Parker Moore 8204e479c3 add Utils.strip_heredoc 2016-01-22 09:11:56 -08:00
Jordon Bedwell 67f842546e Fix #4191: Reduce Document#post_read complexity slightly. 2016-01-22 09:11:56 -08:00
Parker Moore 5d79c55b2c Fix deep_merge_hashes! handling of drops and hashes 2016-01-15 11:22:39 -08:00
Parker Moore 3e81331af1 Utils: don't require mime/types 2016-01-15 10:00:45 -08:00
Parker Moore b6c283a4ae wip: allow custom extensions 2016-01-04 17:42:06 -08:00
Parker Moore cb5bc1093e utils: has_yaml_header? should accept files with extraneous spaces
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.
2016-01-04 14:09:30 -08:00
Pat Hawks ab3d906e04
Rubocop: Style/ParenthesesAroundCondition
- Don't use parentheses around the condition of an if
2016-01-04 12:14:00 -08:00
Pat Hawks f6fd9014ba
Rubocop: Style/CaseIndentation
- Indent when as deep as case
2016-01-04 11:15:37 -08:00
Pat Hawks 4c5d77a4b5 Rubocop: Style/EmptyLines 2016-01-04 11:08:18 -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
Pat Hawks fb0457bf3d
Rubocop: Style/AndOr
- Use && instead of and
 - Use || instead of or
2016-01-03 15:30:26 -08:00
Parker Moore 5bf596b239 utils/drops: update Drop to support Utils.deep_merge_hashes
Fixes #4287
2015-12-27 08:06:37 -05:00
Parker Moore d070a77716 url: fix issue with bad URL escaping when using Drop 2015-12-24 15:07:20 -05:00
Jordon Bedwell 28c568386d Merge pull request #4220 from jekyll/pull/enable-codeclimate-platform
Fix: #4219: Add CodeClimate Platform.
2015-12-04 12:08:00 -06:00
Jordon Bedwell b6de905ee4 Fix: #4219: Add CodeClimate Platform. 2015-12-04 11:42:52 -06:00
Parker Moore 6cbd06ea85 Merge pull request #4109 from jekyll/cleanup-kramdown-converter
Merge pull request 4109
2015-12-04 09:21:22 -08:00
Jordon Bedwell 3432fd2c2d Modernize Kramdown for Markdown converter. 2015-12-04 08:09:08 -06:00
Parker Moore b90f8e048a Merge pull request #4150 from ducktyper/master
Merge pull request 4150
2015-11-30 19:57:01 -08:00
ducksan cho e9f8b4df74 Add Windows support to Utils.safe_glob 2015-11-19 17:15:51 +13:00
Ducksan Cho a168edae45 Add Utils.safe_glob method
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.
2015-11-19 00:46:46 +13:00
rebornix 6a98ab2a15 Make `:title` cased for backwards compability and add `:slug` for uncased usage. 2015-11-18 10:43:13 +08:00
Parker Moore 45f69bb8cd Utils: deep_merge_hashes should also merge default_proc
If the target hash's default_proc isn't set, overwrite with the new hash's default_proc.

/cc #4064
2015-10-26 17:27:36 -07:00
Parker Moore b89f943bf2 collections: posts as collection 2015-10-26 00:29:14 -07:00
Jordon Bedwell ae11cae659 Fix #3653: Add a doctor helper to test pwd's. 2015-05-17 02:46:40 -05: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
Parker Moore aaf0ba15cc Use frozen regular expressions for Utils#slugify 2015-01-17 16:25:33 -08:00
Parker Moore 10659e1eef Merge branch 'nitoyon-slugify-new-param'
* 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.
2015-01-17 16:06:10 -08:00
Parker Moore a098dc80cd Merge pull request #3234 from jekyll/ruby-2-2 2014-12-29 20:49:04 -05:00
Parker Moore 7bcf8d689e Always call Time#localtime to translate to TZ'd time. 2014-12-29 20:12:35 -05:00
Renaud Martinet f9e249ae20 Generalize Utils#slugify for any scripts
It replaces any non alphanumeric glyphs by an hyphen.
2014-10-31 15:56:03 +01:00
Parker Moore 7fd9f102c0 Merge pull request #2997 from jekyll/utils-slugify 2014-10-20 20:11:04 -07:00
Glauco Custódio 68c0e8f847 Hash#each_key instead of Hash#keys.each. Faster code. 2014-10-20 10:10:29 -02:00
Parker Moore 9f5835871b Utils.slugify: Don't create new objects when gsubbing 2014-10-12 16:18:40 -07:00
nitoyon 46e76bde3f Add mode parameter to slugify Liquid filter 2014-10-12 02:44:58 +09:00
Chris Frederick 4adc35aaf3 Revise Utils#slugify with inspiration from Rails 2014-09-02 14:32:14 +09:00