Simple tool that takes a YAML based config and generates a set of static HTML files that can be used for vanity URLs.
Find a file
2024-10-08 09:21:35 +02:00
.github Create FUNDING.yml 2024-10-08 09:21:35 +02:00
templates Fix source button's link to github 2024-02-17 01:09:37 +01:00
.gitignore Add vanity-builder to .gitignore 2024-02-16 01:33:29 +01:00
go.mod Initial version 2024-02-16 01:21:53 +01:00
go.sum Initial version 2024-02-16 01:21:53 +01:00
LICENSE Initial version 2024-02-16 01:21:53 +01:00
main.go Initial version 2024-02-16 01:21:53 +01:00
packages.yaml-example Initial version 2024-02-16 01:21:53 +01:00
README.md Update Codacy link 2024-02-19 16:48:24 +01:00

GitHub go.mod Go version Codacy grade Go Report Card Liberapay patrons ko-fi

vanity-builder

Simple tool that takes a YAML based config and generates a set of static HTML files based on Go templates that can be used for vanity URL self-hosting.

Example

Use code.vanderkleijn.net instead of github.com for your modules.

Why?

  • No renaming issues when (for whatever reason) you're moving away from Github to somewhere else;
  • Code can still be hosted on Github (or other places);

In other words: similar to gopkg.in but easily self-hostable.

Development notes

go-import: <vanityDomain>/<moduleName> git https://github.com/<user or org>/<repo>.git

go-source: content="<prefix> <homepage> <directory template> <file template>" Where:

  • prefix: <vanityDomain>/<moduleName>
    • The import path corresponding to the repo root
    • <moduleName> can include major version, e.g. moduleName or moduleName/v2
  • homepage: <homepageURL>
    • The url of the repo's homepage
    • The '_' character can be used to signify the absence of a homepage
  • directory template: https://github.com/<user or org>/<repo>/tree/<branch>{/dir}
    • An template used to create the URL for listing the files in the module
  • file template: https://github.com/<user or org>/<repo>/blob/<branch>{/dir}/{file}#L{line}
    • An template used to create the url that points to a line in a file