You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2017/07/03 21:42:39 UTC

camel git commit: CAMEL-11492 New Camel website

Repository: camel
Updated Branches:
  refs/heads/website 236914546 -> 14743869c


CAMEL-11492 New Camel website

Improve gulp watch task to take into account only changed files and
reuse the pipe from the component tasks.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/14743869
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/14743869
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/14743869

Branch: refs/heads/website
Commit: 14743869c416cc0d64d5a33c23bc158213328566
Parents: 2369145
Author: Zoran Regvart <zr...@apache.org>
Authored: Mon Jul 3 23:42:35 2017 +0200
Committer: Zoran Regvart <zr...@apache.org>
Committed: Mon Jul 3 23:42:35 2017 +0200

----------------------------------------------------------------------
 camel-website/gulpfile.js | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/14743869/camel-website/gulpfile.js
----------------------------------------------------------------------
diff --git a/camel-website/gulpfile.js b/camel-website/gulpfile.js
index 75b7ed5..5b36839 100644
--- a/camel-website/gulpfile.js
+++ b/camel-website/gulpfile.js
@@ -21,16 +21,23 @@ const replace = require('gulp-replace');
 
 const version = process.env.npm_package_version.replace(/-.*/, '');
 
-gulp.task('docs', ['component-doc']);
-
-gulp.task('component-doc', () => {
-  gulp.src('../components/readme.adoc')
-    .pipe(replace(/link:.*\/(.*).adoc(\[.*)/g, `link:components/${version}/$1$2`))
-    .pipe(rename('components.adoc'))
-    .pipe(gulp.dest('content'));
-  gulp.src('../components/**/src/main/docs/*.adoc')
-    .pipe(rename({dirname: ''}))
-    .pipe(gulp.dest(`content/components/${version}`));
+gulp.task('docs', ['components-readme', 'components']);
+
+const components = (path) => gulp.src(path || '../components/**/src/main/docs/*.adoc')
+  .pipe(rename({dirname: ''}))
+  .pipe(gulp.dest(`content/components/${version}`));
+
+gulp.task('components', () => {
+  return components();
+});
+
+const componentReadme = () => gulp.src('../components/readme.adoc')
+  .pipe(replace(/link:.*\/(.*).adoc(\[.*)/g, `link:components/${version}/$1$2`))
+  .pipe(rename('components.adoc'))
+  .pipe(gulp.dest('content'));
+
+gulp.task('components-readme', () => {
+  return componentReadme();
 });
 
 gulp.task('asciidoctor-shim', () => {
@@ -43,6 +50,11 @@ gulp.task('asciidoctor-shim', () => {
 gulp.task('default', ['docs', 'asciidoctor-shim']);
 
 gulp.task('watch', () => {
-  gulp.watch('../**/*.adoc', ['docs']);
-});
+  gulp.watch(['../components/**/*.adoc', '!../components/readme.adoc'], (event) => {
+    components(event.path);
+  });
 
+  gulp.watch('../components/readme.adoc', (event) => {
+    componentReadme();
+  });
+});