Hacker News new | ask | show | jobs
by lewiscollard 515 days ago
> so I wound up putting some JS in my index page template that checks for that kind of thing.

If we are going to use JS, then you might as well put the redirects themselves in JS. Have a tiny stub of JS that detects the "/?p=xxx" case, which can then load the (presumably very large) list of redirects from a separate file and do the redirecting. That'll save you maintaining the extra service.

As for me, I moved from a Django app I made to a Hugo site, but it's pretty much the same deal. Because my Hugo site is on a "real" server (rather than e.g. GitHub Pages) I just have a giant pile of 500+ redirects in the nginx config file for the site (which is checked into the same repo as my Hugo site). It works for me.

1 comments

That's a nifty idea! I need the extra Flask for some other unrelated stuff, so it's OK as it is, but if it was on GH pages (like you say) that would be super useful.