Skip to content

Commit

Permalink
Merge pull request #88 from Joe-Brady/repo-change
Browse files Browse the repository at this point in the history
Add sitemap generator
  • Loading branch information
Joe Brady authored May 3, 2017
2 parents b90f3fa + 94a13ec commit 44946bb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ npm-debug.log
.idea
dist
*.html
sitemap.xml
robots.txt
26 changes: 25 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ const imagemin = require('gulp-imagemin');
const handlebars = require('gulp-compile-handlebars');
const eslint = require('gulp-eslint');
const gutil = require('gulp-util');
const sitemap = require('gulp-sitemap');
//const robots = require('gulp-robots');

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

// build task
gulp.task('build', function() {
runSequence(['handlebars','scripts','styles','images','icon'],'lint');
runSequence(['handlebars','scripts','styles','images','icon'],'sitemap','lint');
});

// watch task
Expand Down Expand Up @@ -100,3 +102,25 @@ gulp.task('lint', function() {
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

// sitemap task
gulp.task('sitemap', function () {
gulp.src('./*.html', {
read: false
})
.pipe(sitemap({
siteUrl: 'https://adoptopenjdk.net'
}))
.pipe(gulp.dest('./'));
});

// robots task - commented out unless required.
/*gulp.task('robots', function () {
gulp.src('index.html')
.pipe(robots({
useragent: '*',
allow: ['/'],
disallow: ['cgi-bin/']
}))
.pipe(gulp.dest('./'));
});*/
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"gulp-imagemin": "^3.2.0",
"gulp-minify-css": "^1.2.4",
"gulp-rename": "^1.2.2",
"gulp-robots": "^2.0.4",
"gulp-sass": "^3.1.0",
"gulp-sitemap": "^4.2.0",
"gulp-uglify": "^2.1.2",
"mocha": "^3.2.0",
"open": "^0.0.5",
Expand Down
54 changes: 0 additions & 54 deletions sitemap.xml

This file was deleted.

0 comments on commit 44946bb

Please sign in to comment.