✨ Add Slug Generator
This commit is contained in:
parent
921020d9fd
commit
1d235af876
8 changed files with 124 additions and 1 deletions
|
|
@ -90,3 +90,19 @@ func ExampleIncrementalWithStartAndStep() {
|
|||
// foo_44.txt
|
||||
// foo_46.txt
|
||||
}
|
||||
|
||||
func ExampleSlug() {
|
||||
conf := NewConfig(WithGenerator(Slug()), WithOriginal("My name is Jimmy"))
|
||||
str, _ := Make(conf)
|
||||
fmt.Println(str)
|
||||
|
||||
// Output: my-name-is-jimmy.txt
|
||||
}
|
||||
|
||||
func ExampleSlugWithLang() {
|
||||
conf := NewConfig(WithGenerator(SlugWithLang("de")), WithOriginal("Diese & Dass"))
|
||||
str, _ := Make(conf)
|
||||
fmt.Println(str)
|
||||
|
||||
// Output: diese-und-dass.txt
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue