Skip to content

Commit

Permalink
Merge pull request #129 from docpress/pug
Browse files Browse the repository at this point in the history
Swap jade for pug
  • Loading branch information
Ilya Radchenko authored Aug 15, 2016
2 parents 6b25273 + 14ca185 commit f2ea071
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
File renamed without changes.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const ware = require('ware')
const fs = require('fs')
const jade = require('jade')
const pug = require('pug')
const join = require('path').join
const assign = Object.assign

Expand Down Expand Up @@ -125,7 +125,7 @@ function addJs (files, ms, done) {
}

/**
* Layout jade.
* Layout pug.
* Passes these template options:
*
* * `base` — prefix.
Expand All @@ -151,9 +151,9 @@ function relayout (files, ms, done) {
const index = files['_docpress.json'].index
const meta = ms.metadata()

const jadeData = fs.readFileSync(join(__dirname, 'data/layout.jade'), 'utf-8')
const layout = memoize(['jade', jadeData], () => {
return jade.compile(jadeData, { pretty: true })
const pugData = fs.readFileSync(join(__dirname, 'data/layout.pug'), 'utf-8')
const layout = memoize(['pug', pugData], () => {
return pug.compile(pugData, { pretty: true })
})

eachCons(index, (_, fname, __, prevName, ___, nextName) => {
Expand All @@ -170,9 +170,9 @@ function relayout (files, ms, done) {
active: fname
}

const key = [ jadeData, locals, file ]
const key = [ pugData, locals, file ]

file.contents = memoize(['jadedata', key], () => {
file.contents = memoize(['pugdata', key], () => {
return layout(assign({}, file, locals))
})
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"dom101": "1.3.0",
"github-markdown-css": "2.1.1",
"iconfonts": "0.8.0",
"jade": "1.11.0",
"normalize.css": "3.0.3",
"nprogress": "0.2.0",
"onmount": "1.2.0",
"pjax": "0.1.4",
"postcss": "5.0.18",
"pug": "^2.0.0-beta5",
"stylus": "0.54.2",
"uglifyify": "3.0.1",
"ware": "1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/with_anchors_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('fixture/with anchors:', function () {
})

it('links to anchored versions', function () {
expect(data).toInclude('<a href="index.html#two" class="link title link-index-2">intro 2</a>')
expect(data).toInclude('<a class="link title link-index-2" href="index.html#two">intro 2</a>')
})
})
})
2 changes: 1 addition & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--recursive
--require mocha-clean/brief
--require test/setup
--watch-extensions=sass,jade,md,css
--watch-extensions=sass,pug,md,css
--timeout 10000

0 comments on commit f2ea071

Please sign in to comment.