Browse files

Migrating some of the cloudflare url aliases to our router

  • Loading branch information...
1 parent b2c2574 commit dc287c3dfe2c5c98f39ada47c33fa87d27e0c997 @balupton balupton committed Jan 14, 2013
Showing with 37 additions and 7 deletions.
  1. +19 −4 app/out/docpad.js
  2. +18 −3 app/src/docpad.coffee
View
23 app/out/docpad.js
@@ -344,15 +344,30 @@ docpadConfig = {
return res.send(body);
});
});
+ server.get(/^\/(plugins|upgrade|install|troubleshoot)\/?$/, function(req, res) {
+ var relativeUrl;
+ relativeUrl = req.params[0] || '';
+ return res.redirect(301, "http://docpad.org/docs/" + relativeUrl);
+ });
+ server.get(/^\/docpad(?:\/(.*))?$/, function(req, res) {
+ var relativeUrl;
+ relativeUrl = req.params[0] || '';
+ return res.redirect(301, "http://docpad.org/docs/" + relativeUrl);
+ });
server.get(/^\/((?:support|node|joe|query-?engine).*)$/, function(req, res) {
- var bevryUrl;
- bevryUrl = req.params[0] || '';
- return res.redirect(301, "https://bevry.me/" + bevryUrl);
+ var relativeUrl;
+ relativeUrl = req.params[0] || '';
+ return res.redirect(301, "http://bevry.me/" + relativeUrl);
+ });
+ server.get(/^\/(?:g|github)(?:\/(.*))?$/, function(req, res) {
+ var issueQuery;
+ issueQuery = req.params[0] || '';
+ return res.redirect(301, "https://github.com/bevry/docpad/" + issueQuery);
});
server.get(/^\/(?:i|issues)(?:\/(.*))?$/, function(req, res) {
var issueQuery;
issueQuery = req.params[0] || '';
- return res.redirect(301, "https://github.com/bevry/" + issueQuery);
+ return res.redirect(301, "https://github.com/bevry/docpad/issues/" + issueQuery);
});
server.get(/^\/(?:p|plugins)(?:\/(.*))?$/, function(req, res) {
var plugin;
View
21 app/src/docpad.coffee
@@ -412,15 +412,30 @@ docpadConfig =
res.send(body)
)
+ # DocPad Short Links
+ server.get /^\/(plugins|upgrade|install|troubleshoot)\/?$/, (req,res) ->
+ relativeUrl = req.params[0] or ''
+ res.redirect(301, "http://docpad.org/docs/#{relativeUrl}")
+
+ # DocPad Content
+ server.get /^\/docpad(?:\/(.*))?$/, (req,res) ->
+ relativeUrl = req.params[0] or ''
+ res.redirect(301, "http://docpad.org/docs/#{relativeUrl}")
+
# Bevry Content
server.get /^\/((?:support|node|joe|query-?engine).*)$/, (req,res) ->
- bevryUrl = req.params[0] or ''
- res.redirect(301, "https://bevry.me/#{bevryUrl}")
+ relativeUrl = req.params[0] or ''
+ res.redirect(301, "http://bevry.me/#{relativeUrl}")
+
+ # GitHub
+ server.get /^\/(?:g|github)(?:\/(.*))?$/, (req,res) ->
+ issueQuery = req.params[0] or ''
+ res.redirect(301, "https://github.com/bevry/docpad/#{issueQuery}")
# Issues
server.get /^\/(?:i|issues)(?:\/(.*))?$/, (req,res) ->
issueQuery = req.params[0] or ''
- res.redirect(301, "https://github.com/bevry/#{issueQuery}")
+ res.redirect(301, "https://github.com/bevry/docpad/issues/#{issueQuery}")
# Plugins
server.get /^\/(?:p|plugins)(?:\/(.*))?$/, (req,res) ->

0 comments on commit dc287c3

Please sign in to comment.