Skip to content

djyde/genlink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Generate redirect link (in static way)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published