mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Write theme version at the top of theme.js
This commit is contained in:
parent
af3ff632f1
commit
e90db838ce
20
Gruntfile.js
20
Gruntfile.js
@ -4,6 +4,9 @@ module.exports = function(grunt) {
|
|||||||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
|
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
// Read package.json
|
||||||
|
pkg: grunt.file.readJSON("package.json"),
|
||||||
|
|
||||||
open : {
|
open : {
|
||||||
dev: {
|
dev: {
|
||||||
path: 'http://localhost:1919'
|
path: 'http://localhost:1919'
|
||||||
@ -131,6 +134,19 @@ module.exports = function(grunt) {
|
|||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
usebanner: {
|
||||||
|
dist: {
|
||||||
|
options: {
|
||||||
|
position: 'top',
|
||||||
|
banner: '// <%= pkg.name %> version <%= pkg.version %> | MIT license\n' +
|
||||||
|
'// Built <%= grunt.template.today("yyyymmdd HH:mm") %>',
|
||||||
|
linebreak: true
|
||||||
|
},
|
||||||
|
files: {
|
||||||
|
src: [ 'sphinx_rtd_theme/static/js/theme.js' ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
exec: {
|
exec: {
|
||||||
bower_update: {
|
bower_update: {
|
||||||
cmd: 'bower update'
|
cmd: 'bower update'
|
||||||
@ -180,6 +196,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-open');
|
grunt.loadNpmTasks('grunt-open');
|
||||||
grunt.loadNpmTasks('grunt-browserify');
|
grunt.loadNpmTasks('grunt-browserify');
|
||||||
|
|
||||||
grunt.registerTask('default', ['exec:bower_update','clean','copy:fonts','sass:dev','browserify:dev','exec:build_sphinx','connect','open','watch']);
|
grunt.registerTask('default', ['exec:bower_update','clean','copy:fonts','sass:dev','browserify:dev','usebanner','exec:build_sphinx','connect','open','watch']);
|
||||||
grunt.registerTask('build', ['exec:bower_update','clean','copy:fonts','sass:build','browserify:build','uglify','exec:build_sphinx']);
|
grunt.registerTask('build', ['exec:bower_update','clean','copy:fonts','sass:build','browserify:build','uglify','usebanner','exec:build_sphinx']);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"browserify": "^13.0.0",
|
"browserify": "^13.0.0",
|
||||||
"connect-livereload": "~0.6.0",
|
"connect-livereload": "~0.6.0",
|
||||||
"grunt": "~1.0.1",
|
"grunt": "~1.0.1",
|
||||||
|
"grunt-banner": "^0.6.0",
|
||||||
"grunt-browserify": "^5.0.0",
|
"grunt-browserify": "^5.0.0",
|
||||||
"grunt-contrib-clean": "^1.0.0",
|
"grunt-contrib-clean": "^1.0.0",
|
||||||
"grunt-contrib-connect": "^1.0.2",
|
"grunt-contrib-connect": "^1.0.2",
|
||||||
|
Loading…
Reference in New Issue
Block a user