Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DraftDir + manage accent for slug() #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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
@@ -279,11 +282,15 @@ usage() {

case "$1" in
bake)
rm -rf "$DRAFT_DIR"
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