-
Notifications
You must be signed in to change notification settings - Fork 75
Generate categories.json manifest file #152
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
Conversation
This needs to be cherry-picked into |
@scottgonzalez, I didnt use I think this implementation is pretty straightforward. But, if you still think we should use grunt-wordpress tasks to make it smaller. Please, just let me know. |
You should definitely use |
Right. Updated. |
I'm not sure that this |
Is that what you mean? |
var categories, | ||
categoryPosts = {}; | ||
|
||
categories = require( "../" + grunt.config( "wordpress.dir" ) + "/taxonomies" ).category.map(function( category ) { |
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.
Why does this use "../"
but the call to wordpress-walk-posts
doesn't?
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.
This would be clearer if you did the assignment, then on a separate line used a forEach()
. You're not actually mapping here.
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.
Nope, I am mapping. Although, I can split the require from the map if you wish.
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.
Note I am augmenting category object with posts Array.
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.
Why does this use "../" but the call to wordpress-walk-posts doesn't?
This is require
, used to load the JSON. The other one is grunt.helper
.
Please move this into |
return category; | ||
}); | ||
|
||
// Get all posts' manifest in advance |
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.
This comment is confusing. Perhaps it's no longer relevant from the changes.
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.
Ops pardom
One spacing issue, but other than that, this looks good. |
Landed by 21703a3 |
Create
manifest
grunt task. It generates thecategories.json
manifest file. This JSON file has a list of all categories and its infos, which is used by DownloadBuilder to expand a category into its corresponding pages and posts.OBS: remember, this needs to be cherry-picked into
1-x
branches.