-
Notifications
You must be signed in to change notification settings - Fork 20
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
Refactor #12
Refactor #12
Conversation
Also, if you've enable travis for this repo, let me know. I'd be happy to add a status badge to the readme! |
@ismay this looks great. It's a pretty big change though, so I'll take a closer look on Monday. |
Yeah definitely. Take your time, and let me know if there are any questions. |
- String.chompRight ensures that only the last occurence of the string will be replaced
Now resolved. |
@ismay this looks great! I have a couple requests. First is around the way you're determining URL. You're defaulting to I'm interested in why you would use make for running the test task instead of something like a test script inside of |
Thanks!
Just personal preference. I like the simplicity of working with make, but you can use npm as well.
I saw that, but it was a deliberate decision to hardcode these. It might be a good idea to scope them inside of a sitemap option, to prevent conflicts, but I don't see any added value in making the values configurable tbh. It'll only add unnecessary complexity. What is the added value in making them configurable? |
The added value is that it works for more people. As it stands my company would have to change other plugins to write these values at the specified locations. I'm fine with these as defaults, but we should make it configurable. If you'd rather not I'll go ahead and land this and then add that functionality. |
Feel free to modify it. I'd prefer to keep it as simple as possible, but it's your plugin. 👍 |
A complete refactor of the plugin, originated in #11. The plugin now uses sitemap.js, which means it no longer requires any maintenance of the actual sitemap generation logic.
I've also streamlined the API, so that for most people this:
will suffice. I've also added an
omitExtension
andomitIndex
option for those who rewrite their urls or use metalsmith-permalinks. Furthermore, all functionality is now covered by tests. One minor issue is that, for now, thehostname
must have a trailing slash, but I hope that'll be resolved soon: ekalinin/sitemap.js#39.See the readme for further explanation, and feel free to ask if there are any questions!