GithubHelp home page GithubHelp logo

s-c.sh's Introduction

s-c.sh

The styled-components link shortener, based on netlify-shortener.

Adding a new short link

All you have to do to add a new short link is to edit the _redirects file and add your redirect at the very top in the format /<short> https://link.com. For example:

/medium     https://medium.com/styled-components
/css-prop   https://medium.com/styled-components/announcing-native-support-for-the-css-prop-in-styled-components-245ca5252feb

Now s-c.sh/medium will redirect to the styled-components Medium publication, and s-c.sh/css-prop to the CSS prop announcement post!

๐ŸŽ‰ ๐ŸŽ‰ ๐ŸŽ‰

From the command line

You can also use the netlify-shortener CLI locally to add new short links, which will make sure the _redirects file is in the right format. To do so, you need to set up this repository locally:

  1. Clone the repo with git clone [email protected]:styled-components/s-c.sh
  2. Install the dependencies with npm install (or yarn)

Once you have the repo set up locally, you simply have to run one command to add a new shortcode:

npm run shorten <url> <slug>

# for example
npm run shorten https://styled-components.com/docs d # s-c.sh/d will redirect to the docs now

Note that you need to have write access to the repository for this to work. If that is not the case, you'll need to fork the repo first and push to your fork before submitting a PR.

How does it work?

Redirects are added to the _redirects file, which is deployed to Netlify and handled by them. The master branch in this repo is always in sync with s-c.sh!

License

This whole repository is licensed under the MIT license.

s-c.sh's People

Contributors

lucleray avatar mxstbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.