Skip to content

Commit

Permalink
refactor: reduce the plain object size
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jun 27, 2020
1 parent f9f6265 commit 37e67e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/plugins/filter/before_generate/render_post.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ function renderPostFilter(data) {
const renderPosts = model => {
const posts = model.toArray().filter(post => post.content == null);

const highlightCfg = {
highlight: this.config.highlight,
prismjs: this.config.prismjs
};

return Promise.map(posts, post => {
return Promise.resolve(post._content).then(_content => {
return pool.run({ input: _content, siteCfg: this.config });
return pool.run({ input: _content, siteCfg: highlightCfg });
}).then(content => {
post.content = content;
post.site = { data };
Expand Down

0 comments on commit 37e67e5

Please sign in to comment.