-
Notifications
You must be signed in to change notification settings - Fork 58
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
Conversation
somehow there was some conflict, but I resolved this. Hope this meets your requirements. |
@Matzu89 thank you! But TravisCI show some lint errors. Can you fix it? |
lib/index.js
Outdated
this.sitemap = buildSitemap(hostname, this.paths); | ||
build(hostname) { | ||
this.hostname = hostname; | ||
this.splitted = splitPaths(this.paths, 49999); |
There was a problem hiding this comment.
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 })
lib/paths-splitter/index.js
Outdated
|
||
const pathsSplitter = (paths, size) => paths.map((e, i) => { | ||
return (i % size === 0) ? paths.slice(i, i + size) : null; | ||
}).filter(e => e); |
There was a problem hiding this comment.
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
@Matzu89 also please add unit tests for new module |
Your request is my demand. Executed, this should do the trick. |
@Matzu89 cool! |
* Generate Sitemap Index and Splitting into multiple sitemaps (#51) * Update documentation
Implements as described in #49