Skip to content

Commit

Permalink
godoc/static: add gopher/pkg.png image
Browse files Browse the repository at this point in the history
Replace the link to the gopher pkg.png from an online location
to a local file.

This will prevent any privacy issue on godoc so that there is no ping anymore to golang.org
when opening private documentation generated by godoc.

Another benefit is that it allows the image to load when godoc is used offline.

Last the img is placed to the upper section.

For golang/go#32011.

Change-Id: I1459bf2613251e3e12404087ea9083b64a4f70c2
GitHub-Last-Rev: c32ef95
GitHub-Pull-Request: golang#315
Reviewed-on: https://go-review.googlesource.com/c/tools/+/313097
Reviewed-by: Dmitri Shuralyov <[email protected]>
Run-TryBot: Dmitri Shuralyov <[email protected]>
gopls-CI: kokoro <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Trust: Cherry Mui <[email protected]>
  • Loading branch information
TomFreudenberg authored and dmitshur committed May 7, 2021
1 parent c0140e8 commit f05e912
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions godoc/static/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var files = []string{
"favicon.ico",
"godoc.html",
"godocs.js",
"gopher/pkg.png",
"images/minus.gif",
"images/plus.gif",
"images/treeview-black-line.gif",
Expand Down
Binary file added godoc/static/gopher/pkg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion godoc/static/packageroot.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<h2 id="pkg-subdirectories">Subdirectories</h2>
{{end}}
<div id="manual-nav">
<img alt="" class="gopher" src="/lib/godoc/gopher/pkg.png"/>
<dl>
<dt><a href="#stdlib">Standard library</a></dt>
{{if hasThirdParty .List }}
Expand All @@ -38,7 +39,6 @@ <h2 class="toggleButton" title="Click to show Standard library section">Standard
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Standard library section">Standard library ▾</h2>
<img alt="" class="gopher" src="https://golang.org/doc/gopher/pkg.png"/>
<div class="pkg-dir">
<table>
<tr>
Expand Down
6 changes: 4 additions & 2 deletions godoc/static/static.go

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions godoc/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,6 @@ div#about {
font-size: 1.25rem;
margin: 0 auto 1.875rem;
}
div#gopher {
background: url(https://golang.org/doc/gopher/frontpage.png) no-repeat;
background-position: center top;
height: 9.688rem;
max-height: 200px; /* Setting in px to prevent the gopher from blowing up in very high default font-sizes */
}
a#start {
display: block;
padding: 0.625rem;
Expand Down Expand Up @@ -582,6 +576,7 @@ hr {
img.gopher {
float: right;
margin-left: 0.625rem;
margin-top: -2.5rem;
margin-bottom: 0.625rem;
z-index: -1;
}
Expand Down

0 comments on commit f05e912

Please sign in to comment.