- Notifications
You must be signed in to change notification settings - Fork1
Scaffold for a static website using gulp
License
MaximeD/gulp_scaffold
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Take a look at thedemoand thecode running it.
Files for development are stored insrc/
with the following structure:
+ src/| \-- assets| \-- images| \-- javascripts| \-- static| \-- stylesheets| \-- variables.scss| \-- templates| \-- layout.html| \-- views
Result will be stored inside/dist
.
Your image will be processed bygulp-imagemin.It is responsible to compress them.
They will be placed in/dist/images
.
Place herecoffee
files.They will be turned into javascript, obfuscated, minified,and merged into a single fileall.js
.
It will be placed in/dist/js/all.js
.
If you have any static files that should not be processed bygulp
,you can place them here.It can be virtually anything: vendored assets,pdfs
, …
It will be copied to/dist
with same path without any transformation.So/src/assets/static/foo/bar/baz.txt
will be available in/dist/foo/bar/baz.txt
.
Place herescss
files,They will be turned intocss
, includingbootstrap
andfontawesome
.Since it includesbootstrap
, it means you can override itsdefault variables.
The result will be one single file available in/dist/css/all.css
.
You can write here templates you want to inherit from / include in other files.Typically, you will have a layout, a footer, etc.
This files are written usingpug,so have a look at itsdocumentation to see what is available.
Templates are not written anywhere for they are to be used by views.
Your views to produce resultinghtml
.They can inherit or include templates and are also written usingpug.
They will be built at the root of/dist
, honoring their path,so/src/views/blog/article.pug
will be inside/dist/blog/article.html
.
Just readgulpfile.coffee
andtasks/
, it should be explanatory.
The only file you need to customize is/tasks/routes.coffee
.Basically you will want to write here mapping for view files.This is a matter of taste,but I just find it way more convenient to write:
a(href=routes.blog.about_gulp)
rather than
a(href='/blog/why-gulp-rocks.html')
Clone repository:
git clone git@github.com:MaximeD/gulp_scaffold.git
Install modules:
$ cd gulp_scaffold$ npm install --save-dev$ bower install
The default task (gulp
) will create everythingbutsitemap.xml
.