Commit Graph

13 Commits

Author SHA1 Message Date
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
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