Skip to content

krishnaiyertech/go-vanity-gen

Repository files navigation

go-vanity-gen

Generates simple html pages for Golang's vanity redirection.

TODO: Add link to blog

Installation

$ go get -u krishnaiyer.tech/golang/go-vanity-gen@<version>

Options

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

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

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Display version information

Flags:
  -h, --help         help for go-vanity-gen
  -i, --in string    directory where input files. Must contain index.tmpl, project.tmpl and vanity.yml
  -o, --out string   directory where output files are generated. Default is ./gen

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

Usage

  1. Install
$ go install krishnaiyer.tech/golang/go-vanity-gen
  1. Generate
$ go-vanity-gen -i sample -o gen

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

This project is licensed as-is under the Apache 2.0 license.

About

Small tool to generate static assets for Golang's vanity redirection

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published