Skip to content

Commit

Permalink
add build support
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-tang committed Jul 29, 2014
1 parent 527baa8 commit 4f8cba9
Show file tree
Hide file tree
Showing 5 changed files with 1,396 additions and 0 deletions.
36 changes: 36 additions & 0 deletions build.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
process.env.NODE_ENV = 'production'

data = require './data'
nobone = require 'nobone'

nb = nobone {
proxy: {}
renderer: {}
service: {}
}

log = nb.kit.log
render = nb.renderer.render
write = nb.kit.outputFile

# complie html
render('index.ejs')
.done (tpl_func) ->
html = tpl_func( { members: data.members } )
write 'index.html', html
.done () ->
log 'complie html done.'.green

# complie stylus
nb.kit.readdir 'css'
.done (files) ->
files.forEach (file) ->
if file.indexOf('.styl') > -1
file = 'css/' + file
render file
.done (rs) ->
write file.replace('.styl', '.css'), rs
.done () ->
log ('complie ' + file + ' done.').green


39 changes: 39 additions & 0 deletions css/font.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@font-face {
font-family: 's';
src: url("../fonts/Roboto-Light.ttf");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'n';
src: url("../fonts/Roboto-Light.ttf");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'n';
src: url("../fonts/Roboto-Regular.ttf");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'l';
src: url("../fonts/Roboto-Thin.ttf");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'l';
src: url("../fonts/Roboto-Light.ttf");
font-weight: bold;
font-style: normal;
}
.font-s {
font-family: s, '微软雅黑';
}
.font-n {
font-family: n, '微软雅黑';
}
.font-l {
font-family: l, '微软雅黑';
}
Loading

0 comments on commit 4f8cba9

Please sign in to comment.