Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
gulpfile will copy new files to dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliott Marquez committed Apr 25, 2018
1 parent 8e1c4e9 commit c192eef
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ function convertMarkdownToHtml(templateName) {
data.file = file;
data.title = data.title || '';
data.subtitle = data.subtitle || '';

let content = file.content;
// Inline code snippets before running through markdown for syntax highlighting.
content = content.replace(/<!--\s*include_file\s*([^\s]*)\s*-->/g,
(match, src) => fs.readFileSync(`app/${src}`));
// Markdown -> HTML.
content = markdownIt.render(content);

// If there is a table of contents, toc-ify it. Otherwise, wrap the
// original markdown content anyway, so that we can style it.
if (content.match(/<!--\s*toc\s*-->/gi)) {
Expand All @@ -219,11 +219,11 @@ function convertMarkdownToHtml(templateName) {
} else {
data.content = '<div class="article-wrapper"><article>' + content + '</article></div>';
}

const tmpl = fs.readFileSync(templateName);
const renderTemplate = $.util.template(tmpl);
return renderTemplate(data);

return renderTemplate(data);
});
}

Expand Down Expand Up @@ -251,6 +251,7 @@ gulp.task('jshint', 'Lint JS', function() {
return gulp.src([
'gruntfile.js',
'app/js/**/*.js',
'!app/js/**/sdk*',
'app/elements/**/*.js',
'app/elements/**/*.html'
])
Expand Down Expand Up @@ -295,8 +296,8 @@ gulp.task('copy', 'Copy site files (polyfills, templates, etc.) to dist/', funct
}))
.pipe(gulp.dest('dist'));

const jsSamples = gulp.src([
'app/3.0/start/samples/**/*.js',
const samples = gulp.src([
'app/3.0/start/samples/**/*',
], {base: 'app/'})
.pipe(gulp.dest('dist'));

Expand Down Expand Up @@ -333,7 +334,7 @@ gulp.task('copy', 'Copy site files (polyfills, templates, etc.) to dist/', funct
], {base: 'app'})
.pipe(gulp.dest('dist'));

return merge(app, docs, jsSamples, gae, bower, bundles, demo1, demo2, summit);
return merge(app, docs, samples, gae, bower, bundles, demo1, demo2, summit);
});

gulp.task('watch', 'Watch files for changes', function() {
Expand Down

0 comments on commit c192eef

Please sign in to comment.