diff --git a/Gruntfile.js b/Gruntfile.js index 11c80cc1..32d11664 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,22 +1,63 @@ 'use strict'; module.exports = function(grunt) { - var pkg, taskName, ect_var; + var pkg, taskName, name; pkg = grunt.file.readJSON('package.json'); + name = pkg.name.toLowerCase(); grunt.initConfig({ // bannerの調整 replace: { + // バージョン表記 + version: { + src: ['dist/css/bootstrap.**css'], + dest: 'dist/css/', + replacements: [ + { + from: '{%version%}', + to: pkg.version + }, + { + from: '{%website%}', + to: pkg.website + }, + { + from: '{%year%}', + to: new Date().getFullYear() + }, + { + from: '{%author%}', + to: pkg.author + }, + { + from: '{%license%}', + to: pkg.license + } + ] + }, + // minifyファイルの改行の追加 banner: { src: ['dist/css/bootstrap.min.css'], dest: 'dist/css/bootstrap.min.css', - replacements: [{ - from: '@charset "UTF-8";/*!', - to: '@charset "UTF-8";\n/*!', - }, - { - from: 'Based on Bootstrap\n */', - to: 'Based on Bootstrap\n */\n' - }] + replacements: [ + { + from: '@charset "UTF-8";/*!', + to: '@charset "UTF-8";\n/*!' + }, + { + from: /Based on Bootstrap v([\d\.]+)\n \*\//g, + to: 'Based on Bootstrap v$1\n */\n' + } + ] + }, + basedon: { + src: ['dist/css/bootstrap.**css'], + dest: 'dist/css/', + replacements: [ + { + from: '{%version%}', + to: pkg.version + } + ] } }, // cssmin @@ -69,7 +110,7 @@ module.exports = function(grunt) { // compassの自動コンパイル compass: { files: ['src/compass/**/*.scss'], - tasks: ['compass:dist'], + tasks: ['compass:dist', 'replace:version'], } }, // テストサーバ @@ -85,7 +126,7 @@ module.exports = function(grunt) { compress: { main: { options: { - archive: 'data/bootstrap-nico-'+ pkg.version +'-dist.zip' + archive: 'data/bootstrap-'+ name +'-'+ pkg.version +'-dist.zip' }, files: [ { @@ -93,33 +134,33 @@ module.exports = function(grunt) { expand: true, cwd: "dist/css/", src: ["bootstrap**.css"], - dest: "nico/css" + dest: name +"/css" }, { // Font expand: true, cwd: "dist/fonts/", src: ["**/*"], - dest: "nico/fonts" + dest: name +"/fonts" }, { // JavaScript expand: true, cwd: "dist/js/", src: ["bootstrap.**js"], - dest: "nico/js" + dest: name +"/js" }, { // Sample html expand: true, cwd: "dist/", src: ["bootstrap.html"], - dest: "nico" + dest: name }, { // README src: ["README.md"], - dest: "nico" + dest: name } ] }, @@ -137,7 +178,7 @@ module.exports = function(grunt) { grunt.registerTask('server', ['compass:dist', 'connect', 'watch']); // ミニファイ - grunt.registerTask('build', ['clean:build', 'copy:build', 'compass:dist', 'cssmin:minify', 'replace:banner']); + grunt.registerTask('build', ['clean:build', 'copy:build', 'compass:dist', 'cssmin:minify', 'replace:banner', 'replace:version']); // 配布用パッケージ作成 grunt.registerTask('package', ['build', 'compress:main']); diff --git a/dist/assets/img/sample.png b/dist/assets/img/sample.png index 34822aa5..b8eea829 100644 Binary files a/dist/assets/img/sample.png and b/dist/assets/img/sample.png differ diff --git a/dist/bootstrap-ja.html b/dist/bootstrap-ja.html index d0369eb2..7b0d463e 100644 --- a/dist/bootstrap-ja.html +++ b/dist/bootstrap-ja.html @@ -1053,8 +1053,8 @@
μ'sの発起人。いつも笑顔で、行動力に満ちている。
+アイドルを目指して日夜励んでいる。「にっこにっこにー」が合い言葉。