Skip to content

Commit

Permalink
Added redirect generation for Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine committed Feb 4, 2017
1 parent 51b9383 commit 9518cfa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
17 changes: 17 additions & 0 deletions bin/redirects.js
@@ -0,0 +1,17 @@
var fs = require('fs');

module.exports = {

run: function(path, options, callback) {
var modified = options.modified || false;
var finished = options.finished || false;

// Empty path means it's the last thing it does
if (!path) {
fs.createReadStream('redirects').pipe(fs.createWriteStream('output/_redirects'));
}

return callback();
}

};
3 changes: 2 additions & 1 deletion config.json
Expand Up @@ -8,7 +8,8 @@

"plugins": {
"generator_hooks": {
"htaccess": "./bin/htaccess.js"
"htaccess": "./bin/htaccess.js",
"redirects": "./bin/redirects.js"
}
}
}
13 changes: 13 additions & 0 deletions redirects
@@ -0,0 +1,13 @@
/* https://hackerspace.sg/:splat 301

/calendar/hackerspacesg-events https://hackerspace.sg/calendar 301
/calendar/geektechdevdesign-events 404
/calendar/rojak-calendar https://hackerspace.sg/calendar 301
/readme-txt/membership/ https://hackerspace.sg/membership 301
/intertubes/ 404
/readme-txt/donations/ https://hackerspace.sg/membership 301
/about-us/ https://hackerspace.sg/about 301
/social/location/ https://hackerspace.sg/location 301
/chat https://scrollback.io/hackerspacesg/ 302
/feed 404
/rss.xml 404

0 comments on commit 9518cfa

Please sign in to comment.