summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Crickenberger <spiffxp@gmail.com>2021-03-08 00:41:42 -0500
committerAaron Crickenberger <spiffxp@google.com>2021-03-09 14:12:03 -0500
commit6153db5bf650f8f10bc52543433866129d1d4991 (patch)
treeca08bd94fd2a125834f48aa9cd0f7f8577f66636
parent34684158e963b01c8aca5728d0e33549fc926586 (diff)
generator: make subproject owners links useful
reduce the visual noise, and make the links go to githubs UI so: https://raw.githubusercontent.com/org/repo/branch/path/to/OWNERS becomes: - link text: org/repo/path/to - link target: https://github.com/org/repo/blob/branch/path/to/ORWNERS note: this does assume/imply we don't need to model the complexity of subprojects owning different branches... but, we haven't found a reason to do so in 5 years, seems a safe assumption
-rw-r--r--generator/app.go1
-rw-r--r--generator/committee_readme.tmpl2
-rw-r--r--generator/sig_readme.tmpl2
3 files changed, 3 insertions, 2 deletions
diff --git a/generator/app.go b/generator/app.go
index c9e3f85b..31a1322a 100644
--- a/generator/app.go
+++ b/generator/app.go
@@ -374,6 +374,7 @@ func getExistingContent(path string, fileFormat string) (string, error) {
var funcMap = template.FuncMap{
"tzUrlEncode": tzURLEncode,
"trimSpace": strings.TrimSpace,
+ "trimSuffix": strings.TrimSuffix,
"githubURL": githubURL,
"orgRepoPath": orgRepoPath,
}
diff --git a/generator/committee_readme.tmpl b/generator/committee_readme.tmpl
index 23eb0137..e72836b4 100644
--- a/generator/committee_readme.tmpl
+++ b/generator/committee_readme.tmpl
@@ -66,7 +66,7 @@ The following [subprojects][subproject-definition] are owned by the {{.Name}} Co
{{- end }}
- **Owners:**
{{- range .Owners }}
- - {{.}}
+ - [{{trimSuffix (orgRepoPath .) "/OWNERS"}}]({{githubURL .}})
{{- end }}
{{- if .Contact }}
- **Contact:**
diff --git a/generator/sig_readme.tmpl b/generator/sig_readme.tmpl
index 58c1b7b3..62dcc9f1 100644
--- a/generator/sig_readme.tmpl
+++ b/generator/sig_readme.tmpl
@@ -76,7 +76,7 @@ The following [subprojects][subproject-definition] are owned by sig-{{.Label}}:
{{- end }}
- **Owners:**
{{- range .Owners }}
- - {{.}}
+ - [{{trimSuffix (orgRepoPath .) "/OWNERS"}}]({{githubURL .}})
{{- end }}
{{- if .Contact }}
- **Contact:**