Skip to content

Commit 08690e1

Browse files
committed
Build: Remove YAML; convert order to JSON
1 parent 53d313a commit 08690e1

File tree

4 files changed

+165
-117
lines changed

4 files changed

+165
-117
lines changed

grunt.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
var yaml = require( "js-yaml" ),
2-
config = require("./config.json");
1+
var config = require( "./config" );
32

43
module.exports = function( grunt ) {
54

@@ -41,20 +40,20 @@ grunt.initConfig({
4140
},
4241
wordpress: grunt.utils._.extend({
4342
dir: "dist/wordpress",
44-
order: "order.yml"
43+
order: "order.json"
4544
}, grunt.file.readJSON( "config.json" ) )
4645
});
4746

4847

4948

50-
// Process a YAML order file and return an object of page slugs and their ordinal indices
49+
// Process a JSON order file and return an object of page slugs and their ordinal indices
5150
grunt.registerHelper( "read-order", function( orderFile ) {
5251
var order,
5352
map = {},
5453
index = 0;
5554

5655
try {
57-
order = yaml.safeLoad( grunt.file.read( orderFile ) );
56+
order = JSON.parse( grunt.file.read( orderFile ) );
5857
} catch( error ) {
5958
grunt.warn( "Invalid order file: " + orderFile );
6059
return null;
@@ -175,7 +174,7 @@ grunt.registerHelper( "contributor-attribution", function( post, fileName, fn )
175174
});
176175

177176
grunt.registerHelper( "build-pages-preprocess", (function() {
178-
var orderMap = grunt.helper( "read-order", "order.yml" );
177+
var orderMap = grunt.helper( "read-order", "order.json" );
179178

180179
return function( post, fileName, done ) {
181180
grunt.utils.async.series([

order.json

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
[
2+
"index",
3+
"about",
4+
"contributing",
5+
{
6+
"about-jquery": [
7+
"how-jquery-works",
8+
"additional-support"
9+
]
10+
},
11+
{
12+
"javascript-101": [
13+
"getting-started",
14+
"running-code",
15+
"syntax-basics",
16+
"types",
17+
"operators",
18+
"conditional-code",
19+
"loops",
20+
"reserved-words",
21+
"arrays",
22+
"objects",
23+
"functions",
24+
"testing-type",
25+
"this-keyword",
26+
"scope",
27+
"closures"
28+
]
29+
},
30+
{
31+
"using-jquery-core": [
32+
"dollar-object-vs-function",
33+
"document-ready",
34+
"avoid-conflicts-other-libraries",
35+
"attributes",
36+
"selecting-elements",
37+
"working-with-selections",
38+
"manipulating-elements",
39+
"jquery-object",
40+
"traversing",
41+
"css-styling-dimensions",
42+
"data-methods",
43+
"utility-methods",
44+
"iterating",
45+
"understanding-index",
46+
{
47+
"faq": [
48+
"how-do-i-select-an-item-using-class-or-id",
49+
"how-do-i-select-elements-when-i-already-have-a-dom-element",
50+
"how-do-i-test-whether-an-element-has-a-particular-class",
51+
"how-do-i-test-whether-an-element-exists",
52+
"how-do-i-determine-the-state-of-a-toggled-element",
53+
"how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation",
54+
"how-do-i-disable-enable-a-form-element",
55+
"how-do-i-check-uncheck-a-checkbox-input-or-radio-button",
56+
"how-do-i-get-the-text-value-of-a-selected-option",
57+
"how-do-i-replace-text-from-the-3rd-element-of-a-list-of-10-items",
58+
"how-do-i-pull-a-native-dom-element-from-a-jquery-object"
59+
]
60+
}
61+
]
62+
},
63+
{
64+
"events": [
65+
"event-basics",
66+
"event-helpers",
67+
"introduction-to-events",
68+
"handling-events",
69+
"inside-event-handling-function",
70+
"event-delegation",
71+
"triggering-event-handlers",
72+
"history-of-events",
73+
"introduction-to-custom-events",
74+
"event-extensions"
75+
]
76+
},
77+
{
78+
"effects": [
79+
"intro-to-effects",
80+
"custom-effects",
81+
"queue-and-dequeue-explained",
82+
"uses-of-queue-and-dequeue"
83+
]
84+
},
85+
{
86+
"ajax": [
87+
"key-concepts",
88+
"jquery-ajax-methods",
89+
"ajax-and-forms",
90+
"working-with-jsonp",
91+
"ajax-events"
92+
]
93+
},
94+
{
95+
"plugins": [
96+
"finding-evaluating-plugins",
97+
"basic-plugin-creation",
98+
"advanced-plugin-concepts",
99+
"stateful-plugins-with-widget-factory"
100+
]
101+
},
102+
{
103+
"performance": [
104+
"append-outside-loop",
105+
"cache-loop-length",
106+
"detach-elements-before-work-with-them",
107+
"dont-act-on-absent-elements",
108+
"optimize-selectors",
109+
"use-stylesheets-for-changing-css",
110+
"read-the-source"
111+
]
112+
},
113+
{
114+
"code-organization": [
115+
"concepts",
116+
"beware-anonymous-functions",
117+
"dont-repeat-yourself",
118+
"feature-browser-detection",
119+
{
120+
"deferreds": [
121+
"about-deferreds",
122+
"jquery-deferreds",
123+
"examples"
124+
]
125+
}
126+
]
127+
},
128+
{
129+
"jquery-ui": [
130+
"getting-started",
131+
"how-jquery-ui-works",
132+
{
133+
"theming": [
134+
"themeroller",
135+
"api",
136+
"write-a-theme"
137+
]
138+
},
139+
{
140+
"widget-factory": [
141+
"why-use-the-widget-factory",
142+
"how-to-use-the-widget-factory"
143+
]
144+
},
145+
{
146+
"environments": [
147+
"amd",
148+
"bower"
149+
]
150+
}
151+
]
152+
},
153+
{
154+
"jquery-mobile": [
155+
"getting-started",
156+
"theme-roller"
157+
]
158+
}
159+
]

order.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"grunt-html": "0.1.1",
2727
"grunt-wordpress": "1.2.1",
2828
"grunt-jquery-content": "0.13.0",
29-
"grunt-check-modules": "0.1.0",
30-
"js-yaml": "3.1.0"
29+
"grunt-check-modules": "0.1.0"
3130
}
3231
}

0 commit comments

Comments
 (0)