Skip to content

DraftDir + manage accent for slug()#12

Open
Flyounet wants to merge 2 commits intotaylorchu:masterfrom
Flyounet:draftdir
Open

DraftDir + manage accent for slug()#12
Flyounet wants to merge 2 commits intotaylorchu:masterfrom
Flyounet:draftdir

Conversation

@Flyounet
Copy link

Draftdir : This feature generates a directory where th e posts in draft mode are generated.

The modification for slug is a feature for people who use a language with accent.
For example :
echo 'Baker est très bien' | tr -cs '[:alnum:]\n' - | tr '[:upper:]' '[:lower:]' | sed 's|^-||;s|-$||'
baker-est-tr-s-bien

Now it handles them :
echo 'Baker est très bien' | iconv -f utf8 -t ascii//TRANSLIT | tr -cs '[:alnum:]\n' - | tr '[:upper:]' '[:lower:]' | sed 's|^-||;s|-$||'
baker-est-tres-bien

Previously the slug function didn't handled accent :
echo 'Baker est très bien' | tr -cs '[:alnum:]\n' - | tr '[:upper:]' '[:lower:]' | sed 's|^-*||;s|-*$||'
baker-est-tr-s-bien

Now it handles them :
echo 'Baker est très bien' | iconv -f utf8 -t ascii//TRANSLIT | tr -cs '[:alnum:]\n' - | tr '[:upper:]' '[:lower:]' | sed 's|^-*||;s|-*$||'
baker-est-tres-bien
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simply merge all rm and mkdir together.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in commit 563a6ab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants