From 6153db5bf650f8f10bc52543433866129d1d4991 Mon Sep 17 00:00:00 2001 From: Aaron Crickenberger Date: Mon, 8 Mar 2021 00:41:42 -0500 Subject: 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 --- generator/app.go | 1 + generator/committee_readme.tmpl | 2 +- generator/sig_readme.tmpl | 2 +- 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:** -- cgit v1.2.3