All Projects → brunoluiz → urlzap

brunoluiz / urlzap

Licence: MIT license
⚡️ Your own static URL shortener

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to urlzap

hyperdraft
Turn your notes into a website.
Stars: ✭ 59 (+3.51%)
Mutual labels:  static-site-generator, static-site, static-website
hugo-initio
Hugo Theme port of Initio bootstrap template by GetTemplate
Stars: ✭ 58 (+1.75%)
Mutual labels:  static-site-generator, static-site, static-website
Gh Pages Url Shortener
Minimal URL shortener that can be entirely hosted on GitHub pages.
Stars: ✭ 924 (+1521.05%)
Mutual labels:  github-page, self-hosted, url-shortener
Bon
🍮 A small, simple/minimal self hosted URL shortener written in Go (Golang).
Stars: ✭ 12 (-78.95%)
Mutual labels:  self-hosted, url-shortener, link-shortener
redir
🧭 Full-featured, self-hosted URL shortener.
Stars: ✭ 61 (+7.02%)
Mutual labels:  url-shortener, link-shortener, redirect-urls
tinystatic
A tiny static website generator which is flexible and easy to use
Stars: ✭ 36 (-36.84%)
Mutual labels:  static-site-generator, static-site, static-website
YOURLS
🔗 The de facto standard self hosted URL shortener in PHP
Stars: ✭ 9,007 (+15701.75%)
Mutual labels:  url-shortener, shortener, shorten-urls
Publiccms
现代化java cms,由天津黑核科技有限公司开发,轻松支撑千万数据、千万PV;支持静态化,服务器端包含; 目前已经拥有全球0.0002%的用户,语言支持中、繁、日、英;是一个已走向海外的成熟CMS产品
Stars: ✭ 1,750 (+2970.18%)
Mutual labels:  static-site-generator, static-site, static-website
gShort
URL Shortener without all the crap
Stars: ✭ 80 (+40.35%)
Mutual labels:  url-shortener, shortener, shorten-urls
stacy
Website generator that combines content from Contentful CMS with Handlebars templates and publishes the website in Amazon S3.
Stars: ✭ 24 (-57.89%)
Mutual labels:  static-site-generator, static-site, static-website
Publii
Publii is a desktop-based CMS for Windows, Mac and Linux that makes creating static websites fast and hassle-free, even for beginners.
Stars: ✭ 3,644 (+6292.98%)
Mutual labels:  static-site-generator, static-site, static-website
ursho
URL Shortener Service in Go
Stars: ✭ 118 (+107.02%)
Mutual labels:  url-shortener, shortener, shorten-urls
readme-in-static-site
💎 Transform and insert your GitHub readme in your static site.
Stars: ✭ 24 (-57.89%)
Mutual labels:  static-site-generator, static-site
Quokka
LOOKING FOR NEW MAINTAINER - Quokka is a Content Management System - `docker run --rm -it -p 5000:5000 quokka/quokka`
Stars: ✭ 2,198 (+3756.14%)
Mutual labels:  static-site-generator, static-site
Jekyll Doc Theme
Jekyll theme for creating project documentation websites
Stars: ✭ 203 (+256.14%)
Mutual labels:  static-site-generator, static-site
Elegant
Best theme for Pelican Static Blog Generator
Stars: ✭ 241 (+322.81%)
Mutual labels:  static-site-generator, static-site
Gatsby Docker
Develop & Build GatsbyJS static sites within Docker.
Stars: ✭ 184 (+222.81%)
Mutual labels:  static-site-generator, static-site
Peco
nothing here, move on..
Stars: ✭ 213 (+273.68%)
Mutual labels:  static-site-generator, static-site
Statiq.framework
A flexible and extensible static content generation framework for .NET.
Stars: ✭ 251 (+340.35%)
Mutual labels:  static-site-generator, static-site
ksana.in
✂️ Layanan pemendek tautan yang mudah, gratis & tanpa iklan
Stars: ✭ 186 (+226.32%)
Mutual labels:  url-shortener, shortener

URLZap

Your own static URL shortener ⚡️

Static site generators, published on Github Pages, are quite popular nowadays. But what about a static URL shortener (to not say generator), which allows you to redirect URLs based on static files?

Usually, developers end-up setting up a server with redirects for this (not statically). That is where URLZap comes in. It generates URLs using files and HTML wizardry, allowing users to host their own URL redirects into Github Pages.

  • 🔗 Similar to static website generators, but for URLs
  • 🔒 Keep your (shortened or not) URLs with you
  • 🌎 Can be used with Github Pages
  • ☕️ No need to run a server or set-up HTTP 301 redirects

Example project: brunoluiz/_

☕️ How does it work?

You might be asking yourself: how is this done without a server? Well, the answer lies on <meta http-equiv="refresh" />. It works as HTTP 301 (Redirect) status code, but it is done in the client-side. There is a bit more explanation on w3c website.

Based on a config.yml containing the desired path and URL, urlzap will create index.html files which make use of meta refresh tags. It is not perfect as a HTTP 301, but is quite close. A similar strategy is used by other static website generators, such as Hugo.

An example would be:

path: './links' # default is './'
urls:
  google: https://google.com
  tools:
    github: https://github.com

Each key in the map will map to {.path param}/{key} routes, redirecting to {value}. This would generate the following:

- links/
  - google/
    - index.html (contains redirect)
  - tools/
    - github/
      - index.html (contains redirect)

These files can be uploaded to Github Pages for example, not requiring any server. On brunoluiz/_ you can see an example config.yml and checkout the output in gh-pages branch 😉

📀 Install

Linux and Windows

Check the releases section for more information details

MacOS

Use brew to install it

brew tap brunoluiz/tap
brew install urlzap

⚙️ Usage

Generate files locally

Using the previous YAML example:

path: './links' # default is './'
urls:
  google: https://google.com
  tools:
    github: https://github.com
  • urls: desired URL map, following the {key}:{redirect URL} pattern
  • path: output path

To generate the static files, run urlzap generate.

Automatic deploy using Github Actions

Most likely you will end-up using Github Pages together with this tool. If so, perhaps the best way to use it and reap its benefits is through Github Actions. Head to brunoluiz/urlzap-github-action for more details on how to install it, covering generation & deployment.

⚠️ You might need to manually enable Github Pages in your repository! More details at Github Pages guide

Manual deploy to Github Pages or similars

If Github Actions are not for you, try the following manual process instead.

  1. Enable Github Pages and set-up the branch where your static HTML files will be located. More details at Github Pages guide
  2. Set-up your config.yml
  3. Commit and push to main
  4. Checkout to your Github Pages branch (usually gh-pages) and run git reset --hard origin/main (this will reset the HEAD to master)
  5. Run urlzap generate
  6. Commit and push

The following script follows what is described on the steps above:

#!/bin/bash

# adds, commit and push your changes
git add config.yml
git commit -m 'chore: update config.yml'
git push -u origin main

# make gh-pages branch to be the same as main
git checkout gh-pages
git reset --hard origin/main

# generate files
urlzap generate

# add, commit and push generated files
git add --all
git commit -m 'chore: update HTML files'
git push -u origin gh-pages --force
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].