Open dacodekid opened 9 years ago
In addition, if we specify those engine specific
options on both places (gulpfile & markdown), is it possible for markdown to takeover and override the values?
+1, I need to pass these options too
on the other hand, we should have a way to do it like this:
.pipe(layout(function(file) {
return {
pretty: true,
layout: '<whatever>.jade',
locals: {
front: file.frontMatter
}
}
}))
and then just use front.title
instead of just title
.
the previous example works, but locals should be injected directly into the object:
var config = require('./config.json');
// ...
.pipe(layout(function(file) {
return {
pretty: true,
layout: './layout.jade',
config: config,
front: file.frontMatter
}
}))
layout.jade
:
html
head
title My Page - #{front.title}
body
h1 #{front.title}
div
span= config.author
!= contents
#footer
p some footer content
Sorry for ther late reply.
This library use consolidate.js
. As far as I know, it is necessary to pass the object that merge engine config
and locals
. So it is difficult to sparate engine config
.
With such Object.assign()
, it would be a little better.
If there is a way to pass separate objects, please tell me.
I'm not sure, I am approaching this right, but currently if I need to pass
pretty: true
option forjade
then either I'm adding the values tofile.frontMatter
like belowor, I have to pass those via my
post.md
's frontmatterIs it possible to pass those
Engine
specific options separately as another argument toLayout()
?