-
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for passing in options to slug and slugify filters. Switch …
…to decamelize default for slugify filter.
- Loading branch information
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
const slugify = require("@sindresorhus/slugify"); | ||
|
||
module.exports = function(str, options = {}) { | ||
return slugify(str, options); | ||
return slugify(str, Object.assign({ | ||
decamelize: false | ||
}, options)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: "Hi, I'm Zach" | ||
title: "Hi, I'm ZAch" | ||
permalink: subdir/{{ title | slugify }}/index.html | ||
--- | ||
Slugged. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: "Hi, I am ZAch" | ||
permalink: "subdir/{{ title | slug({replacement:'_'}) }}/index.html" | ||
--- | ||
Slugged. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: "Hi, I'm ZAch" | ||
permalink: "subdir/{{ title | slugify({decamelize: true}) }}/index.html" | ||
--- | ||
Slugged. |