Skip to content

Commit 2d1dcc9

Browse files
committed
update docs
1 parent 6abe3cd commit 2d1dcc9

4 files changed

Lines changed: 34 additions & 8 deletions

File tree

docs/bs-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"port": 3000,
3+
"files": ["./dist/**/*.{html,css,js}"],
4+
"server": { "baseDir": "./dist" }
5+
}

docs/gulpfile.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var gulp = require('gulp');
22
var $ = require('gulp-load-plugins')();
3+
var runSequence = require('run-sequence');
34

45
/////////////
56
// OPTIONS //
@@ -93,7 +94,7 @@ gulp.task('clean-css', function (cb) {
9394
////////////////
9495

9596
// Compile Sass
96-
gulp.task('sass', ['clean-css'], function () {
97+
gulp.task('sass', function () {
9798
return gulp.src(__SRC_SASS)
9899
// (optional) sourcemaps
99100
.pipe($.if(__SOURCEMAPS, $.sourcemaps.init()))
@@ -118,6 +119,11 @@ gulp.task('sass', ['clean-css'], function () {
118119
.pipe(gulp.dest(__DIST_CSS))
119120
});
120121

122+
// Clean CSS & Compile Sass
123+
gulp.task('sass:build', function (callback) {
124+
runSequence('clean-css', 'sass', callback)
125+
});
126+
121127
// Watch Sass
122128
gulp.task('sass:watch', function () {
123129
gulp.watch(__WATCH_SASS, ['sass'])
@@ -155,7 +161,7 @@ var bundleLogger = {
155161
}
156162

157163
// Compile Browserify bundles
158-
gulp.task('browserify', ['clean-browserify'], function (callback) {
164+
gulp.task('browserify', function (callback) {
159165

160166
globby(__SRC_BROWSERIFY).then(function (bundles) {
161167

@@ -238,6 +244,11 @@ gulp.task('browserify', ['clean-browserify'], function (callback) {
238244
});
239245
});
240246

247+
// Clean & Compile bundles
248+
gulp.task('browserify:build', function (callback) {
249+
runSequence('clean-browserify', 'browserify', callback)
250+
});
251+
241252
// Watch Browserify Bundles
242253
gulp.task('browserify:watch', function () {
243254
gulp.watch(__WATCH_BROWSERIFY, ['browserify'])
@@ -261,7 +272,7 @@ swigMarked.configure({
261272
});
262273

263274
// Compile Swig
264-
gulp.task('html', ['html:clean'], function () {
275+
gulp.task('html', function () {
265276
return gulp.src(__SRC_HTML)
266277
.pipe($.frontMatter({ property: 'data' }))
267278
.pipe($.swig({
@@ -275,12 +286,14 @@ gulp.task('html', ['html:clean'], function () {
275286
swigMarked.useTag(swig, 'markdown');
276287
}
277288
}))
289+
.pipe($.changed(__DIST, { hasChanged: $.changed.compareSha1Digest }))
278290
.pipe(gulp.dest(__DIST));
279291
});
280292

281-
// Prettify HTML
293+
// Compile Swig & Prettify HTML
282294
gulp.task('html:prettify', ['html'], function () {
283295
return gulp.src(__DIST + '/**/*.html')
296+
.pipe($.changed(__DIST, { hasChanged: $.changed.compareSha1Digest }))
284297
.pipe($.prettify({
285298
indent: 4,
286299
indent_inner_html: false,
@@ -292,6 +305,11 @@ gulp.task('html:prettify', ['html'], function () {
292305
.pipe(gulp.dest(__DIST));
293306
});
294307

308+
// Clean HTML, Compile Swig & Prettify HTML
309+
gulp.task('html:build', function (callback) {
310+
runSequence('html:clean', 'html:prettify', callback)
311+
});
312+
295313
// Watch HTML
296314
gulp.task('html:watch', ['watch:set'], function () {
297315
gulp.watch(__WATCH_HTML, ['html:prettify'])
@@ -326,4 +344,4 @@ gulp.task('watch:set', function (cb) {
326344
gulp.task('watch', ['sass:watch', 'browserify:watch', 'html:watch']);
327345

328346
// Default
329-
gulp.task('default', ['copy:vendor', 'sass', 'browserify', 'html', 'html:prettify']);
347+
gulp.task('default', ['copy:vendor', 'sass:build', 'browserify:build', 'html:build']);

docs/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1",
77
"deploy": "surge --project ./dist",
8-
"serve": "http-server ./dist -o -s"
8+
"serve": "lite-server"
99
},
1010
"author": "Laza Bogdan <laza.bogdan@macro-net.ro>",
1111
"license": "ISC",
@@ -28,6 +28,7 @@
2828
"fs-resolver": "^1.0.0",
2929
"globby": "^4.0.0",
3030
"gulp": "^3.9.1",
31+
"gulp-changed": "^1.3.0",
3132
"gulp-clean-css": "^2.0.2",
3233
"gulp-front-matter": "^1.3.0",
3334
"gulp-if": "^2.0.0",
@@ -40,9 +41,10 @@
4041
"gulp-swig": "^0.8.0",
4142
"gulp-uglify": "^1.5.3",
4243
"gulp-util": "^3.0.7",
43-
"http-server": "^0.9.0",
44+
"lite-server": "^2.2.0",
4445
"lodash.assign": "^4.0.4",
4546
"pretty-hrtime": "^1.0.2",
47+
"run-sequence": "^1.2.0",
4648
"sass-importer-npm": "^1.0.2",
4749
"surge": "^0.17.7",
4850
"swig-marked": "0.0.1",

docs/src/html/layouts/demo.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html class="bootstrap-layout">
2+
<html>
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -14,6 +14,7 @@
1414
{% block page %}{% endblock %}
1515

1616
{% include 'layouts/_footer.html' %}
17+
{% block footer %}{% endblock %}
1718

1819
</body>
1920
</html>

0 commit comments

Comments
 (0)