Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Jekyll and GitHub Pages template repository for creating a self-hosted URL shortener with short, shareable links.
Jekyll URL Shortener is a GitHub template repository that turns a Jekyll site hosted on GitHub Pages into a self-hosted URL shortener, where every short link is a Markdown or HTML page with a redirect_to front matter value. It is maintained by hlaueriksson and demonstrated at https://hlaueriksson.github.io/jekyll-url-shortener/.
Jekyll URL Shortener is a starter repository that creates a static-site URL shortener; it accepts page files with redirect front matter as input and outputs redirect pages that forward visitors to any target URL. The stack is Jekyll with the jekyll-theme-minimal theme, the jekyll-redirect-from plugin, and GitHub Pages for hosting, with no server-side code or database.
redirect_to points at the target.permalink: /:slug/ gives clean paths, and per-page permalink values such as /😻/ make ultra-short memorable URLs.main branch, root folder, with optional custom domain and enforced HTTPS.google_analytics in _config.yml injects the gtag.js snippet into the redirect template so short-link traffic can be tracked.bundle exec jekyll serve./😻/ to make URLs easy to type and remember._config.yml with your own title, description, logo, and optional Google Analytics ID.main branch at the root, and add the custom domain to create a CNAME file..md or .html page to the repo root with the front matter redirect_to set to the destination URL; push and the short link goes live.The template is free and open source. Hosting on GitHub Pages is free for public repositories, and enforcing HTTPS costs nothing. You only pay for the domain name from a registrar.
Create a file with .md or .html extension in the root of the repository. Add front matter containing redirect_to with the target URL and an optional title. Commit and push; the default permalink: /:slug/ setting turns the file name into the short path.
The jekyll-redirect-from plugin builds a small redirect page that includes a canonical link, a meta refresh set to zero seconds, a JavaScript location redirect, and a fallback link. The page also carries a noindex robots meta tag so it does not appear in search results.
Yes. Configure an apex domain with DNS A records at 185.199.108.153, 185.199.109.153, 185.199.110.153, and 185.199.111.153, then enter the domain under GitHub Pages settings. GitHub writes it to a CNAME file and lets you enforce HTTPS.
You need Ruby, Bundler, and Jekyll, or you can open the repository in Visual Studio Code with Docker and use the included devcontainer, which installs the dependencies. GitHub Codespaces also picks up the devcontainer. Then run bundle exec jekyll serve and browse to localhost:4000.
