GithubHelp home page GithubHelp logo

covid.dev's Introduction

g1y: 1y with other features ๐Ÿ˜…

What is this?

g1y 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".

Also included are /notes (like blog posts), /messages with background images, and /holidays like /messagesbut for holidays and special occasions

How does it work?

g1y 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 pluto.md you'll find in this template repository is used to create the https://<your-short-domain>/pluto short URL.
  • the long URL is stored in the file's Front Matter, for example here the pluto.md file only contains these 3 lines:
    ---
    url: https://en.wikipedia.org/wiki/Pluto
    ---

So for this example, when you go to https://<your-short-domain>/pluto, it redirects you to https://en.wikipedia.org/wiki/Pluto.

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.

README.md as blog

Using the github.com or gitea self-hosted git repository, the README.md can also serve as the blog.

A script (bin/ar-multi-readme.sh) is included to add any notes using the relative url shortcut eg, your-post which points to a note eg, /notes/2021-01-20-your-post.md and prepends the note(s) to README.md, which makes the github or gitea repo url a (poor man's) blog, with links to each of the included posts in the repo.

# prepend your-post, another-post, yet-another-post notes 
# to README.md and blog.md files which reside in repo root
# (although could be /another_dir/blog.md)
bin/ar-multi-readme.sh your-post,another-post,yet-another-post README.md,blog.md 

Eventually will need a way to trim / cull the README.md

Credits

Modified from https://github.com/nhoizey/1y

Kudos to 1y

License

MIT

Copyright (c) 2021-present

covid.dev's People

Contributors

nhoizey avatar

Watchers

James Cloos 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.