From 56b658cc96bb58df1c67cce1cb6ec3ce48358deb Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 31 Dec 2020 13:11:22 -0800 Subject: [PATCH] Fixed: Restored robots.txt (cherry picked from commit 37501094d7256e4dbe13de33b392933f6d475553) --- frontend/gulp/build.js | 3 ++- frontend/gulp/copy.js | 8 ++++++++ frontend/gulp/helpers/paths.js | 1 + frontend/gulp/watch.js | 1 + frontend/src/Content/robots.txt | 2 ++ 5 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 frontend/src/Content/robots.txt diff --git a/frontend/gulp/build.js b/frontend/gulp/build.js index 8d036f92e..f1f708e64 100644 --- a/frontend/gulp/build.js +++ b/frontend/gulp/build.js @@ -10,7 +10,8 @@ gulp.task('build', 'webpack', 'copyHtml', 'copyFonts', - 'copyImages' + 'copyImages', + 'copyRobots' ) ) ); diff --git a/frontend/gulp/copy.js b/frontend/gulp/copy.js index 871c565f6..ee84d2152 100644 --- a/frontend/gulp/copy.js +++ b/frontend/gulp/copy.js @@ -32,3 +32,11 @@ gulp.task('copyImages', () => { .pipe(gulp.dest(paths.dest.root)) .pipe(livereload()); }); + +gulp.task('copyRobots', () => { + return gulp.src(paths.src.robots, { base: paths.src.root }) + .pipe(cache('copyRobots')) + .pipe(print()) + .pipe(gulp.dest(paths.dest.root)) + .pipe(livereload()); +}); diff --git a/frontend/gulp/helpers/paths.js b/frontend/gulp/helpers/paths.js index 8707faec4..be866abcd 100644 --- a/frontend/gulp/helpers/paths.js +++ b/frontend/gulp/helpers/paths.js @@ -8,6 +8,7 @@ const paths = { content: `${root}/Content/`, fonts: `${root}/Content/Fonts/`, images: `${root}/Content/Images/`, + robots: `${root}/Content/robots.txt`, exclude: { libs: `!${root}/JsLibraries/**` } diff --git a/frontend/gulp/watch.js b/frontend/gulp/watch.js index f83a4bba4..bdb3ad8d2 100644 --- a/frontend/gulp/watch.js +++ b/frontend/gulp/watch.js @@ -13,6 +13,7 @@ function watch() { gulpWatch(paths.src.html, gulp.series('copyHtml')); gulpWatch(`${paths.src.fonts}**/*.*`, gulp.series('copyFonts')); gulpWatch(`${paths.src.images}**/*.*`, gulp.series('copyImages')); + gulpWatch(paths.src.robots, gulp.series('copyRobots')); } gulp.task('watch', gulp.series('build', watch)); diff --git a/frontend/src/Content/robots.txt b/frontend/src/Content/robots.txt new file mode 100644 index 000000000..77470cb39 --- /dev/null +++ b/frontend/src/Content/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file