all repos — gopkgs @ 21197d6c1b5eab893c214ce58909c3fc77d24afc

Go module vanity import paths

switch to yaml

Alan Pearce
commit

21197d6c1b5eab893c214ce58909c3fc77d24afc

parent

4fb845fad305b08c682e6f61d3764ef3df7d16db

5 files changed, 25 insertions(+), 28 deletions(-)

changed files
M go.modgo.mod
@@ -4,6 +4,6 @@ go 1.23
toolchain go1.23.5 -require github.com/pelletier/go-toml/v2 v2.2.3 +require gopkg.in/yaml.v3 v3.0.1 require go.alanpearce.eu/gomponents v1.4.0 // direct
M go.sumgo.sum
@@ -1,12 +1,6 @@
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.alanpearce.eu/gomponents v1.4.0 h1:Ibvoce+U0rnPKlDOE+wXDbNniNQL8mYO667+qS5J1Go= go.alanpearce.eu/gomponents v1.4.0/go.mod h1:WxD+6FRSvwThQOzV0r6zPAA9CRb41lutUZMSC7r6BRc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
M main.gomain.go
@@ -7,8 +7,8 @@ "net/url"
"os" "path/filepath" - "github.com/pelletier/go-toml/v2" "go.alanpearce.eu/gomponents" + "gopkg.in/yaml.v3" ) type Config struct {
@@ -71,7 +71,7 @@ if err != nil {
return nil, err } defer file.Close() - dec := toml.NewDecoder(file) + dec := yaml.NewDecoder(file) err = dec.Decode(cfg) if err != nil { return nil, err
@@ -98,8 +98,10 @@ return c.Render(file)
} func main() { - cfg, err := getConfig("vanity.toml") + cfg, err := getConfig("vanity.yaml") fatal(err) + + log.Println(cfg) err = renderToFile( ListPage(cfg),
D vanity.toml
@@ -1,16 +0,0 @@
-title = "Alan's go packages" -domain = "go.alanpearce.eu" -forge = "https://git.alanpearce.eu" -packages = ["website", "searchix", "x", "homestead", "gomponents", "elgit"] - -[[menu]] -name = "Website" -URL = "https://alanpearce.eu" - -[[menu]] -name = "Go Packages" -URL = "https://go.alanpearce.eu" - -[[menu]] -name = "Repositories" -URL = "https://git.alanpearce.eu"
A vanity.yaml
@@ -0,0 +1,17 @@
+title: Alan's go packages +domain: go.alanpearce.eu +forge: https://git.alanpearce.eu +packages: + - website + - searchix + - x + - homestead + - gomponents + - elgit +menu: + - name: Website + url: https://alanpearce.eu + - name: Go Packages + url: https://go.alanpearce.eu + - name: Repositories + url: https://git.alanpearce.eu