Last active
December 17, 2015 14:29
-
-
Save gaina-jp/5625292 to your computer and use it in GitHub Desktop.
2013/05/22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /d %~dp0 | |
node dirs.js | |
npm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f=require("fs"),a=["sass","jade","coffee","typescript","../dev","../production","test","stylus"],i=0,l=a.length;for(;i<l;i++){f.mkdir(a[i])} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###* global module:true *### | |
module.exports = (grunt)-> | |
grunt.initConfig | |
# READ PACKAGE JSON ------------------------------------------------------------------------- **/ | |
pkg : grunt.file.readJSON 'package.json' | |
meta : | |
banner: | |
js : '/*! <%= pkg.author %> | <%= pkg.license %> */' | |
css: '/*! <%= pkg.author %> | <%= pkg.license %> */' | |
# JADE ------------------------------------------------------------------------- **/ | |
jade : | |
index: | |
options: | |
pretty: true | |
data : | |
domain : "http://gaina-laboratory.com/" | |
title : "title" | |
meta: | |
description: "description" | |
keywords : "keywords" | |
og : | |
image : "image" | |
type : "article" | |
url : "url" | |
locale : "ja_jp" | |
title : "<%= jade.index.options.data.title %>" | |
description : "<%= jade.index.options.data.meta.description %>" | |
site_name : "site_name" | |
files : | |
'<%= pkg.html_dir %>index_debug.html': '<%= pkg.jade_dir %>index.jade' | |
# HTML MIN ------------------------------------------------------------------------- **/ | |
htmlmin : | |
index: | |
options: | |
removeComments : true | |
collapseWhitespace: true | |
files : | |
'<%= pkg.html_dir %>index.html': '<%= pkg.html_dir %>index_debug.html' | |
# COMPASS ------------------------------------------------------------------------- **/ | |
compass : | |
index: | |
options: | |
config : 'config.rb' | |
sassDir: '<%= pkg.sass_dir %>' | |
cssDir : '<%= pkg.html_dir %>css' | |
# CSS MIN ------------------------------------------------------------------------- **/ | |
cssmin : | |
index: | |
src : ['<%= meta.banner.css %>', '<%= pkg.html_dir %>css/style.css'] # <%= meta.banner.css %> is still ignored. | |
dest: '<%= pkg.html_dir %>css/style.min.css' | |
# COFFEESCRIPT ------------------------------------------------------------------------- **/ | |
coffee : | |
compile : | |
files: | |
'<%= pkg.html_dir %>common/FBUtil.js': '<%= pkg.coffee_dir %>common/FBUtil.coffee'#, # 1:1 compile | |
#'path/to/another.js' :['path/to/sources/*.coffee', 'path/to/more/*.coffee'], # compile and concat into single file | |
#'path/to/*.js' :['path/to/sources/*.coffee', 'path/to/more/*.coffee'] # compile individually into dest, maintaining folder structure, | |
index: | |
expand: true, | |
cwd : '<%= pkg.coffee_dir %>' | |
src : ['*.coffee'] | |
dest : '<%= pkg.html_dir %>js/' | |
ext : '.js' | |
# TYPESCRIPT ------------------------------------------------------------------------- **/ | |
typescript: | |
index: | |
src : ['<%= pkg.typescript_dir %>*.ts'] | |
dest : '<%= pkg.html_dir %>typescript' | |
options: | |
module : 'amd' # or commonjs | |
target : 'es5' # or es3 | |
base_path : '<%= pkg.typescript_dir %>ts/' | |
sourcemap : false | |
declaration: false | |
# JS MIN ------------------------------------------------------------------------- **/ | |
uglify : | |
index: | |
options: | |
banner: '<%= meta.banner.js %>' | |
src : ['<%= pkg.html_dir %>js/script.js'] | |
dest : '<%= pkg.html_dir %>js/script.min.js' | |
# CONCAT ------------------------------------------------------------------------- **/ | |
# TODO : CONCAT | |
concat : | |
index: | |
src : ["<%= pkg.html_dir %>js/script.js", "<%= pkg.html_dir %>common/js/common.js"] | |
dest: "<%= pkg.html_dir %>js/top.js" | |
# JSHINT ------------------------------------------------------------------------- **/ | |
# TODO : JSHINT | |
jshint : | |
index : ['<%= pkg.html_dir %>js/script.js'] | |
# QUINT ------------------------------------------------------------------------- **/ | |
# TODO : QUINT | |
qunit : | |
all: ["<%= pkg.html_dir %>canvas/*.html"] | |
# IMAGE MIM (NOT STABLE) ------------------------------------------------------------------------- **/ | |
imagemin : | |
index: | |
src : "images/test.png" | |
dest : "images/s/awawa.png" | |
options: | |
c: "-c6" #DEFAULT | |
s: "-s1" #DEFAULT | |
y: "-y" #DEFAULT | |
the : | |
src : "images/t_tw_btn.png" | |
dest: "images/s/t_tw_btn.png" | |
# IMAGE MIM (NOT STABLE) ------------------------------------------------------------------------- **/ | |
copy : | |
all: | |
files: [ | |
{expand: true, cwd: '<%= pkg.jade_dir %>/', src: ['**/*.gif', '**/*.jpg', '**/*.png'], dest: '<%= pkg.html_dir %>jade/', filter: 'isFile'} | |
] | |
# WATCH ------------------------------------------------------------------------- **/ | |
watch : | |
# Gruntfile.coffeeを更新したら自動的に再watchしてくれるの助かるって思う | |
# watchタスク以外にとっては不要だけと | |
setting : | |
files: ['Gruntfile.coffee'] | |
tasks: [] | |
# JADE ================================================== | |
jade_index : | |
files: ['<%= pkg.jade_dir %>index.jade'] | |
tasks: ['jade:index'] | |
# HTML ================================================== | |
htmlmin_index : | |
files: ["<%= pkg.html_dir %>index_debug.html"] | |
tasks: ['htmlmin:index'] | |
# CSS ================================================== | |
css_index : | |
files: ["<%= pkg.sass_dir %>style.scss"] | |
tasks: ['compass:index', 'cssmin:index'] | |
# JS ================================================== | |
js_index: | |
files: [ | |
"<%= pkg.coffee_dir %>script.coffee" | |
] | |
tasks: ['coffee:index','uglify:index'] | |
#tasks: ['coffee:index', 'jshint:index', 'uglify:index'] | |
ts_index : | |
files: [ | |
"<%= pkg.typescript_dir %>*.ts" | |
] | |
tasks: ['typescript:index'] | |
# image copy ================================================== | |
# TODO : copy | |
#copy : | |
# files: ['<%= pkg.jade_dir %>**/*.gif', '<%= pkg.jade_dir %>**/*.jpg', '<%= pkg.jade_dir %>**/*.png'] | |
# tasks: ['copy:all'] | |
# LOAD TASKS ------------------------------------------------------------------------- **/ | |
grunt.loadNpmTasks 'grunt-contrib-jade' | |
grunt.loadNpmTasks 'grunt-contrib-htmlmin' | |
grunt.loadNpmTasks 'grunt-contrib-coffee' | |
grunt.loadNpmTasks 'grunt-typescript' | |
grunt.loadNpmTasks 'grunt-contrib-uglify' | |
grunt.loadNpmTasks 'grunt-contrib-compass' | |
grunt.loadNpmTasks 'grunt-contrib-cssmin' | |
grunt.loadNpmTasks 'grunt-contrib-concat' | |
grunt.loadNpmTasks 'grunt-contrib-jshint' | |
#grunt.loadNpmTasks 'grunt-contrib-imagemin' | |
#grunt.loadNpmTasks 'grunt-contrib-copy' | |
grunt.loadNpmTasks 'grunt-contrib-watch' | |
# RESISTER TASK ------------------------------------------------------------------------- **/ | |
grunt.registerTask 'default', ['watch'] | |
grunt.registerTask 'production', ['htmlmin'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
html(lang="ja",xmlns="http://www.w3.org/1999/xhtml",xmlns:og="http://ogp.me/ns#",xmlns:mixi="http://mixi-platform.com/ns#",xmlns:fb="https://www.facebook.com/2008/fbml") | |
head | |
title #{title} | |
//- meta | |
meta(charset="utf-8") | |
meta(name="description",content="#{meta.description}") | |
meta(name="keywords",content="#{meta.keywords}") | |
//- OGP | |
meta(property="og:image",content="#{meta.og.image}") | |
meta(property="og:title",content="#{meta.og.title}") | |
meta(property="og:type",content="#{meta.og.type}") | |
meta(property="og:site_name",content="#{meta.og.site_name}") | |
meta(property="og:description",content="#{meta.og.description}") | |
meta(property="og:locale",content="#{meta.og.locale}") | |
meta(property="og:url",content="#{meta.og.url}") | |
meta(name="twitter:card",content="summary") | |
meta(name="twitter:site",content="@gaina") | |
//-meta(name="twitter:creator:id",content="@gaina") | |
meta(name="twitter:url",content="#{meta.og.url}") | |
meta(name="twitter:title",content="#{meta.og.title}") | |
meta(name="twitter:description",content="#{meta.og.description}") | |
meta(name="twitter:image",content="#{meta.og.image}") | |
meta(name="twitter:domain",content="#{domain}") | |
link(href="css/style.min.css",rel="stylesheet",type="text/css") | |
body | |
#fb-root | |
h1 鋭意製作中 | |
script(src="js/script.min.js") | |
script | |
(function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(e.getElementById(n))return;r=e.createElement(t);r.id=n;r.src="//connect.facebook.net/ja_JP/all.js#xfbml=1";i.parentNode.insertBefore(r,i)})(document,"script","facebook-jssdk");!function(e,t,n){var r,i=e.getElementsByTagName(t)[0];if(!e.getElementById(n)){r=e.createElement(t);r.id=n;r.src="//platform.twitter.com/widgets.js";i.parentNode.insertBefore(r,i)}}(document,"script","twitter-wjs"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "FirstBrand-Templates", | |
"author" : "@gaina / FirstBrand Inc.", | |
"version" : "0.0.1", | |
"update" : "2013/05/24", | |
"license" : "GAINA/license", | |
"sass_dir" : "sass/", | |
"coffee_dir" : "coffee/", | |
"typescript_dir" : "typescript/", | |
"jade_dir" : "jade/", | |
"html_dir" : "../dev/", | |
"production" : "../production/", | |
"scripts" : { | |
"start": "__dirs.bat", | |
"test" : "echo test" | |
}, | |
"devDependencies" : { | |
"grunt" : "~0.4.0", | |
"grunt-contrib-watch" : "~0.4.3", | |
"grunt-contrib-uglify" : "~0.2.1", | |
"grunt-contrib-concat" : "~0.3.0", | |
"grunt-contrib-cssmin" : "~0.6.0", | |
"grunt-contrib-compass": "~0.2.0", | |
"grunt-contrib-coffee" : "~0.7.0", | |
"grunt-contrib-jshint" : "~0.5.4", | |
"grunt-contrib-htmlmin": "~0.1.3", | |
"grunt-contrib-jade" : "~0.6.0", | |
"grunt-typescript" : "~0.1.5", | |
"grunt-contrib-copy" : "~0.4.1" | |
}, | |
"peerDependencies": { | |
"grunt": "~0.4.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment