Skip to content

Commit

Permalink
Fix inject Disqus
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 30, 2016
1 parent 80643aa commit b5f0a12
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.js
Expand Up @@ -165,10 +165,13 @@ function addJs (files, ms, done) {
function injectDisqus (disqus) {
if (!disqus) return noop
var exclude = new RegExp(disqus.exclude || 'index')
return function addDisqus (fname, meta) {
if (exclude.test(fname)) return
meta.disqus = disqus.shortname

function addDisqus (fname, meta) {
if (exclude.test(fname)) return null
return disqus.shortname
}

return addDisqus
}

function relayout (files, ms, done) {
Expand Down Expand Up @@ -201,8 +204,7 @@ function relayout (files, ms, done) {
active: fname
}

addDisqus(fname, meta)

meta.disqus = addDisqus(fname, meta)
const key = [ pugData, locals, file ]

file.contents = memoize(['pugdata', key], () => {
Expand Down

0 comments on commit b5f0a12

Please sign in to comment.