diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index ae32c3fed5..77f2362f8e 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -83,7 +83,10 @@
{{if .Permission.CanRead $.UnitTypeIssues}}
- {{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}} {{CountFmt .Repository.NumOpenIssues}}
+ {{svg "octicon-issue-opened"}} {{.i18n.Tr "repo.issues"}}
+ {{if .Repository.NumOpenIssues}}
+ {{CountFmt .Repository.NumOpenIssues}}
+ {{end}}
{{end}}
@@ -95,22 +98,28 @@
{{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
- {{svg "octicon-git-pull-request"}} {{.i18n.Tr "repo.pulls"}} {{CountFmt .Repository.NumOpenPulls}}
+ {{svg "octicon-git-pull-request"}} {{.i18n.Tr "repo.pulls"}}
+ {{if .Repository.NumOpenPulls}}
+ {{CountFmt .Repository.NumOpenPulls}}
+ {{end}}
{{end}}
{{ if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}}
{{svg "octicon-project"}} {{.i18n.Tr "repo.project_board"}}
-
- {{CountFmt .Repository.NumOpenProjects}}
-
+ {{if .Repository.NumOpenProjects}}
+ {{CountFmt .Repository.NumOpenProjects}}
+ {{end}}
{{ end }}
{{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsEmptyRepo) }}
- {{svg "octicon-tag"}} {{.i18n.Tr "repo.releases"}} {{CountFmt .NumReleases}}
+ {{svg "octicon-tag"}} {{.i18n.Tr "repo.releases"}}
+ {{if .NumReleases}}
+ {{CountFmt .NumReleases}}
+ {{end}}
{{end}}