Skip to content

Commit 9c99d64

Browse files
committed
feat(plugins): create tag maps for a more curated tag list
1 parent 98812ed commit 9c99d64

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

_scripts/build-plugin-tags.js

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,37 @@ var hiddenKeywords = [
1919
'jasmine',
2020
'integration-tests',
2121
'id',
22+
'true',
23+
'false',
24+
'arbitrary',
25+
'big',
26+
'number',
27+
'schema',
28+
'interface',
29+
'no-jquery',
30+
'API',
31+
'api',
2232
];
33+
var keywordMap = {
34+
'jquery': 'jQuery',
35+
'mongo': 'MongoDB',
36+
'mongodb': 'MongoDB',
37+
'xml': 'XML',
38+
'assertXml': 'XML',
39+
'react': 'React',
40+
'json': 'JSON',
41+
'json-schema': 'JSON Schema',
42+
'array': 'Array',
43+
'arrays': 'Array',
44+
'file': 'filesystem',
45+
'path': 'filesystem',
46+
'color': 'Colors',
47+
'colors': 'Colors',
48+
'math': 'Math',
49+
'backbone': 'Backbone',
50+
'promises': 'Promises',
51+
'promises-aplus': 'Promises',
52+
}
2353
var keywords = files.filter(function (file) {
2454
return file.slice(-5) === '.json';
2555
}).map(function (file) {
@@ -34,7 +64,14 @@ var keywords = files.filter(function (file) {
3464
return total.concat(current);
3565
}, []).filter(function(value, index, total) {
3666
return hiddenKeywords.indexOf(value) === -1 && total.indexOf(value) === index;
37-
});
67+
}).sort().reduce(function (total, keyword) {
68+
var addition = keyword.trim();
69+
if (keywordMap[keyword]) {
70+
keyword = keywordMap[keyword];
71+
}
72+
total[keyword] = (total[keyword] || []).concat(addition);
73+
return total;
74+
}, {});
3875

3976
console.log(keywords);
4077

plugins/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="line"></div>
99
{% for keyword in site.data.plugin_keywords %}
1010
<div class="tag">
11-
<div id="{{ keyword }}" class="which">{{ keyword }}</div><span class="reset">×</span>
11+
<div class="which" data-keywords="{{ keyword[1] | jsonify | escape }}">{{ keyword[0] }}</div><span class="reset">×</span>
1212
</div>
1313
{% endfor %}
1414

0 commit comments

Comments
 (0)