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

Sitemap Index and Splitting into multiple sitemaps #51

Merged
merged 5 commits into from
Jun 1, 2017

Conversation

Matzu89
Copy link
Contributor

@Matzu89 Matzu89 commented May 31, 2017

Implements as described in #49

@Matzu89
Copy link
Contributor Author

Matzu89 commented May 31, 2017

somehow there was some conflict, but I resolved this. Hope this meets your requirements.

@kuflash
Copy link
Owner

kuflash commented May 31, 2017

@Matzu89 thank you! But TravisCI show some lint errors. Can you fix it?
You can run command npm run lint for check your files.

lib/index.js Outdated
this.sitemap = buildSitemap(hostname, this.paths);
build(hostname) {
this.hostname = hostname;
this.splitted = splitPaths(this.paths, 49999);
Copy link
Owner

Choose a reason for hiding this comment

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

The number of paths must be made an optional parameter. By default it equal 49999.
Create second argument options as object and add property limitCountPaths.
For example:

build('https://example.com', { limitCountPaths: 1000 })


const pathsSplitter = (paths, size) => paths.map((e, i) => {
return (i % size === 0) ? paths.slice(i, i + size) : null;
}).filter(e => e);
Copy link
Owner

@kuflash kuflash May 31, 2017

Choose a reason for hiding this comment

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

Please rename e to path for more readability

@kuflash
Copy link
Owner

kuflash commented May 31, 2017

@Matzu89 also please add unit tests for new module paths-splitter.

@Matzu89
Copy link
Contributor Author

Matzu89 commented Jun 1, 2017

Your request is my demand. Executed, this should do the trick.

@kuflash
Copy link
Owner

kuflash commented Jun 1, 2017

@Matzu89 cool!

@kuflash kuflash merged commit 8264f79 into kuflash:develop Jun 1, 2017
kuflash added a commit that referenced this pull request Jun 1, 2017
* Generate Sitemap Index and Splitting into multiple sitemaps (#51)
* Update documentation
@Matzu89 Matzu89 deleted the develop branch June 2, 2017 04:13
@Matzu89 Matzu89 restored the develop branch June 2, 2017 04:13
@Matzu89 Matzu89 deleted the develop branch June 2, 2017 04:17
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