Skip to content

Commit

Permalink
Merge pull request #1 from phacks/fix-unsuitable-titles-as-paths
Browse files Browse the repository at this point in the history
Fix unsuitable WP titles as paths by @phacks  🎉
  • Loading branch information
Costa Alexoglou committed Jan 8, 2019
2 parents aaea334 + cc3ebe2 commit dc4cfdf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -24,6 +24,7 @@
"author": "Costa Alexoglou <konsalexee@gmail.com>",
"license": "MIT",
"dependencies": {
"@sindresorhus/slugify": "^0.7.0",
"chalk": "2.4.1",
"cheerio": "1.0.0-rc.2",
"fs-extra": "7.0.1",
Expand Down
3 changes: 2 additions & 1 deletion writing.js
@@ -1,5 +1,6 @@
const fs = require("fs-extra");
const fetch = require("node-fetch");
const slugify = require('@sindresorhus/slugify');
var path = require("path");

// Custom Styling for Command Line printing
Expand All @@ -17,7 +18,7 @@ const error = chalk.bold.red;

const writing = (post, title, images, destination) => {
// Converting the title to the proper folder name
const dirTitle = title.toLowerCase().replace(/\ /g, "-");
const dirTitle = slugify(title);

destination = path.isAbsolute(destination)
? destination
Expand Down

0 comments on commit dc4cfdf

Please sign in to comment.