drhayes / drhay.es

My custom shortlink domain.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drhay.es

Can I make a shortlink site using Netlify's redirecting service?

Yes.

Can I make it dynamically generate from a directory of files, thus ensuring uniqueness and easy additions?

Also yes.

Overview

The Makefile's default target is site/_redirects. That file has a pretty simple format so I'm going to dynamically generate it with a relatively simple Node script.

To add more link targets, add a file to the links directory. The name of the file becomes the shortlink suffix and the contents become the URL that we 301 redirect to.

About

My custom shortlink domain.


Languages

Language:JavaScript 74.0%Language:HTML 13.8%Language:Makefile 12.2%