3 ms·
You could also push static HTML pages to the git root which have, e.g., <meta http-equiv="refresh" content="1; url='https://news.ycombinator.com/ https://news.
by Jhsto 6y ago
You could also push static HTML pages to the git root which have, e.g.,
<meta http-equiv="refresh" content="1; url='https://news.ycombinator.com/ https://news.ycombinator.com/'" />
in the header.
- navanchauhan 6y agoI am not familiar with this, could you explain what will happen?
- ValentineC 6y agoI reckon it'll be possible to "simplify" it even more for an end-user, by making a static site generator generate these redirect HTML files from markdown or a CSV.
- nelsontky 6y agoSome guy shared his project in this post that does exactly that! Yes while that is possible and can get to a high level of automation via GitHub actions, the point of my URL shortener was more of people could post a link easily with a simple interface (like the interface for adding a new issue). But if I were operating with a fixed set of short links, then this would have been a good method!
- davchana 6y agoI did exactly as you said, about a year or two ago, using Jekyll. https://gitlab.com/davch/static-redirect https://gitlab.com/davch/static-redirect
- chrismorgan 6y agoAny particular reason why you wrote 1 rather than 0?
- Jhsto 6y agoNot really. Copied it from somewhere else where the placeholder value was 7. 1 came to my mind before 0. Zero seems like it could be UB.
- chrismorgan 6y agoNah, zero just means “redirect after zero seconds”, meaning immediately. You definitely want zero.
- wesleytodd 6y agoThat is how I did it: https://github.com/wesleytodd/short/blob/gh-pages/p2/index.html https://github.com/wesleytodd/short/blob/gh-pages/p2/index.h...