Important
vangen has been migrated to codeberg.org/xrstf/vangen.
Vangen is a tool for generating static HTML for Go vanity import paths.
Go vanity import paths work by serving a HTML file that tells the go get tool where to download the
source from. You can still host the source code at Github, BitBucket, but the vanity URL gives you
portability and other benefits.
- Maintain Go vanity import paths with a simple definition file
vangen.yaml. - Host Go vanity import paths using static hosting. No need for Google AppEngine, Heroku, etc. Host the files on Github Pages, AWS S3, Google Cloud Storage, etc.
- Use YAML instead of JSON for configuration.
- Add pico.css to make the generated HTML a bit nicer and add dark mode.
- Rename "sub packages" to "sub modules", which is more clear IMHO.
Download one of the precompiled releases, use the ready-made
container image ghcr.io/xrstf/vangen or install from source:
go get go.xrstf.de/vangen- Create a
vangen.yaml(see examples below) - Run
vangen - Host the files outputted in
vangen/at your domain - Try it out with
go get [domain]/[package]
$ vangen --help
Usage of _build/vangen:
-c, --config filename vangen JSON/YAML configuration filename (default "vangen.yaml")
-o, --output directory output directory that static files will be written to (default "vangen")
-V, --version print program versionThe repository type and source properties will be set automatically when url begins with
https://github.com or https://gitlab.com. Below is a minimal config for a project hosted on
GitHub.
domain: go.xrstf.de
repositories:
- prefix: optional
url: https://github.com/leighmcculloch/go-optional
subs:
- name: template