diff --git a/README.md b/README.md index f9f8978..a1c20cb 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ The repository `type` and `source` properties will be set automatically when `ur "template" ], "type": "git", + "hidden": false, "url": "https://github.com/leighmcculloch/go-optional", "source": { "home": "https://github.com/leighmcculloch/go-optional", @@ -112,4 +113,3 @@ The repository `type` and `source` properties will be set automatically when `ur ] } ``` - diff --git a/config.go b/config.go index 39edd17..598685e 100644 --- a/config.go +++ b/config.go @@ -21,6 +21,7 @@ type repository struct { Type string `json:"type"` URL string `json:"url"` Main bool `json:"main"` + Hidden bool `json:"hidden"` SourceURLs sourceURLs `json:"source"` Website website `json:"website"` } diff --git a/generate_index.go b/generate_index.go index 9ea1300..34e4091 100644 --- a/generate_index.go +++ b/generate_index.go @@ -39,14 +39,14 @@ body { margin-top: 0; }

Libraries:


diff --git a/generate_index_test.go b/generate_index_test.go index 78fda63..ca86bad 100644 --- a/generate_index_test.go +++ b/generate_index_test.go @@ -28,6 +28,10 @@ func TestGenerateIndex(t *testing.T) { Prefix: "pkg2", Subs: []sub{{Name: "subpkg1"}, {Name: "subpkg2/subsubpkg1"}}, }, + { + Prefix: "pkg3", + Hidden: true, + }, }, expectedOut: ` diff --git a/generate_package_test.go b/generate_package_test.go index 19ad533..17067cc 100644 --- a/generate_package_test.go +++ b/generate_package_test.go @@ -52,6 +52,45 @@ Home: https://godoc.org/example.com Source: https://repositoryhost.com/example/go-pkg1
Sub-packages: +`, + expectedErr: nil, + }, + { + description: "hidden", + domain: "example.com", + docsDomain: "godoc.org", + pkg: "pkg1", + r: repository{ + Prefix: "pkg1", + Hidden: true, + Subs: []sub{{Name: "subpkg1"}, {Name: "subpkg2"}}, + Type: "git", + URL: "https://repositoryhost.com/example/go-pkg1", + }, + expectedOut: ` + + + +example.com/pkg1 + + + + + +
+

example.com/pkg1

+go get example.com/pkg1 +import "example.com/pkg1" +Home: https://godoc.org/example.com/pkg1
+Source: https://repositoryhost.com/example/go-pkg1
+Sub-packages:
+ `, expectedErr: nil, },