Skip to content

Commit 531c1b7

Browse files
committed
Merge branch 'master' of github.com:processing/p5.js-website
2 parents ce2b800 + b063502 commit 531c1b7

File tree

13 files changed

+8261
-5485
lines changed

13 files changed

+8261
-5485
lines changed

.lintstagedrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
'src/data/en.yml': () => ['grunt i18n --changed', 'git add i18n-tracking.yml']
3+
}

Gruntfile.js

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ module.exports = function(grunt) {
2929
},
3030
watch: {
3131
assemble: {
32-
files: '<%= config.src %>/{content,data,templates}/{,*/}*.{md,hbs,yml,json}',
32+
files: '<%= config.src %>/{content,data,templates}/**/*.{md,hbs,yml,json}',
3333
tasks: ['assemble']
3434
},
3535
css: {
3636
files: '<%= config.src %>/assets/css/*.css',
3737
tasks: [
3838
'concat:dist',
39-
// 'uncss',
4039
'postcss'
4140
]
4241
},
@@ -87,7 +86,10 @@ module.exports = function(grunt) {
8786
helpers: ['<%= config.src %>/assets/js/translation.js'],
8887
assets: '<%= config.dist %>/assets',
8988
layout: '<%= config.src %>/templates/layouts/default.hbs',
90-
data: ['<%= config.src %>/data/**/*.{json,yml}', '!<%= config.src %>/data/reference/*.json'],
89+
data: [
90+
'<%= config.src %>/data/**/*.{json,yml}',
91+
'!<%= config.src %>/data/reference/*.json'
92+
],
9193
partials: '<%= config.src %>/templates/partials/*.hbs',
9294
plugins: [
9395
'assemble-contrib-permalinks',
@@ -121,7 +123,7 @@ module.exports = function(grunt) {
121123
}
122124
},
123125
dest: '<%= config.dist %>',
124-
src: "!*.*"
126+
src: '!*.*'
125127
}
126128
},
127129

@@ -161,7 +163,7 @@ module.exports = function(grunt) {
161163
// CSS:
162164
concat: {
163165
options: {
164-
separator: ';',
166+
separator: ';'
165167
},
166168
dist: {
167169
src: [
@@ -174,21 +176,20 @@ module.exports = function(grunt) {
174176
},
175177
postcss: {
176178
options: {
177-
map: true,
178179
map: {
179180
inline: false,
180181
annotation: '<%= config.dist %>/assets/css/maps/'
181182
},
182183
processors: [
183184
require('autoprefixer')({browsers: [
184-
"Android 2.3",
185-
"Android >= 4",
186-
"Chrome >= 20",
187-
"Firefox >= 24",
188-
"Explorer >= 8",
189-
"iOS >= 6",
190-
"Opera >= 12",
191-
"Safari >= 6"
185+
'Android 2.3',
186+
'Android >= 4',
187+
'Chrome >= 20',
188+
'Firefox >= 24',
189+
'Explorer >= 8',
190+
'iOS >= 6',
191+
'Opera >= 12',
192+
'Safari >= 6'
192193
]}),
193194
require('cssnano')()
194195
]
@@ -227,7 +228,7 @@ module.exports = function(grunt) {
227228
examples: {
228229
expand: true,
229230
cwd: '<%= config.src %>/data/examples',
230-
src: ['**', '!build_examples/**' ],
231+
src: ['**', '!build_examples/**'],
231232
dest: '<%= config.dist %>/assets/examples'
232233
},
233234
contributor_docs: {
@@ -307,7 +308,7 @@ module.exports = function(grunt) {
307308
default_options: {
308309
files: [
309310
{
310-
prepend: "referenceData = ",
311+
prepend: 'referenceData = ',
311312
input: '<%= config.src %>/templates/pages/reference/data.json',
312313
output: '<%= config.src %>/offline-reference/js/data.js'
313314
}
@@ -325,28 +326,32 @@ module.exports = function(grunt) {
325326
src: ['**/*'],
326327
dest: 'p5-reference/'
327328
}
328-
},
329+
},
329330
htmllint: {
330331
all: {
331-
src: ['<%= config.dist %>/**/*.html',
332-
'!<%= config.dist %>/es/**/*.html',
333-
'!<%= config.dist %>/zh-Hans/**/*.html',
334-
'!<%= config.dist %>/**/CHANGES.html',
335-
'!<%= config.dist %>/**/README.html',
336-
'!<%= config.dist %>/**/p5_featured/**/*.html',
337-
'!<%= config.dist %>/**/learn/*.html',
338-
'!<%= config.dist %>/**/examples/*.html',
339-
'!<%= config.dist %>/reference/assets/index.html'],
332+
src: [
333+
'<%= config.dist %>/**/*.html',
334+
'!<%= config.dist %>/es/**/*.html',
335+
'!<%= config.dist %>/zh-Hans/**/*.html',
336+
'!<%= config.dist %>/**/CHANGES.html',
337+
'!<%= config.dist %>/**/README.html',
338+
'!<%= config.dist %>/**/p5_featured/**/*.html',
339+
'!<%= config.dist %>/**/learn/*.html',
340+
'!<%= config.dist %>/**/examples/*.html',
341+
'!<%= config.dist %>/reference/assets/index.html'
342+
],
340343
options: {
341-
ignore: [/^This document appears to be written in English/,
342-
/^Bad value https:/,
343-
/^Consider adding a lang attribute to the html/]
344+
ignore: [
345+
/^This document appears to be written in English/,
346+
/^Bad value https:/,
347+
/^Consider adding a lang attribute to the html/
348+
]
344349
}
345350
}
346351
}
347352
});
348353

349-
grunt.registerTask('update-version', function(){
354+
grunt.registerTask('update-version', function() {
350355
const done = this.async();
351356

352357
const version = require('./src/templates/pages/reference/data.json').project.version;
@@ -386,14 +391,13 @@ module.exports = function(grunt) {
386391
grunt.registerTask('optimize', [
387392
'newer:imagemin',
388393
'concat:dist',
389-
// 'uncss',
390394
'postcss'
391395
]);
392396

393397
// i18n tracking task
394-
grunt.registerTask('i18n', function(){
398+
grunt.registerTask('i18n', function() {
395399
var done = this.async();
396-
require("./i18n.js")(done);
400+
require('./i18n.js')(done);
397401
});
398402

399403
// runs tasks in order
@@ -412,8 +416,5 @@ module.exports = function(grunt) {
412416
]);
413417

414418
// runs with just grunt command
415-
grunt.registerTask('default', [
416-
'build'
417-
]);
418-
419+
grunt.registerTask('default', ['build']);
419420
};

0 commit comments

Comments
 (0)