Update ghu. Switch from jade to pug.

This commit is contained in:
Lars Jung 2016-05-31 01:21:44 +02:00
parent 93487de085
commit ba670be7d8
4 changed files with 11 additions and 12 deletions

9
ghu.js
View file

@ -1,8 +1,7 @@
const {resolve, join} = require('path');
const {
ghu,
autoprefixer, cssmin, each, ife, includeit, jade, jszip,
less, mapfn, newerThan, read, remove, run, uglify, watch, wrap, write
ghu, autoprefixer, cssmin, each, ife, includeit, jszip, less, mapfn,
newerThan, pug, read, remove, run, uglify, watch, wrap, write
} = require('ghu');
const ROOT = resolve(__dirname);
@ -72,7 +71,7 @@ ghu.task('build:styles', runtime => {
ghu.task('build:pages', runtime => {
return read(`${SRC}: **/*.jade, ! **/*.tpl.jade`)
.then(newerThan(mapper, `${SRC}/**/*.tpl.jade`))
.then(jade({pkg: runtime.pkg}))
.then(pug({pkg: runtime.pkg}))
.then(wrap('', runtime.commentHtml))
.then(write(mapper, {overwrite: true}));
});
@ -117,7 +116,7 @@ ghu.task('build:tests', ['build:scripts', 'build:styles'], 'build the test suite
read(`${TEST}/index.html.jade`)
.then(newerThan(`${BUILD}/test/index.html`))
.then(jade({pkg: runtime.pkg}))
.then(pug({pkg: runtime.pkg}))
.then(write(`${BUILD}/test/index.html`, {overwrite: true})),
read(`${BUILD}/_h5ai/public/js/scripts.js`)

View file

@ -15,8 +15,8 @@
"build": "node ghu release"
},
"devDependencies": {
"eslint": "2.10.2",
"ghu": "0.4.0"
"eslint": "2.11.0",
"ghu": "0.6.0"
},
"engines": {
"node": ">=6.0.0"

View file

@ -7,4 +7,4 @@ block init
block body
div#content
h1#header
a(href='#{pkg.homepage}') h5ai
a(href=pkg.homepage) h5ai

View file

@ -9,23 +9,23 @@ html(class='no-js', lang='en')
meta(charset='utf-8')
meta(http-equiv='x-ua-compatible', content='ie=edge')
title #{title}
meta(name='description', content='#{title}')
meta(name='description', content=title)
meta(name='viewport', content='width=device-width, initial-scale=1')
link(rel='shortcut icon', href!='<?= $public_href; ?>images/favicon/favicon-16-32.ico')
link(rel='apple-touch-icon-precomposed', type='image/png', href!='<?= $public_href; ?>images/favicon/favicon-152.png')
link(rel='stylesheet', href!='<?= $public_href; ?>css/styles.css')
<?php if (!$fallback_mode) { ?>
script(src!='<?= $public_href; ?>js/scripts.js', data-module='#{module}')
script(src!='<?= $public_href; ?>js/scripts.js', data-module=module)
<?php } ?>
<?= $x_head_tags; ?>
body#root(class='#{module}')
body#root(class=module)
div#fallback-hints
<?php if (!$fallback_mode) { ?>
span.noJsMsg Works best with JavaScript enabled!
span.noBrowserMsg Works best in #[a(href='http://browsehappy.com') modern browsers]!
<?php } ?>
span.backlink #[a(href='#{pkg.homepage}', title='h5ai v#{pkg.version} - #{pkg.description}') powered by h5ai]
span.backlink #[a(href=pkg.homepage, title=`h5ai v${pkg.version} - ${pkg.description}`) powered by h5ai]
block body