45 Commits

Author SHA1 Message Date
Ashwin Maroli
5e1b6d3fae Configure some new cops (#9688)
Merge pull request 9688
2024-10-17 06:10:15 -07:00
Matt Rogers
1f3c0dc0d4 fix(rubocop): correct lint errors (#9600)
Merge pull request 9600
2024-05-22 11:01:18 -07:00
lm
2a0272cc38 Only enable BOM encoding option on UTF encodings (#8363)
Merge pull request 8363
2022-04-01 06:35:24 -07:00
Ashwin Maroli
2568aea6ea Fix RuboCop offenses in tests 2021-08-18 15:21:08 +05:30
Andrew Davis
3f46f02108 Update rubocop from 1.12 to 1.18 and min ruby from 2.4 to 2.5 (#8741)
Merge pull request 8741
2021-07-22 13:58:40 -04:00
matt swanson
f8286b62a2 Switch slugify regex to support more Unicode character groups (#8167)
Merge pull request 8167
2020-05-14 02:20:20 -04:00
mo khan
2bdf1a53c4 Log a warning when the slug is empty (#7357)
Merge pull request 7357
2019-03-15 13:35:01 -04:00
Ashwin Maroli
9adac3a11e Fix Rubocop offences in test files (#7128)
Merge pull request 7128
2018-07-12 10:21:23 -04:00
Alex Tsui
93e3eb06d2 Add latin mode to slugify (#6509)
Merge pull request 6509
2017-11-02 23:07:25 -04:00
Parker Moore
8fc463bdce Add Utils::Internet.connected? to determine whether host machine has internet connection. (#5870)
Merge pull request 5870
2017-11-02 16:54:42 -04:00
jekyllbot
e7f1ce2e2b Update Rubocop to 0.51.0 (#6444)
Merge pull request 6444
2017-10-19 14:22:36 -04:00
Frank Taillandier
363bd6c7eb Problematic UTF+bom files (#6322)
Merge pull request 6322
2017-10-17 23:15:26 -04:00
ashmaroli
00bad8bfe5 Bump rubocop to use v0.50.x (#6368)
Merge pull request 6368
2017-09-22 09:06:32 -04:00
Parker Moore
7cf5f51ca2 Enforce Style/FrozenStringLiteralComment. (#6265)
Merge pull request 6265
2017-08-03 21:27:32 -04:00
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
dbc0349909 tests: Typo fixes. 2016-07-18 21:20:47 +03:00
Parker Moore
6f3c01ca87 Fix for jruby 2016-06-28 18:30:02 -07:00
Pat Hawks
5a23b130ce Rubocop: test/test_utils.rb 2016-05-25 22:01:10 -05:00
Jussi Kinnula
4effe25cc1 Fix slugify test 2016-03-29 10:11:47 +03:00
Jussi Kinnula
487631e935 Add tests for ascii slugify mode 2016-03-29 09:07:30 +03: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
5d79c55b2c Fix deep_merge_hashes! handling of drops and hashes 2016-01-15 11:22:39 -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
Parker Moore
5bf596b239 utils/drops: update Drop to support Utils.deep_merge_hashes
Fixes #4287
2015-12-27 08:06:37 -05:00
Pat Hawks
69a6323599 Utils.deep_merge_hashes failing test 2015-12-27 07:48:45 -05: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
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
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
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
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
nitoyon
3c5e9f5334 Add tests for mode parameters of slugify Liquid filter 2014-10-12 02:50:08 +09:00
Chris Frederick
62a3961739 Add tests for Utils#slugify 2014-09-02 14:33:03 +09:00
Alfred Xing
c7f8c70935 Add tests for Utils.parse_date method 2014-08-02 15:03:31 -07:00
Terry Schmidt
0371b69952 Set categor[y|ies] on post if they appear in site frontmatter defaults 2014-05-09 13:34:13 -05:00
Parker Moore
4de2be8c5f Add Jekyll::LiquidExtensions.lookup_variable
To use, just include `Jekyll::LiquidExtensions` as you please:

```ruby
class SayHi < Liquid::Tag
  include Jekyll::LiquidExtensions

  def initialize(tag_name, markup, tokens)
    @markup = markup.strip
  end

  def render(context)
    "hi #{lookup_variable(context, @markup)}"
  end
end
```

Fixes #2071.
2014-04-22 14:27:47 -04: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