Skip to content

KrishnaIyer/go-vanity-gen

Repository files navigation

Go Vanity Generator

Generates simple html pages for Go Vanity redirection.

Status Checks

Installation

$ go get -u go.krishnaiyer.dev/go-vanity-gen

Options

go-vanity generates vanity assets from templates. Templates are usually simple html files that contain links to repositories

Usage:
  go-vanity [flags]
  go-vanity [command]

Available Commands:
  config      Display raw config values
  help        Help about any command
  version     Display version information

Flags:
  -d, --debug                     print detailed logs for errors
  -f, --file string               file containing vanity redirection paths (yml)
  -h, --help                      help for go-vanity
  -o, --out-path string           directory where output files are generated. Default is ./gen
  -i, --template.index string     path to html template for the index
  -p, --template.project string   path to html template for projects

Use "go-vanity [command] --help" for more information about a command.

Usage

  1. Install
$ go install go.krishnaiyer.dev/go-vanity-gen
  1. Generate
$ go-vanity-gen -i sample/index.tmpl -p sample/project.tmpl -f ./vanity.yml

Development

The following are the prerequisites;

  • Go installed and configured.
  • [optional] Custom HTML templates.
  1. Clone this repository.
  2. Initialize
$ make init
  1. Build from source
$ GVG_PACKAGE=<your-path>/go-vanity-gen GVG_VERSION=<version> make build.local
  1. Run tests
$ make test
  1. Clean up
$ make clean

Limitations

  • Since we're building static assets, each package that need redirection needs an index.html. This does result in a lot of duplication. But since each file is very small, the cost of storing these files is much lower than running a server to serve these paths.
  • Package paths need to be manually listed. In the root of each of your repositories, use the following command.
$ go list ./...

Releases

Please check the changelog for release history.

License

The contents of this repository are provided "as-is" under the terms of the Apache 2.0 License.

About

Generates simple html pages for Go Vanity redirection.

Resources

License

Stars

Watchers

Forks

Packages

No packages published