Author: Doug Hellmann <doug@doughellmann.com>
templates: always call repository name RepoName Different templates were given the repository name using different names. Use `RepoName` for consistency everywhere. Signed-off-by: Doug Hellmann <doug@doughellmann.com>
include/commit.html | 4 ++-- include/log.html | 4 ++-- include/refs.html | 16 ++++++++-------- include/repo-index.html | 4 ++-- pkg/smithy/smithy.go | 16 ++++++++--------
diff --git a/include/commit.html b/include/commit.html index 6f2c4641f6f49afc8a0c9b868a4b083843d7da04..e2ade393d0e8910055b4d1a9c4e865c5470326b7 100644 --- a/include/commit.html +++ b/include/commit.html @@ -1,8 +1,8 @@ {{ template "header" . }} -{{ $repo := .Name }} +{{ $repo := .RepoName }} -<h1>{{ .Name }}</h1> +<h1>{{ .RepoName }}</h1> <nav class="navbar navbar-expand navbar-light bg-light"> <div class="collapse navbar-collapse" id="navbarNav"> diff --git a/include/log.html b/include/log.html index 6a67bc3dbdb57e201cd56d7573d8ea23928387f0..0b5241f024917f1dd73cb0ae06b4554fd9b313a6 100644 --- a/include/log.html +++ b/include/log.html @@ -1,8 +1,8 @@ {{ template "header" . }} -{{ $repo := .Name }} +{{ $repo := .RepoName }} -<h1>{{ .Name }}</h1> +<h1>{{ .RepoName }}</h1> <nav class="navbar navbar-expand navbar-light bg-light"> <div class="collapse navbar-collapse" id="navbarNav"> diff --git a/include/refs.html b/include/refs.html index 378fd2a0295d98d9f74268526a0f78a562407756..154f3c4395be1aeeeb64b448d43559d3fa087bc1 100644 --- a/include/refs.html +++ b/include/refs.html @@ -1,8 +1,8 @@ {{ template "header" . }} -{{ $repo := .Name }} +{{ $repo := .RepoName }} -<h1>{{ .Name }}</h1> +<h1>{{ .RepoName }}</h1> <nav class="navbar navbar-expand navbar-light bg-light"> <div class="collapse navbar-collapse" id="navbarNav"> @@ -28,9 +28,9 @@ <table class="table"> {{ range .Branches }} <tr> - <td>{{ .Name.Short }}</td> - <td><a href="/{{ $repo }}/log/{{ .Name.Short }}">log</a></td> - <td><a href="/{{ $repo }}/tree/{{ .Name.Short }}">tree</a></td> + <td>{{ .RepoName.Short }}</td> + <td><a href="/{{ $repo }}/log/{{ .RepoName.Short }}">log</a></td> + <td><a href="/{{ $repo }}/tree/{{ .RepoName.Short }}">tree</a></td> </tr> {{ end }} </table> @@ -40,9 +40,9 @@ <table class="table"> {{ range .Tags }} <tr> - <td>{{ .Name.Short }}</td> - <td><a href="/{{ $repo }}/log/{{ .Name.Short }}">log</a></td> - <td><a href="/{{ $repo }}/tree/{{ .Name.Short }}">tree</a></td> + <td>{{ .RepoName.Short }}</td> + <td><a href="/{{ $repo }}/log/{{ .RepoName.Short }}">log</a></td> + <td><a href="/{{ $repo }}/tree/{{ .RepoName.Short }}">tree</a></td> </tr> {{ end }} </table> diff --git a/include/repo-index.html b/include/repo-index.html index 089cd9169dd91d5ede3a7cd01e5054ee8b9921d1..d638267c3710864a6847b6e9d260eaa5e0cfb197 100644 --- a/include/repo-index.html +++ b/include/repo-index.html @@ -1,8 +1,8 @@ {{ template "header" . }} -{{ $repo := .Name }} +{{ $repo := .RepoName }} -<h1>{{ .Name }}</h1> +<h1>{{ .RepoName }}</h1> <nav class="navbar navbar-expand navbar-light bg-light"> <div class="collapse navbar-collapse" id="navbarNav"> diff --git a/pkg/smithy/smithy.go b/pkg/smithy/smithy.go index 7356c4de1d3013d630e123f0c00a9402fb9d9714..c59d3d5b522b5902654ba67d8ee9f5cf6a198eae 100644 --- a/pkg/smithy/smithy.go +++ b/pkg/smithy/smithy.go @@ -309,7 +309,7 @@ } } ctx.HTML(http.StatusOK, "repo-index.html", makeTemplateContext(smithyConfig, gin.H{ - "Name": repoName, + "RepoName": repoName, "Branches": bs, "Tags": ts, "Readme": template.HTML(formattedReadme), @@ -359,7 +359,7 @@ ts = []*plumbing.Reference{} } ctx.HTML(http.StatusOK, "refs.html", makeTemplateContext(smithyConfig, gin.H{ - "Name": repoName, + "RepoName": repoName, "Branches": bs, "Tags": ts, })) @@ -553,9 +553,9 @@ commits = append(commits, c) } ctx.HTML(http.StatusOK, "log.html", makeTemplateContext(smithyConfig, gin.H{ - "Name": repoName, - "RefName": refNameString, - "Commits": commits, + "RepoName": repoName, + "RefName": refNameString, + "Commits": commits, })) } @@ -663,9 +663,9 @@ return } ctx.HTML(http.StatusOK, "commit.html", makeTemplateContext(smithyConfig, gin.H{ - "Name": repoName, - "Commit": commitObj, - "Changes": template.HTML(formattedChanges), + "RepoName": repoName, + "Commit": commitObj, + "Changes": template.HTML(formattedChanges), })) }