Skip to content

Support order.yml file for optionally controlling article display order #8

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

Closed
wants to merge 3 commits into from

Conversation

ajpiano
Copy link
Member

@ajpiano ajpiano commented Oct 12, 2012

As @scottgonzalez and I discussed earlier this evening, this adds support for using a YAML file with article slugs to control the menu_order field in WordPress, reading the order once up front if it's provided in wordpress.order in the gruntfile, and then dynamically adding the menuOrder property into the article's metadata after it's been otherwise processed. Articles not included in the order file will be suppressed from publication.

…ML file of slugs to optionally control article display order
@addyosmani
Copy link
Member

Awesome. Would it be possible to add some short docs to the wiki/readme just so people that wish to contrib. know about the behaviour thats been introduced/how to use it?. Could be derived from your summary above :)

@@ -45,12 +46,50 @@ grunt.registerHelper( "wordpress-parse-post-flex", function( path ) {
return grunt.helper( "wordpress-parse-post", path );
});

//Process a YAML order file and return an object of page slugs and their ordinal indices
grunt.registerHelper( "read-order", function( orderFile, taskDone ) {
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't use a callback.

@scottgonzalez
Copy link
Member

Landed in 4e19713.

@jzaefferer
Copy link
Member

Can you add some info about this to the readme?

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.

4 participants