Giter Site home page Giter Site logo

1y's Introduction

1y: taking the 1t out of 11ty ๐Ÿ˜…

What is this?

1y is a short URL manager built with Eleventy (a.k.a. 11ty), the great JavaScript/Node based Static Site Generator.

This is not a URL "shortener", as it doesn't process anything. Short and long versions of URLs are managed manually, so that short URLs can be "beautiful".

How does it work?

1y generates redirection rules from your set of data, each URL being stored in a Markdown file:

  • the fileSlug of the Markdown file (the filename without the extension in 11ty language) is the short URL. For example, the Markdown file nho.md you'll find in this template repository is used to create the https://<your-short-domain>/nho short URL.
  • the long URL is stored in the file's Front Matter, for example here the nho.md file only contains these 3 lines:
    ---
    url: https://nicolas-hoizey.com/
    ---

So for this example, when you go to https://<your-short-domain>/nho, it redirects you to https://nicolas-hoizey.com/.

Redirection rules are generated in 4 formats to ease usage on different environments:

You don't have to deal with any settings to chose which one to use, all 4 formats are generated at once.

What do I have to do to use it?

This repository is intended to be used as a template for creating your own repository.

The easiest: use Netlify Deploy Button

Deploy to Netlify

Clicking the button above will:

  • create a new repository in your own GitHub account with 1y code
  • and deploy a copy of this new repository to your Netlify account (you can create an account during this process if you don't have one).

Each time you push changes to your Github repository (or add files directly with Github's Web interface), Netlify will build the new redirection files.

If you want to use another hosting service: use the Github template

  1. Click the Use this template green button in Github interface to create your own 1y repository in your Github account
  2. Clone or download the new repository to your local computer
  3. (optional) If you don't have npm yet, install npm
  4. Install y1 dependencies with npm install
  5. Add new short URLs as Markdown files in the urls/ folder
  6. Generate the redirection files with this command: npm run build

Generated files to deploy are in the _site folder.

Contribution

You are welcome and encouraged to make changes to this website by submitting pull requests!

License

MIT

Copyright (c) 2020-present, Nicolas Hoizey

1y's People

Contributors

nhoizey avatar

Watchers

 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.