Skip to content

Commit

Permalink
Remove url_for helper reference in Post.permalink getter
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Jun 28, 2016
1 parent cf5b76e commit fc4ca63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ module.exports = function(ctx) {
});

Post.virtual('permalink').get(function() {
var url_for = ctx.extend.helper.get('url_for');
return ctx.config.url + url_for.call(ctx, this.path);
var config = ctx.config;

return config.url + config.root + this.path;
});

Post.virtual('full_source').get(function() {
Expand Down
7 changes: 3 additions & 4 deletions lib/theme/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,20 @@ View.prototype._precompile = function() {
];
}

if (!renderer) return;
if (typeof renderer.compile === 'function') {
if (renderer && typeof renderer.compile === 'function') {
var compiled = renderer.compile(data);

this._compiledSync = function(locals) {
var result = compiled(locals);
return ctx.execFilterSync.apply(ctx, buildFilterArguments(result));
};

this._compiled = (function(locals) {
this._compiled = function(locals) {
return Promise.resolve(compiled(locals))
.then(function(result) {
return ctx.execFilter.apply(ctx, buildFilterArguments(result));
});
});
};
} else {
this._compiledSync = function(locals) {
return render.renderSync(data, locals);
Expand Down

0 comments on commit fc4ca63

Please sign in to comment.