Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
wordpress: (function() {
var config = require( "./config" );
config.dir = "dist/wordpress";
return config;
})()
});
grunt.registerTask( "build-categories", function() {
grunt.file.write(
grunt.config( "wordpress.dir" ) + "/taxonomies.json",
JSON.stringify( taxonomies )
);
});
jqueryContent.postPreprocessors.post = (function() {
var teamNames = {};
taxonomies.category.forEach(function( category ) {
teamNames[ category.slug ] = category.name;
});
return function( post, postPath, callback ) {
var categorySlug = postPath.replace( /^.+?.+\/(.+)\/(.+)\.\w+$/, "$1" ),
postDateSlug = postPath.replace( /^.+?.+\/(.+)\/(.+)\.\w+$/, "$2" ),
postDate = new Date( postDateSlug + " 12:00:00"),
// Slice off the "DAY " from the date string
postDateString = postDate.toDateString().slice( 4 ),
teamName = teamNames[ categorySlug ];
post.title = teamName + " Meeting - " + postDateString;
if ( typeof item === "object" ) {
var page = Object.keys( item )[ 0 ];
map[ prefix + page ] = ++index;
walk( item[ page ], prefix + page + "/" );
} else {
map[ prefix + item ] = ++index;
}
});
}
walk( require( "./order" ), "" );
return map;
}
jqueryContent.postPreprocessors.page = (function() {
var orderMap = getOrderMap();
return function( post, postPath, callback ) {
var slug = postPath.replace( /^.+?\/(.+)\.\w+$/, "$1" ),
menuOrder = orderMap[ slug ];
if ( menuOrder ) {
post.menuOrder = menuOrder;
}
callback( null, post );
};
})();
grunt.registerTask( "build", [ "build-posts", "build-resources" ] );