Skip to content

Commit 44946bb

Browse files
author
Joe Brady
authored
Merge pull request #88 from Joe-Brady/repo-change
Add sitemap generator
2 parents b90f3fa + 94a13ec commit 44946bb

File tree

4 files changed

+29
-55
lines changed

4 files changed

+29
-55
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ npm-debug.log
33
.idea
44
dist
55
*.html
6+
sitemap.xml
7+
robots.txt

gulpfile.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ const imagemin = require('gulp-imagemin');
1111
const handlebars = require('gulp-compile-handlebars');
1212
const eslint = require('gulp-eslint');
1313
const gutil = require('gulp-util');
14+
const sitemap = require('gulp-sitemap');
15+
//const robots = require('gulp-robots');
1416

1517
// default task
1618
gulp.task('default', ['handlebars','scripts','styles','images','icon','watch']);
1719

1820
// build task
1921
gulp.task('build', function() {
20-
runSequence(['handlebars','scripts','styles','images','icon'],'lint');
22+
runSequence(['handlebars','scripts','styles','images','icon'],'sitemap','lint');
2123
});
2224

2325
// watch task
@@ -100,3 +102,25 @@ gulp.task('lint', function() {
100102
.pipe(eslint.format())
101103
.pipe(eslint.failAfterError());
102104
});
105+
106+
// sitemap task
107+
gulp.task('sitemap', function () {
108+
gulp.src('./*.html', {
109+
read: false
110+
})
111+
.pipe(sitemap({
112+
siteUrl: 'https://adoptopenjdk.net'
113+
}))
114+
.pipe(gulp.dest('./'));
115+
});
116+
117+
// robots task - commented out unless required.
118+
/*gulp.task('robots', function () {
119+
gulp.src('index.html')
120+
.pipe(robots({
121+
useragent: '*',
122+
allow: ['/'],
123+
disallow: ['cgi-bin/']
124+
}))
125+
.pipe(gulp.dest('./'));
126+
});*/

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"gulp-imagemin": "^3.2.0",
2121
"gulp-minify-css": "^1.2.4",
2222
"gulp-rename": "^1.2.2",
23+
"gulp-robots": "^2.0.4",
2324
"gulp-sass": "^3.1.0",
25+
"gulp-sitemap": "^4.2.0",
2426
"gulp-uglify": "^2.1.2",
2527
"mocha": "^3.2.0",
2628
"open": "^0.0.5",

sitemap.xml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)