genlink

Generate redirect link (in static way)

Usage no npm install needed!

<script type="module">
  import genlink from 'https://cdn.skypack.dev/genlink';
</script>

README

AhO39A.md.png

Generate redirect link (in static way)

Install

$ npm i genlink -g

# or using in project only

$ npm i genlink --save-dev

Usage

// links.json
[
  {
    "name": "my-blog",
    "url": "https://lutaonan.com"
  },
  {
    "name": "my-github",
    "url": "https://github.com/djyde"
  }
]
$ genlink links.json

genlink will read the json file and generate static page at current word directory:

- my-blog
  - index.html
- my-github
  - index.html

When you host in a static server (like localhost:3000), you can access these url like:

http://localhost:3000/my-blog # redirect to https://lutaonan.com
http://localhost:3000/my-github # redirect to https://github.com/djyde

permalink

$ genlink links.json --permalink /click

generate:

- click
  - my-blog
    - index.html
  - my-github
    - index.html

access by:

http://localhost:3000/click/my-blog # redirect to https://lutaonan.com
http://localhost:3000/click/my-github # redirect to https://github.com/djyde

License

MIT License