content/static/html/helpers: fix links header

At the moment the "Links" header is always displayed. It should only be
displayed if there are links.

Change-Id: I212083e1b1b4a085b6a5511348fdd0c88a491929
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278757
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/content/static/html/helpers/_unit_meta.tmpl b/content/static/html/helpers/_unit_meta.tmpl
index 11f7809..73a8c5c 100644
--- a/content/static/html/helpers/_unit_meta.tmpl
+++ b/content/static/html/helpers/_unit_meta.tmpl
@@ -17,7 +17,9 @@
     {{else}}
       Repository URL not available.
     {{end}}
-    <div class="UnitMeta-header">Links</div>
+    {{if or .Details.ReadmeLinks .Details.DocLinks .Details.ModuleReadmeLinks}}
+      <div class="UnitMeta-header">Links</div>
+    {{end}}
     {{template "unit_meta_links" .Details.ReadmeLinks}}
     {{template "unit_meta_links" .Details.DocLinks}}
     {{template "unit_meta_links" .Details.ModuleReadmeLinks}}