Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Scaffold for a static website using gulp

License

NotificationsYou must be signed in to change notification settings

MaximeD/gulp_scaffold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Take a look at thedemoand thecode running it.

Structure

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.

src/assets

src/assets/images

Your image will be processed bygulp-imagemin.It is responsible to compress them.

They will be placed in/dist/images.

src/assets/javascripts

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.

src/assets/static

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.

src/assets/stylesheets

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.

src/templates

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.

src/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.

Configuration

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')

Installation

Clone repository:

git clone git@github.com:MaximeD/gulp_scaffold.git

Install modules:

$ cd gulp_scaffold$ npm install --save-dev$ bower install

Tasks

The default task (gulp) will create everythingbutsitemap.xml.

About

Scaffold for a static website using gulp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp