Skip to content

Commit

Permalink
content/static: add source code link HTML
Browse files Browse the repository at this point in the history
The HTML for the source code link is added. The style is set to
display:none, and will be styled in a future CL.

There are no user facing changes in this CL.

For golang/go#40939
For golang/go#42486

Change-Id: I01ba3ead6b2d0a9ea7dc1488d3b9f5eadb33d472
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278434
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
  • Loading branch information
julieqiu committed Dec 15, 2020
1 parent fbefec4 commit 553d871
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions content/static/css/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,9 @@ pre {
padding-top: 1.5rem;
text-align: right;
}
.Documentation-declarationLink {
display: none;
}
.Documentation-exampleButtonsContainer {
align-items: center;
display: flex;
Expand Down
5 changes: 4 additions & 1 deletion content/static/html/doc/declaration.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
{{- define "declaration" -}}
{{- $out := render_decl .Doc .Decl -}}
{{if $out.Decl}}
<pre>{{- $out.Decl -}}</pre>
<div class="Documentation-declaration">
<span class="Documentation-declarationLink">{{source_link "View Source" .Decl}}</span>
<pre>{{- $out.Decl -}}</pre>
</div>
{{end}}
{{- $out.Doc -}}
{{"\n"}}
Expand Down

0 comments on commit 553d871

Please sign in to comment.