diff --git a/config.go b/config.go
index 598685e..bea57c7 100644
--- a/config.go
+++ b/config.go
@@ -28,12 +28,16 @@ type repository struct {
func (r repository) Packages() []string {
pkgs := []string{r.Prefix}
- for _, s := range r.Subs {
- pkgs = append(pkgs, path.Join(r.Prefix, s.Name))
+ for i := range r.Subs {
+ pkgs = append(pkgs, r.SubPath(i))
}
return pkgs
}
+func (r repository) SubPath(i int) string {
+ return path.Join(r.Prefix, r.Subs[i].Name)
+}
+
type sub struct {
Name string
Hidden bool
diff --git a/generate_package.go b/generate_package.go
index 85e7ae8..3e0d77e 100644
--- a/generate_package.go
+++ b/generate_package.go
@@ -31,7 +31,7 @@ ul { margin-top: 16px; margin-bottom: 16px; }
Home: {{.HomeURL}}
Source: {{.Repository.URL}}
{{if .Repository.Subs -}}Sub-packages: