Skip to content

Commit

Permalink
fix redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ ONeal committed Jan 13, 2015
1 parent e5521bb commit 574ab20
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions desirae.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,17 +849,7 @@
view.contents = mustached;

// shallowClone to prevent perfect object equality (and potential template caching)
if (/Blog$/.test(view.entity.title)) {
console.log('desi.partials');
console.log(desi.partials);
}
newview = datamap(view);
if (/Blog$/.test(view.entity.title)) {
console.info('desi.collated');
console.log(desi);
console.info('newview.posts.collated');
console.log(newview.posts.collated);
}
mustached = Mustache.render(html, newview, desi.partials);

return mustached;
Expand Down Expand Up @@ -890,7 +880,6 @@
} else {
view.entity.disqus_url = view.entity.production_url;
}
console.log('entity', view.entity);

return view;
});
Expand Down Expand Up @@ -951,7 +940,6 @@

desi.transforms.forEach(function (fn) {
view = fn(view);
console.log('view.entity', view.entity);
});

return renderLayers(desi, env, view, entity).then(function (html) {
Expand All @@ -973,13 +961,14 @@
console.info('found index, ignoring redirect');
}

var redirectHtml = Mustache.render(desi.partials.redirect, view)
;

entity.yml.redirects.forEach(function (redirect) {
var html = Mustache.render(desi.partials.redirect, view)
;

compiled.push({
contents: html
, path: path.join(redirect)
contents: redirectHtml
, path: redirect
});
});
}).catch(function (e) {
Expand Down

0 comments on commit 574ab20

Please sign in to comment.