在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):wires/gulp-static-site开源软件地址(OpenSource Url):https://github.com/wires/gulp-static-site开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):Build static sites with gulpThis is how it works
Then put this in your gulpfile var gulp = require('gulp');
var static_site = require('gulp-static-site');
var paths = {
sources: ['contents/**','templates/**'],
stylesheets: ['css/**']
};
gulp.task('site', function () {
return gulp.src('contents/**/*.md')
.pipe(static_site())
.pipe(gulp.dest('build/'))
});
gulp.task('css', function () {
return gulp.src('css/*.css')
.pipe(gulp.dest('build/css'));
});
gulp.task('default', ['site','css'], function () {
gulp.watch(paths.sources, ['site']);
gulp.watch(paths.stylesheets, ['css']);
}); Example JADE template doctype html
html
head
link(rel='stylesheet', href='http://yui.yahooapis.com/pure/0.4.2/pure-min.css')
meta(http-equiv='content-type', content='text/html; charset=UTF-8')
body
div.pure-g-r#main
div.pure-u-1-5
p Menu
ul
each node in page.tree.nodes
if node.leaf
li
a(href=node.leaf.href)= node.leaf.shortName
div.pure-u-4-5
!= page.contents Now we need some markdown files
Gulp that business:
Open your file:
More infoFor now, have a look at the source for |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论