mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-22 19:32:54 +03:00
Initial Grunt configuration
This commit is contained in:
parent
956cda158a
commit
99c13c02c0
47
Gruntfile.js
Normal file
47
Gruntfile.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
var configureGrunt = function(grunt) {
|
||||||
|
|
||||||
|
var cfg = {
|
||||||
|
// JSHint all the things!
|
||||||
|
jshint2: {
|
||||||
|
options: {
|
||||||
|
jshintrc: ".jshintrc"
|
||||||
|
},
|
||||||
|
all: [
|
||||||
|
// Lint files in the root, including Gruntfile.js
|
||||||
|
"*.js",
|
||||||
|
// Lint core files, but not libs
|
||||||
|
["core/**/*.js", "!**/assets/lib/**/*.js"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
// Unit test all the things!
|
||||||
|
nodeunit: {
|
||||||
|
all: ['core/test/ghost/**/test-*.js']
|
||||||
|
},
|
||||||
|
|
||||||
|
// Compile all the SASS!
|
||||||
|
compass: {
|
||||||
|
options: {
|
||||||
|
config: "config.rb"
|
||||||
|
},
|
||||||
|
// No need for config, but separated for future options
|
||||||
|
admin: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
grunt.initConfig(cfg);
|
||||||
|
|
||||||
|
grunt.loadNpmTasks("grunt-jshint2");
|
||||||
|
grunt.loadNpmTasks("grunt-contrib-nodeunit");
|
||||||
|
grunt.loadNpmTasks("grunt-contrib-compass");
|
||||||
|
|
||||||
|
// Prepare the project for development
|
||||||
|
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
|
||||||
|
grunt.registerTask("init", ["compass:admin"]);
|
||||||
|
|
||||||
|
// Run tests and lint code
|
||||||
|
grunt.registerTask("validate", ["jshint2:all", "nodeunit:all"]);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = configureGrunt;
|
@ -99,8 +99,8 @@
|
|||||||
}
|
}
|
||||||
} else if (e.keyCode === keys.ESC) {
|
} else if (e.keyCode === keys.ESC) {
|
||||||
suggestions.hide();
|
suggestions.hide();
|
||||||
} else if ((e.keyCode === keys.ENTER || e.keyCode === keys.COMMA)
|
} else if ((e.keyCode === keys.ENTER || e.keyCode === keys.COMMA)&& searchTerm) {
|
||||||
&& searchTerm) { // Submit tag using enter or comma key
|
// Submit tag using enter or comma key
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (suggestions.is(":visible") && suggestions.children(".selected").length !== 0) {
|
if (suggestions.is(":visible") && suggestions.children(".selected").length !== 0) {
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
polyglot: function () { return polyglot; },
|
polyglot: function () { return polyglot; },
|
||||||
paths: function () {
|
paths: function () {
|
||||||
return {
|
return {
|
||||||
'activeTheme': __dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/',
|
'activeTheme': path.resolve(__dirname + '/../content/' + config.themeDir + '/' + config.activeTheme + '/'),
|
||||||
'adminViews': __dirname + '/admin/views/',
|
'adminViews': __dirname + '/admin/views/',
|
||||||
'lang': __dirname + '/lang/'
|
'lang': __dirname + '/lang/'
|
||||||
};
|
};
|
||||||
@ -158,7 +158,7 @@
|
|||||||
));
|
));
|
||||||
app.set('views', self.paths().activeTheme);
|
app.set('views', self.paths().activeTheme);
|
||||||
} else {
|
} else {
|
||||||
app.engine('hbs', hbs.express3({partialsDir: self.paths().adminViews + '/partials'}));
|
app.engine('hbs', hbs.express3({partialsDir: self.paths().adminViews + 'partials'}));
|
||||||
app.set('views', self.paths().adminViews);
|
app.set('views', self.paths().adminViews);
|
||||||
app.use('/core/admin/assets', express['static'](path.join(__dirname, '/admin/assets')));
|
app.use('/core/admin/assets', express['static'](path.join(__dirname, '/admin/assets')));
|
||||||
}
|
}
|
||||||
|
10
package.json
10
package.json
@ -12,11 +12,17 @@
|
|||||||
"css": "*",
|
"css": "*",
|
||||||
"moment": "*",
|
"moment": "*",
|
||||||
"underscore": "*",
|
"underscore": "*",
|
||||||
"nodeunit": "*",
|
|
||||||
"showdown": "*",
|
"showdown": "*",
|
||||||
"node-polyglot": "*",
|
"node-polyglot": "*",
|
||||||
"sqlite3": "2.1.7",
|
"sqlite3": "2.1.7",
|
||||||
"jugglingdb": "0.2.x",
|
"jugglingdb": "0.2.x",
|
||||||
"jugglingdb-sqlite3": "git+https://github.com/jugglingdb/sqlite3-adapter.git#master"
|
"jugglingdb-sqlite3": "git+https://github.com/jugglingdb/sqlite3-adapter.git#master"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"nodeunit": "*",
|
||||||
|
"grunt": "~0.4.1",
|
||||||
|
"grunt-contrib-nodeunit": "~0.1.2",
|
||||||
|
"grunt-jshint2": "~0.1.1",
|
||||||
|
"grunt-contrib-compass": "~0.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user