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

Refactor #12

Merged
merged 10 commits into from Sep 10, 2015
Merged

Refactor #12

merged 10 commits into from Sep 10, 2015

Conversation

ismay
Copy link
Contributor

@ismay ismay commented Sep 5, 2015

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:

.use(sitemap('http://www.mywebsite.com/'))

will suffice. I've also added an omitExtension and omitIndex 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, the hostname 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!

@ismay
Copy link
Contributor Author

ismay commented Sep 5, 2015

Also, if you've enable travis for this repo, let me know. I'd be happy to add a status badge to the readme!

@boushley
Copy link
Contributor

boushley commented Sep 5, 2015

@ismay this looks great. It's a pretty big change though, so I'll take a closer look on Monday.

@ismay
Copy link
Contributor Author

ismay commented Sep 5, 2015

It's a pretty big change though

Yeah definitely. Take your time, and let me know if there are any questions.

ismay added 4 commits September 5, 2015 19:52
- String.chompRight ensures that only the last occurence of the string will be replaced
@ismay
Copy link
Contributor Author

ismay commented Sep 7, 2015

One minor issue is that, for now, the hostname must have a trailing slash, but I hope that'll be resolved soon: ekalinin/sitemap.js#39.

Now resolved.

@boushley
Copy link
Contributor

boushley commented Sep 8, 2015

@ismay this looks great!

I have a couple requests. First is around the way you're determining URL. You're defaulting to metadata.canonical. I think that's a reasonable default, but we should allow people to set what property they want to pull that value out of. In our main site for instance it is metadata.seo.canonical. You can use the lodash get method for this once you take an option. Similar request for last modified date. Previously these two options were urlProperty and modifiedProperty

I'm interested in why you would use make for running the test task instead of something like a test script inside of package.json.

@ismay
Copy link
Contributor Author

ismay commented Sep 8, 2015

Thanks!

I'm interested in why you would use make for running the test task instead of something like a test script inside of package.json.

Just personal preference. I like the simplicity of working with make, but you can use npm as well.

We should allow people to set what property they want to pull that value out of. [...] Similar request for last modified date.

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?

@boushley
Copy link
Contributor

boushley commented Sep 8, 2015

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.

@ismay
Copy link
Contributor Author

ismay commented Sep 8, 2015

Feel free to modify it. I'd prefer to keep it as simple as possible, but it's your plugin. 👍

boushley added a commit that referenced this pull request Sep 10, 2015
@boushley boushley merged commit be720a6 into ExtraHop:master Sep 10, 2015
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