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

Add pretty option #8

Merged
merged 4 commits into from Dec 5, 2016
Merged

Conversation

benadamstyles
Copy link
Contributor

Hey, another PR! My site uses pretty URLs, so www.example.com/author/index.html becomes www.example.com/author. This PR adds a --pretty option to remove index.html from the output. It also means that www.example.com/about.html becomes www.example.com/about, because a lot of static site frameworks (e.g. Netlify) feature this kind of URL rewrite.

@tmcw
Copy link
Owner

tmcw commented Dec 5, 2016

Thanks for the PR! Since pretty is a new feature and the name could be interpreted in different ways (is it making pretty indentation of the XML? or including some sitemap feature?), could you add a section to the readme in the style of the ignore file documentation to make it clear what it does?

@benadamstyles
Copy link
Contributor Author

Yes of course, will do it asap

@benadamstyles
Copy link
Contributor Author

Ok, done!

@@ -17,4 +17,5 @@ generateSitemap(process.stdout, {
findRoot: argv._[0] || '.',
ignoreFile: argv['ignore-file'],
prefix: prefix,
pretty: argv.pretty,
Copy link
Owner

Choose a reason for hiding this comment

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

Could this use the minimist opts to avoid needing --pretty=true and allowing just --pretty? Would look like:

var argv = require('minimist')(process.argv.slice(2), { 'boolean': 'pretty' })

@benadamstyles
Copy link
Contributor Author

Yeah nice, added that

@tmcw
Copy link
Owner

tmcw commented Dec 5, 2016

👍 Thanks!

@tmcw tmcw merged commit 44f4310 into tmcw:master Dec 5, 2016
@benadamstyles benadamstyles deleted the patch-add-pretty-option branch December 5, 2016 19:32
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.

None yet

2 participants