Open dr-potato opened 10 years ago
+1
The gulp-ssg templates example might help. Ignore the marked & ssg bits, just notice you have to manually iterate over each file and render the templates manually
t'would be great if the plugin took another option on:
, being the option the property is added to (instead of file
. e.g.
var opts = {}
gulp.task('default', function () {
return gulp.src( ['./**/*.{md,markdown}'] )
.pipe(frontMatter({
property: 'front' // property added to file object
on: opts
}))
.pipe(header(page, opts)) // opts.front is now the stuff of legends .. er .. you know :)
// ...
});
I thought that this was a good idea. Now I no longer think it is. We should probably just load the front-matter with node or find another way to use it.
I'm sorry, I must be a noob, but it isn't clear to me how to use the object generated with gulp-front-matter. The examples are clear to me, but they don't show how you would use the object in a template for example.
I have the following code in my gulpfile.js
And am using it with this template:
This is the error I get when I run gulp:
I must be doing something wrong, and it's probably stupid. Or it might be a legitimate bug. Can you tell what's causing the error? I'm sure others of my 'skill level' will have the same problem. Maybe adding a simple usecase to the docs would solve this.
Thanks!