Skip to content

Commit ef1cfc5

Browse files
committed
static/frontend/unit/main: disable source file links without urls
Fixes golang/go#73333 Change-Id: Iccf2645d901eb0214f6b7f21d03a553518575c63 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/671815 LUCI-TryBot-Result: Go LUCI <[email protected]> kokoro-CI: kokoro <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent e476b3e commit ef1cfc5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

static/frontend/unit/main/_files.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@
1111
Source Files
1212
<a class="UnitFiles-idLink" href="#section-sourcefiles" title="Go to Source Files" aria-label="Go to Source Files">¶</a>
1313
</h2>
14+
{{- if .SourceURL -}}
1415
<div class="UnitFiles-titleLink">
1516
<a href="{{.SourceURL}}" target="_blank" rel="noopener">View all Source files</a>
1617
</div>
18+
{{- end -}}
1719
<div>
1820
<ul class="UnitFiles-fileList">
1921
{{- range .SourceFiles -}}
2022
<li>
23+
{{- if .URL -}}
2124
<a href="{{.URL}}" target="_blank" rel="noopener" title="{{.Name}}">{{.Name}}</a>
25+
{{- else -}}
26+
{{.Name}}
27+
{{- end -}}
2228
</li>
2329
{{- end -}}
2430
</ul>

0 commit comments

Comments
 (0)