mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 09:48:30 -05:00
Merge pull request #2799 from kansaichris/add-title-to-collection-permalinks
This commit is contained in:
@@ -45,6 +45,15 @@ module Jekyll
|
||||
File.basename(path, suffix)
|
||||
end
|
||||
|
||||
# The sluggified base filename of the document.
|
||||
#
|
||||
# Returns the base filename of the document in lowercase, with every
|
||||
# sequence of spaces and non-alphanumeric characters replaced with a
|
||||
# hyphen.
|
||||
def slug
|
||||
File.basename(path, ".*").downcase.gsub(/[\W\s]+/, '-')
|
||||
end
|
||||
|
||||
# The extension name of the document.
|
||||
#
|
||||
# Returns the extension name of the document.
|
||||
@@ -128,7 +137,8 @@ module Jekyll
|
||||
{
|
||||
collection: collection.label,
|
||||
path: cleaned_relative_path,
|
||||
output_ext: Jekyll::Renderer.new(site, self).output_ext
|
||||
output_ext: Jekyll::Renderer.new(site, self).output_ext,
|
||||
name: slug
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user