URL shortening is just one use case for generating redirects. I wrote a similar module for Hakyll ('Hakyll.Web.Redirect' https://hackage.haskell.org/package/hakyll-4.13.4.0/docs/Hak...) but my intent was to allow renaming pages without breaking links and fixing the (truly innumerable) number of user errors in linking/writing URLs.
Because every original URL must be a valid file name, it does limit you compared to the full rewrite capabilities of Apache or Nginx, but that's the price you pay for a fully-static site. (I thought vaguely about writing some JS you could put in a 404.html to snoop the intended URL and do a lookup in a table to redirect to, but never got around to figuring out the details.)
We went the direction of DNS based redirects using a set of TXT records to get portability and delegation of subpaths with txtdirect.org (FOSS based on Caddy)
Currently working on a new iteration and feedback is always appreciated.
Comments
URL shortening is just one use case for generating redirects. I wrote a similar module for Hakyll ('Hakyll.Web.Redirect' https://hackage.haskell.org/package/hakyll-4.13.4.0/docs/Hak...) but my intent was to allow renaming pages without breaking links and fixing the (truly innumerable) number of user errors in linking/writing URLs.
Because every original URL must be a valid file name, it does limit you compared to the full rewrite capabilities of Apache or Nginx, but that's the price you pay for a fully-static site. (I thought vaguely about writing some JS you could put in a 404.html to snoop the intended URL and do a lookup in a table to redirect to, but never got around to figuring out the details.)
I like the simpleness of the idea here, but don't like HTML-redirects (v/s 302s).. Wondering if you could just do this via Netlify redirects?
I've found using txtd.io as a URL-shortener a much simpler approach.
Or lightsaber, which does the exact same thing, but with Ruby (and allows some wildcards): https://github.com/captn3m0/lightsaber
Netlify redirects would work, but I wanted more portability. Hard to beat good ol' static HTML!
I don't think it's a big deal, but I was confused for a minute, because sus in English slang is short for suspect/suspicious.
I consider that a feature, not a bug!
Others may disagree, though. :D
We went the direction of DNS based redirects using a set of TXT records to get portability and delegation of subpaths with txtdirect.org (FOSS based on Caddy) Currently working on a new iteration and feedback is always appreciated.
Cool. I made one similar https://github.com/djyde/genlink
Your project looks like my last one: very useful, but nobody understood the purpose.
Haha, thank you! I imagine a fair few people get it, but don't share the needs that motivated me to make and publish it.