Skip to content

Commit

Permalink
Merge pull request #6 from windyakin/trunk
Browse files Browse the repository at this point in the history
バージョン表記の変更とHonoka固有のコードの削除
  • Loading branch information
windyakin committed Jul 15, 2015
2 parents 08191aa + 1b08713 commit ddc7110
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 25 deletions.
71 changes: 54 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,59 @@
'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
}
]
},
// 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
Expand Down Expand Up @@ -69,7 +106,7 @@ module.exports = function(grunt) {
// compassの自動コンパイル
compass: {
files: ['src/compass/**/*.scss'],
tasks: ['compass:dist'],
tasks: ['compass:dist', 'replace:version'],
}
},
// テストサーバ
Expand All @@ -85,41 +122,41 @@ module.exports = function(grunt) {
compress: {
main: {
options: {
archive: 'data/bootstrap-honoka-'+ pkg.version +'-dist.zip'
archive: 'data/bootstrap-'+ name +'-'+ pkg.version +'-dist.zip'
},
files: [
{
//CSS
expand: true,
cwd: "dist/css/",
src: ["bootstrap**.css"],
dest: "honoka/css"
dest: name +"/css"
},
{
// Font
expand: true,
cwd: "dist/fonts/",
src: ["**/*"],
dest: "honoka/fonts"
dest: name +"/fonts"
},
{
// JavaScript
expand: true,
cwd: "dist/js/",
src: ["bootstrap.**js"],
dest: "honoka/js"
dest: name +"/js"
},
{
// Sample html
expand: true,
cwd: "dist/",
src: ["bootstrap.html"],
dest: "honoka"
dest: name
},
{
// README
src: ["README.md"],
dest: "honoka"
dest: name
}
]
},
Expand All @@ -137,7 +174,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']);
Expand Down
4 changes: 2 additions & 2 deletions dist/css/bootstrap.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@charset "UTF-8";
/*!
* Honoka v3.3.5
* Honoka v3.3.5a
* Website: http://honokak.osaka/
* Copyright 2015 windyakin
* The MIT License
* Based on Bootstrap
* Based on Bootstrap v3.3.5
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
Expand Down
4 changes: 2 additions & 2 deletions dist/css/bootstrap.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/compass/css/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

@import "honoka/variables";
/*!
* Honoka v#{$bootstrap-version}
* Website: http://honokak.osaka/
* Copyright 2015 windyakin
* Honoka v{%version%}
* Website: {%website%}
* Copyright {%year%} {%author%}
* The MIT License
* Based on Bootstrap
* Based on Bootstrap v#{$bootstrap-version}
*/
// Core variables and mixins
@import "bootstrap/mixins";
Expand Down

0 comments on commit ddc7110

Please sign in to comment.