Git Product home page Git Product logo

url's Introduction

๐Ÿ”— GitHub Pages URL Shortener

Demo

  1. To add a new short link, add an issue with the title being the link you want to shorten (including the http(s)://) to https://github.com/SamirPaulb/url/issues.

  2. The newly created short url can be accessed via samirpaul.in/url/{issue_number}


How can you use this with your own domain?

  1. Fork the repo before cloning your fork.
  2. Set up GitHub pages for your forked repo.
    1. In your forked repo, click the Settings tab and scroll down to the GitHub Pages section.
    2. Then select the main branch source and click on the Save button.
    3. How to create GitHub page
  3. If you are using your own domain:
    1. Set your domain up for GitHub pages.
    2. Change the URL in CNAME file to your domain.
  4. If you are using GitHub page's default domain i.e. Something like https://<username>.github.io/<repo-name>/
    1. Delete the CNAME file.
    2. Change var PATH_SEGMENTS_TO_SKIP = 0; at the top of 404.html to var PATH_SEGMENTS_TO_SKIP = 1;.
      1. This is as GitHub domains have an additional path segment (the repo name) after the host name.
  5. Create a new repo as a database. (Or you could use your forked repo)
    1. Update var GITHUB_ISSUES_LINK = "<your-github-issues-link>"; at the top of 404.html accordingly afterwards.
      1. Format for GITHUB_ISSUES_LINK: https://api.github.com/repos/{owner}/{repo}/issues/
      2. Remember the trailing /!
  6. Push your changes to your forked repo, and your low cost and cool as heck URL shortener will be ready for use!

url's People

Contributors

nelsontky avatar olekenneth avatar samirpaulb avatar eexit avatar mayandev avatar fredster33 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.