Skip to content

yanyaoer/component-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

component-static

example for single-page webapp

├── component.json      #define package
├── example.html
├── readme.md
└── source
    ├── index.css       #main css
    ├── index.js        #main js
    ├── handler.js      #handler with history.pushState
    ├── tpl.js
    └── tpl
        ├── builder.js  #build ./*.jade > ../tpl.js
        ├── 404.jade
        ├── base.jade
        └── login.jade

install

npm install component -g

#1.build from source
npm install jade
git clone https://github.com/yanyaoer/component-static {{ static_path }}
cd {{ static_path }}

#2.get static_file only
component install yanyaoer/component-static@master

component install
component build

example

cd {{ static_path }}
python -m SimpleHTTPServer 9001
open -a http://0.0.0.0:9001/example.html

automate

# add to .vimrc
let $static_path = {{ static_path }}
function! Static_build()
    if expand('%:e') == 'jade' 
        execute '!cd '.$static_path.'source/tpl/; node builder.js'
    endif
    execute '!cd '.$static_path.'; component build'
endfunction
au bufwritepost * if expand('%:p') =~ expand($static_path) | silent call Static_build() | endif

or write script with visionmedia-watch

reference

component

backbone github

backbone.marionette github doc pattern

zepto

jade

About

example for single-page webapp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published