web frontend for git (tangled's grandpa)
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

git: add unlisted repositories

authored by

Marco Andronaco and committed by
GitHub
4447fcda c75aa9f5

+16 -7
+1
config/config.go
··· 14 14 Readme []string `yaml:"readme"` 15 15 MainBranch []string `yaml:"mainBranch"` 16 16 Ignore []string `yaml:"ignore,omitempty"` 17 + Unlisted []string `yaml:"unlisted,omitempty"` 17 18 } `yaml:"repo"` 18 19 Dirs struct { 19 20 Templates string `yaml:"templates"`
+1
readme
··· 61 61 • repo.readme: readme files to look for. 62 62 • repo.mainBranch: main branch names to look for. 63 63 • repo.ignore: repos to ignore, relative to scanPath. 64 + • repo.unlisted: repos to hide, relative to scanPath. 64 65 • server.name: used for go-import meta tags and clone URLs. 65 66 66 67
+4 -7
routes/routes.go
··· 40 40 infos := []info{} 41 41 42 42 for _, dir := range dirs { 43 - if !dir.IsDir() || d.isIgnored(dir.Name()) { 43 + name := dir.Name() 44 + if !dir.IsDir() || d.isIgnored(name) || d.isUnlisted(name) { 44 45 continue 45 46 } 46 47 47 - path := filepath.Join(d.c.Repo.ScanPath, dir.Name()) 48 + path := filepath.Join(d.c.Repo.ScanPath, name) 48 49 gr, err := git.Open(path, "") 49 50 if err != nil { 50 51 log.Println(err) ··· 58 59 return 59 60 } 60 61 61 - name := dir.Name() 62 - 63 - desc := getDescription(path) 64 - 65 62 infos = append(infos, info{ 66 63 DisplayName: getDisplayName(name), 67 64 Name: name, 68 - Desc: desc, 65 + Desc: getDescription(path), 69 66 Idle: humanize.Time(c.Author.When), 70 67 d: c.Author.When, 71 68 })
+10
routes/util.go
··· 30 30 return 31 31 } 32 32 33 + func (d *deps) isUnlisted(name string) bool { 34 + for _, i := range d.c.Repo.Unlisted { 35 + if name == i { 36 + return true 37 + } 38 + } 39 + 40 + return false 41 + } 42 + 33 43 func (d *deps) isIgnored(name string) bool { 34 44 for _, i := range d.c.Repo.Ignore { 35 45 if name == i {