You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use gulp-nunjucks with nunjucks markdown and I'm getting a weird result. The plugin inserts the string undefined wherever I have the markdown tag, but it works fine with HTML. Is there an example of this plugin working with nunjucks-markdown? I haven't found any and I'm curious if I did it right.
Here is the entire code I'm using as a Gulp task, in case someone can spot any errors.
// Require Gulp firstconstgulp=require('gulp');constextReplace=require('gulp-ext-replace');// Nunjucks and Markdownconstnunjucks=require('nunjucks');constmarkdown=require('nunjucks-markdown');constgulpnunjucks=require('gulp-nunjucks');// const nunjucksRender = require('gulp-nunjucks-render');constgrayMatter=require('gulp-gray-matter');constMarkdownIt=require('markdown-it');constmd=require('markdown-it')();// Nunjucks consts for file locationconstdist='docs';constsrc='src';consttemplates=src+'/templates';constcontent=src+'/pages';// Where to pull files from?constenv=newnunjucks.Environment(newnunjucks.FileSystemLoader(templates));markdown.register(env,(text)=>{md.render(text);});gulp.task('renderContent',function(){returngulp.src(content+'/**/*.md').pipe(grayMatter()).pipe(gulpnunjucks.compile('',{env: env})).pipe(extReplace('.html')).pipe(gulp.dest(dist));});
The text was updated successfully, but these errors were encountered:
I'm trying to use gulp-nunjucks with nunjucks markdown and I'm getting a weird result. The plugin inserts the string undefined wherever I have the markdown tag, but it works fine with HTML. Is there an example of this plugin working with nunjucks-markdown? I haven't found any and I'm curious if I did it right.
Here is the entire code I'm using as a Gulp task, in case someone can spot any errors.
The text was updated successfully, but these errors were encountered: