content/static: truncate repository URL
Truncates the repository URL and shows full URL
tooltip on over.
Change-Id: I98bcdf6c11da57b546ca4dbd30cf4f087f4e7e28
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258218
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/content/static/css/unit_meta.css b/content/static/css/unit_meta.css
index 9fee115..92e94d8 100644
--- a/content/static/css/unit_meta.css
+++ b/content/static/css/unit_meta.css
@@ -6,10 +6,16 @@
.UnitMeta {
display: block;
- overflow-wrap: break-word;
position: sticky;
top: 5rem;
}
+.UnitMeta a {
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 100%;
+}
.UnitMeta-header {
font-weight: bold;
margin: 1.125rem 0;
diff --git a/content/static/html/helpers/_unit_meta.tmpl b/content/static/html/helpers/_unit_meta.tmpl
index f86e168..ac3ecf6 100644
--- a/content/static/html/helpers/_unit_meta.tmpl
+++ b/content/static/html/helpers/_unit_meta.tmpl
@@ -8,6 +8,8 @@
<div class="UnitMeta">
<div class="UnitMeta-header">Links</div>
<div class="UnitMeta-repo">Repository</div>
- <a href="{{.Unit.SourceInfo.RepoURL}}">{{.Unit.SourceInfo.RepoURL}}</a>
+ <a href="{{.Unit.SourceInfo.RepoURL}}" title="{{.Unit.SourceInfo.RepoURL}}">
+ {{.Unit.SourceInfo.RepoURL}}
+ </a>
</div>
{{end}}