Граф коммитов

577 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Amsterdam 01700ac665 internal/frontend: display readme links
Add the links in the "Links" section of the unit's README
to the right sidenav.

For golang/go#42968

Change-Id: Ie3744812af12ba365cd7863af09299d4d5c336a6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274957
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-12-03 20:27:24 +00:00
Jonathan Amsterdam 557ca0dd34 content/static/js: remove collectJumpListItemsFallback
All our doc has data-kind attributes.

Fixes golang/go#42956

Change-Id: I2bb85d741873bba524a13ab8f6b2e50d9615570d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274954
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-12-03 10:58:56 +00:00
Jonathan Amsterdam adf682b32f content/static/js: remove guessKind
Fixes golang/go#42957

Change-Id: I273ed33ae2c9a57632a9870864bc962e2e0d4b8c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274953
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-12-03 10:49:50 +00:00
Jonathan Amsterdam 97be6d027a content/static/js: change internal bug references to external
Fixes golang/go#39621

Change-Id: If88a53f0b22d45baf68fb7666280b0bb6722759b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274952
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-12-02 22:50:47 +00:00
Jonathan Amsterdam 002ded0c1c internal/godoc/dochtml: return extracted links from RenderParts
Change-Id: Ie65b34e6fdf8b6fb155704fbd597d0c80a7dddb9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274492
Trust: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
2020-12-01 17:01:31 +00:00
Julie Qiu 912cb2f9e8 content/internal/godoc/dochtml: delete legacy tmpl
Change-Id: Ia300cfd1cbc8393e1bd73e24b6c9103325bf7b4d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/272529
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-11-25 21:42:06 +00:00
Jamal Carvalho 5e78b63826 content,internal: remove legacy static content
Removes static content used in the legacy package, directory, and module pages.
Moves sidenav and readme styles requests into details page so they are not
loaded on all page requests.

Change-Id: Ief93cb1ec21939dadf0f9f6a0c47abaf4284b2a9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/272827
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-24 21:11:40 +00:00
Jamal Carvalho d92d89e795 content/static: fix line-height for bullet lists in rendered markdown
Fixes golang/go#42800

Change-Id: I6611e3610726848a63683903008ca86dd9dd83d7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/272826
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-11-24 21:11:18 +00:00
Jamal Carvalho 3304502adf content/static: expand readme when browser text search is activated
The browser find text feature will search through text
even when it is hidden. This change will expand the readme
when the text search feature is activated on the unit page.

Fixes golang/go#42653

Change-Id: I15a97724c21a975ee04f409a26e409e3ed7efd76
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/272608
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-11-24 21:11:08 +00:00
Jamal Carvalho 819cd13d95 internal/frontend: extend goldmark parser with custom id generator
The default id generator in goldmark is limited to ascii characters
and keeps the text content from inlined images. This change removes
the images from heading ids and preserves all unicode alphanumeric
characters.

Change-Id: I8657dc4aa3f2b8d5b4f5a519992ed85f67d0b7a4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/272447
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-11-23 22:34:06 +00:00
Omkar 0d700958da content/static/css: fix overflow on homepage
The overflow was caused by oversized div with css class `.Questions`.
Removed `width:100vw` to avoid overflow.

Fixes golang/go#42718

Change-Id: Ide695be3d837e9c953b2e0d3eb38bedc1e4d6a38
GitHub-Last-Rev: 401dc148ef
GitHub-Pull-Request: golang/pkgsite#18
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/271518
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
2020-11-23 18:00:12 +00:00
Jamal Carvalho 4d2f0315fa content/static: add readme headings to the sidenav
This change adds the readme headings to the outline
in the sidenav and unifies the navigation tree into
a single accessible structure.

Styles within the tree are based on the accessiblity
tree structure. This will make it easier to see when
updates to the tree are inserted incorrectly because
they'll be matched by visual breakages on the page.

Sidenav and readme click handlers are updated to
ensure that when an outline item is clicked the
corresponding content is visible.

Change-Id: Ie6062c24f37bec9fffe242aa1398ec815606c613
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/271319
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>
2020-11-20 17:37:33 +00:00
Jamal Carvalho 6d25f509ee content/static: copy unit outline code into legacy files
Code in motion. Outline code will be updated to support
a new outline layout that contains the readme headings.

Change-Id: I58d4778f01dd9e1347197f1a8d2d5cd16b35d7a8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/271318
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>
2020-11-19 14:15:55 +00:00
Julie Qiu 6eb2d601e1 content/static/html/doc: change text for empty sections
When a documentation section is empty, the text now displays "This
section is empty."

For golang/go#42652

Change-Id: I9dca537823d8e8aeb5adcb2404e02153ee025ef6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/271257
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-11-19 00:17:30 +00:00
Julie Qiu d6a42ad786 content/static/js: remove used .js-filesOption reference
At the moment, this error appears in the console on pages without a
Source Files section:

Uncaught TypeError: Cannot read property 'setAttribute' of null
    at unit.js:54

It doesn't seem like js-filesOption is being used anywhere, so this
reference is deleted in unit.js.

Change-Id: I8db74ae996d99b1ffef143e5b8ffdc78ba1d9cbe
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/270801
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-11-17 18:23:53 +00:00
Jamal Carvalho 45ca70cda2 content/static: tighten spacing below header on unit page
Fixes golang/go#42490

Change-Id: Ie3afa8dde6a6a3df58cb6a420d7504ec4facb4b2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/269557
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>
2020-11-12 22:42:25 +00:00
Eli Bendersky fdee0046e9 x/pkgsite: more accurate identifier filtering for "jump to" in-page search
Currently, "jump to" filters ids by a simple substring match, ordering them alphabetically. This change makes the filtering more powerful by prioritizing exact matches over prefix matches and then substring matches.

E.g. if a package has a symbol named `Foo`, when the Jump dialog is searched for `Foo` it should now come before ids like `BarFoo` (which would previous come on top because of alphabetical order).

This change also removes the use of regexps in the list, using simpler string matching.

Fixes golang/go#42489

Change-Id: I2f564d28767a27c68ef01ab246aaf4b8755bb902
GitHub-Last-Rev: cd6ca249ce
GitHub-Pull-Request: golang/pkgsite#16
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/269278
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-11-12 16:49:24 +00:00
Jamal Carvalho b1d93aece5 content/static: add spacing between variables and constants in doc
Adds space between variables and constants to make it
clear which description belongs to a declaration.

Change-Id: I916e5538079751298921258611896106266dc580
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/268458
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamal@golang.org>
2020-11-10 16:16:35 +00:00
Jonathan Amsterdam 6992de4a26 internal/worker: add favicon
Change-Id: I5e641244feca4238e269465a312d6a3e17b7a31c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/268640
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-11-10 12:58:37 +00:00
Jamal Carvalho 441e3b3071 content,internal: delete the sidenav experiment
Removes various checks for the sidenav experiment now
that the feature is fully rolled out.

Change-Id: I201fda2189252d350f05e50176f2ff9eb0268343
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/268457
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-11-09 19:06:33 +00:00
Jamal Carvalho c488338d6d internal/frontend: fix tab selection in mobile fixed header
Fixes a bug in the mobile fixed header where it would display
select options for imports and importedby tabs when viewing
units that do not contain a package. The 'Licenses' option is moved
above 'Imports' and 'Imported By' to match the order in the desktop
header.

Fixes golang/go#42298

Change-Id: I81e170e2b34013f2b2c9111bbc1c8ce90adc3382
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/267938
Trust: Jamal Carvalho <jamal@golang.org>
Trust: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-09 15:18:34 +00:00
Jamal Carvalho 56763a69f3 content/static: limit performance tracking to core web vitals
Time to First Byte and First Contentful Paint can be useful as proxy
or supplemental metrics when diagnosing specific issues. For now we'll
focus on the Core Web Vitals to reduce the number of events sent to
Google Analytics. This will be important as traffic to the site grows
so that we do not hit any event caps.

Change-Id: I3c7514d630b65b66d2884efb9f0c1b9ace71630d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/268118
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>
2020-11-09 15:13:57 +00:00
Jonathan Amsterdam d2f4c55c6c internal/worker: add useful GKE log link to home page
Change-Id: Ieee29e5604439a81997c5abc90456d26bed4d69e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/267777
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-11-05 09:39:09 +00:00
Julie Qiu 3d8acd9386 content: add text to versions tab when tagged version is missing
When a series has tagged versions, but the current module version does
not, the versions tab will now display the message "No tagged versions in
this module." instead of displaying nothing.

For golang/go#41345

Change-Id: I2137187532bce18d1c60bc7aa138e14a6fb7e559
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/266141
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-11-04 21:50:24 +00:00
Jonathan Amsterdam 0da6d2a88a internal/godoc: remove parsing from unit-page rendering
The separate parts of the unit-page template are now rendered
separately. No HTML parsing is done when rendering the unit page.

Change-Id: I9ee1617eb4eff5d2afd759d3677ba40bb660bd6b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/267399
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-11-04 14:37:50 +00:00
Jonathan Amsterdam 81780f2de9 internal/godoc/dochtml: separate unit templates
Separate the unit template into three parts.

For now, they are all still rendered together, then parsed
apart. But we will change that later.

Change-Id: I2b413bd35adb1d72f00a9df39907b95883da41c7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/267299
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-03 18:33:38 +00:00
Jamal Carvalho d88652966a content/static: jump to button updates
Updates style and copy of the jump to button to clarify its behavior and
updates the heading of the jump to modal to match the button text.

Change-Id: I8536bba10bb152e001475265308c012afc995b17
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264632
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-02 19:26:02 +00:00
Jonathan Amsterdam 2b3171e359 internal/godoc,content/static/html: move templates to files
Move the doc rendering templates from hard-coded
strings to files under content/static/html.

Also, parse the templates once, instead of on each call to Render.

Template loading is still under the control of the
internal/godoc/dochtml package, because the templates have to be
parsed with a certain grouping and with some functions defined, and it
would be awkward if callers had to know all that.

An alternative design would pass the directory containing the template
files to Render, but that would require a lot of plumbing.

This is the first of several improvements to internal/godoc.
We also plan to remove godoc.Parse.

Change-Id: I7182dd4ea9bc7189b1144295ad193af30ef9ecc4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/266597
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-02 17:27:04 +00:00
Jamal Carvalho e78f3491d2 content,devtools: update readme.css for goldmark styles
Updates css generator and creates new readme.css file that
preserves github heading styles when using the goldmark
parser.

Change-Id: Iddd2ea99711ffe11c14f6e9e2087b023b7d73325
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/266580
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-02 17:12:21 +00:00
Jamal Carvalho 44ee364c02 content/static: copy readme.css into legacy_readme.css
Code in motion. Preparing to generate new readme styles for
the goldmark parser.

For golang/go#39297

Change-Id: I506046ba36fdef6fa935b0600e1037e2d832ad24
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/266579
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-11-02 17:10:20 +00:00
Julie Qiu 2c6a27eca9 content: fix license tab in fixed header
The sticky header currently links to the anchor tag, while the main
header links to the licenses tab. Update the sticky header to match.

Link fixed: https://photos.app.goo.gl/Xu4z72DPgggm8oFq7

Change-Id: If6be8e01e5ce55876c4dee4a644c47426b6c2dec
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/266142
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-10-29 16:48:57 +00:00
Jamal Carvalho 42a5c82def content/static: add test ids for pagecheck and server tests
Adds data-test-id attributes to elements used in the
pagecheck and server test selectors. Test ids help indicate
that a change in related html structure will break a test
and make the tests more resilient to minor changes in html
structure on a page.

Change-Id: If82b72950b92ffdc8c4708ba886c758d624ff67c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265782
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-28 16:24:13 +00:00
Jamal Carvalho f1a4490718 content/static: fix layout of files in unit page files section
Change-Id: I4d2e2e68148ff16bb49124c0aebf688f2fdd677f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264631
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>
2020-10-28 14:28:07 +00:00
Jamal Carvalho b97f1d4081 internal,content: fix declaration link opacity
Updates css selector for h4 level links in the documentation
so the declaration name stays visible when the paragraph link
is hidden.

Change-Id: Ic229626fffdd8f8091b3da3ea60c7d6630aeacc3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265581
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-10-28 14:27:48 +00:00
Jamal Carvalho 244535af9d Revert "content,internal: disable jump to identifier if documentation only has overview"
This reverts commit a5040c6e9b.

Reason for revert: breaks jump to identifier on package pages.

Change-Id: I33f9d99aa1ef671d28af1de51c88493a6d0ca2db
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264919
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-26 13:45:29 +00:00
Jamal Carvalho e4c7e27663 content,internal: fix styles on doc overview subheadings
When the h3 were changed to h4 they no longer
had the correct styles applied to them. This
change corrects the hover state for the header
links and adds a space between the title and
paragraph the icon.

Change-Id: Ie77f93db73202b22b21d69c31f9c4ab962f36b90
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264628
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-10-26 12:37:43 +00:00
Jamal Carvalho dea5a114aa content/static: remove stray space from meta links
The license and imports links in the header
appeared to have an extra space after the label
because of a css quirk. Moving the :after content
to :before content fixes the issue.

Change-Id: I9458c20340b745e5329ad0853bceebc039118864
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264629
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-10-26 12:37:18 +00:00
Jamal Carvalho aaaf1af534 content/static: readme expands when given tab focus
Fixes readme expand logic so that it will open
when an element within it is given focus through
keyboard events.

Change-Id: I66cd406137b6162b3bd8415b5c186f87f0886ee2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264627
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>
2020-10-26 12:36:41 +00:00
Jamal Carvalho f3abe073dc content/static: fix z-index of mobile nav outline dropdown
The mobile nav dropdown was indexed too high
and covered the hamburger menu when it was open.
Adjusts the z-index so that the dropdown will
appear behind the hamburger menu.

Change-Id: I016ddee716604fc301308916019ba971a1e9f85f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264626
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>
2020-10-26 12:36:25 +00:00
Jamal Carvalho 7fe9dace48 internal,static: add missing items to mobile nav
Adds options for readme, sourcefiles, and documentation to
mobile navigation dropdown.

Change-Id: I29952b10412b92766aa82d3a3b4a22a2c3a19d1b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264624
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>
2020-10-26 12:36:17 +00:00
Julie Qiu 4309cd76ea content,internal: change wording for "latest major" to "highest"
At the moment, the word "latest" is overloaded between latest major and
latest minor. Instead, use "highest" when referencing major versions.

Change-Id: I24f7f26bcff99c2d89b55faa38dbcef62a74d1a1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264325
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>
2020-10-23 18:59:47 +00:00
Jamal Carvalho 6cb5978b50 content/static: gray out jump to button when disabled
Adds gray background to button when disabled.
Adds transparent background to jump to icon
to fix ui when button is disabled.

Change-Id: I49e48bb92a2cbbc97645eb3d56e05b90c170000d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264204
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-21 21:13:58 +00:00
Jamal Carvalho 414e173c40 content/static: replace empty query href with full url path in header
Replaces empty query string href with full path
for main page link in header. Removes "?" from url
when going back to main page from meta page.

Change-Id: Id3246d7914003b1436e098db06257438e5c9db2f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264200
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>
2020-10-21 18:37:24 +00:00
Jamal Carvalho a5040c6e9b content,internal: disable jump to identifier if documentation only has overview
When the doc for a package does not contain an index
we disable the jump to identifier dialog. This change
prevents both the button in the sidebar and the k key
from opening the modal.

Change-Id: I48e17a4f57f066bf80fdc5452e900f9803ecf933
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264199
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2020-10-21 18:37:10 +00:00
Jamal Carvalho 05cf912e0a content/static: add source link to source files
Adds a link to the header of the source files section
to view the source of a package at the origin.

Change-Id: Ieef083c08602e0ab0d498e422952738bac80d011
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/263957
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-20 21:44:35 +00:00
Jamal Carvalho 471c5fa083 content/internal: show message when repo url is unavailable
When the repo url is unavailable show a message in the
right sidebar.

Change-Id: I1a54ff674f1f1e514a0af3cc98ad4ec62755e839
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262680
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-20 21:42:45 +00:00
Julie Qiu 1058f18a27 content: fix non-redist message
The message indicating that a package is not redistributable is fixed so
that it is only displayed if the unit is non-redistributable and a
package.

Change-Id: Icdc927b1f49f1f4565d1e9ac2fdad239a5158599
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262772
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-20 17:55:10 +00:00
Jamal Carvalho a01afa2463 content/static: update font weight for page headings
Now that we have switched to system fonts the
headings appear too bold. Reducing the font
weight to account for the font family changes.

Change-Id: I6b16040343e56d9f595170203e03a377c665585f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262277
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-14 18:13:46 +00:00
Julie Qiu 11e530757a content: display empty gopher for license message
The UI for non-redistributable packages is updated to show an empty
gopher.

Screenshot:
https://drive.google.com/file/d/1V1tb8QfafGP033E4bRRz3tN-ocskWagc/view?usp=sharing

Change-Id: I327b31d6013901723111630f3f57a82287011020
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262101
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-14 16:02:30 +00:00
Julie Qiu ac1fc9f1b4 content: display license message only for doc section
Source files and directories can be displayed even if the unit is not
redistributable, since this is technical information about the unit.

There is no way of knowing whether a README doesn't exist because the
file isn't there, or if it was removed because the unit is not
redistributable.

As a result, the message informing users that a unit is not
redistributable should only be displayed if a documentation section
would be present otherwise.

Change-Id: Ia702a5090a8693da24ccffd5a1be040072fe188e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262100
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-10-14 15:13:48 +00:00
Julie Qiu 24009e49b8 content,internal/frotend: remove CanShowDetails logic
CanShowDetails is always true, except for licenses. In that case,
redirect users to the main page, instead of showing them an empty
licenses tab.

CanShowDetails and TabSettings.AlwaysShowDetails are longer needed.

Change-Id: I6a3630c38dcaa36c8f5105e410ba5ea70ec8d4c5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262099
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>
2020-10-14 14:55:55 +00:00
Julie Qiu b93097096a content,internal/frontend: remove UnitContentName
UnitContentName will only ever be "Main". Instead, hardcode in the text
to be displayed in the template.

Change-Id: Ia26bbc729191f8debb041114c1110b0c3e840dcf
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262098
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>
2020-10-14 14:07:47 +00:00
Julie Qiu 5589703578 internal/frontend: add fetchMainDetails
Logic for rendering the main unit page (which is not shared with other
tabs) is factored out into a fetchMainPage function and MainDetails
struct. This means that GetUnit and GetImportedBy are no longer
called unnecessarily when fetching data for non-main page tabs.

Data for MainDetails is now stored on UnitPage.Details, as is the case
with other tabs. A couple of fields are added/changed:

* LastCommitTime is renamed to CommitTime, since they mean the same thing
  and the latter is less verbose.

* IsPackage is added, which is used to determine whether a documentation
  section should be shown, even if the documentation is empty.

* NumImports is added, which is used to display the number of imports
  for given package.

UnitPage.Unit is changed to a UnitMeta type, since other fields on Unit
are no longer needed and UnitMeta is more explicit.

Change-Id: I7d5f4de867678c60d697fe9559416f3171f2d15c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261721
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-13 22:27:09 +00:00
Julie Qiu 8e0499f481 content,internal/frontend: rename UnitPage.PackageDetails to UnitPage.Details
UnitPage.PackageDetails is renamed to UnitPage.Details, since the
details are not necessarily always for a package.

Change-Id: I151377a59a5515bcc2115489408d497cb9a86789
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261998
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>
2020-10-13 21:41:45 +00:00
Julie Qiu 98487e695c content: use PageType in _unit_header.tmpl and unit_details.tmpl
Instead of computing the page type using .Unit methods, use the already
computed page type in these templates.

Change-Id: I7b724b7ca64027aa6a2defbc6d806f6afaa1e095
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261719
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-13 20:39:45 +00:00
Julie Qiu bc5ab13a65 content,internal/frontend: use PageTypes as actual display name
Rather than computing the page type name in the template, use the actual
display name as the value of the page type consts.

This allows us to render pageTypes directly in the templates.

Change-Id: I5de0e165fd96db92afeb066e0f237bc4159f6724
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261718
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-13 20:39:36 +00:00
Jamal Carvalho 5b4f2d2788 content/static: use system fonts
Removes Google fonts in favor of system fonts to
improve readability and page load performance.

Fixes golang/go#40959

Change-Id: Ib462d609de70699cff602f751593bcbd38cfeb48
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261501
Trust: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-10-13 15:11:20 +00:00
Jamal Carvalho e76d081229 content/static: update metadata page back link styles
Updates the styles on the "go to main page" link on
the metadata pages. Keeps header height consistent
between page navigation.

Change-Id: I1f1a5032df03d082db4b070d6ec035297c24fac5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261503
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>
2020-10-12 19:00:23 +00:00
Julie Qiu d9e229f97a content,internal: add support for stdlib pageType label
The Standard library page is no longer labeled as module, and all stdlib
packages are labeled with the "stdlib" label.

pageInfo is refactored and split into pageTitle, pageType, and
pageLabels.

Change-Id: I59cec2e05de01b6c0b191e428e8229fc95d67b2e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259999
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-12 18:48:19 +00:00
Jamal Carvalho 3132e566af content/static: fix main page section targets
Updates styles for main page sections to fix
target link click. This makes sure the content
appears below the fixed header when target links
are clicked.

Change-Id: Icfb97f00d82aeb3b46e30cae0b379249453f6e96
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261500
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>
2020-10-12 18:29:57 +00:00
Jonathan Amsterdam a43f4d30ac content/static/html/worker: remove finished fetches from home page
Show only fetches in progress on the worker home page.

Change-Id: If0d963bffa4edb80199e817a38d7e89530fedd31
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260938
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-09 18:50:57 +00:00
Jonathan Amsterdam d4e3d6f391 internal/worker: remove references to EXPERIMENTS_FROM_CONFIG
Change-Id: I9805bb30691d742cf5ea7b643ad2a591d84e5b79
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260937
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-09 14:58:20 +00:00
Jamal Carvalho aa97eafa24 content/static: remove icon next to source files
Removes icons from source files and adjusts
spacing of the grid for better readability.

Change-Id: I7ef7c8fc19dd641652219321f113862277be0830
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260728
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>
2020-10-08 17:29:46 +00:00
Jamal Carvalho a4e8b2ee21 content/static: add margin to bottom of last element in nav group
Fixes issue where a single item in a nav group
like Index > Examples looks cluttered.

Change-Id: Icf9103c4f6e7b57339df7187ca593f4ef604367f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260727
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>
2020-10-08 17:29:41 +00:00
Jamal Carvalho 2063612934 content/static: add empty alt text for decorative icons
The empty alt text indicates to assistive technologies
that the image is decorative and can be ignored.

Change-Id: Ia48bdfe613c25bc178f2c0c1f6c6969340f9eb0d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260726
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>
2020-10-08 17:29:35 +00:00
Jamal Carvalho d62b1ef1b6 static/content: add path to copy button tooltip
Adds the path to the copy button tooltip to
make explicit what is being copied.

Change-Id: Ie2bc1c6832f86351156699bb85b97384e702bb7a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260725
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2020-10-08 17:29:24 +00:00
Jamal Carvalho b67566c502 content/static: fix site padding on non unit pages
Fixes the site padding on license policy, search,
search help, and homepage.

Change-Id: I88d8b00390ef968de2c993308d5337732360aa88
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260722
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>
2020-10-08 17:28:26 +00:00
Jamal Carvalho f596f6d66a content/static: use link version in canonical URL path
CanonicalURLPath was incorrectly using requested version.
This change updates CanonicalURLPath and replaces it with
URLPath where requested version is needed.

Change-Id: Ie624c91c258d7ec87e8d3fd61c5b339612904a5b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260721
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2020-10-08 17:28:19 +00:00
Jamal Carvalho 1e6101ed17 content/static: disable jump to modal when documentation is empty
Disables the jump to modal from opening when documentation
does not exist for the current page.

Change-Id: Ic67019003ae4adc9482a67a72f2f077eadb0363d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/260720
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>
2020-10-08 17:28:12 +00:00
Miguel Acero 8d6417918a devtools/cmd/css: generate github styles in separate file
This change modifies the script used to generate github styles to save
to a separate css file while converting the px values to rem. Note
thatthe generated styles is formatted properly after run with prettier.

Change-Id: I860e4512a5ff281a6d53210293cb310d5c5e074c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258257
Trust: Miguel Acero <acero@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-07 17:19:48 +00:00
Julie Qiu 73f2dbae4b content/static/html/helpers: change anchor links for sections
The top level sections now have anchor links in the format of
#section-<headingName>.

Change-Id: I9813e8ab226f3696ae09378ba3b560525664bfc1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259958
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-10-07 14:16:45 +00:00
Julie Qiu a66050b80a content/static/html/helpers: open source files in separate tab
Change-Id: I949bf5825a4d351785398c41426adaee76945ef2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259937
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-06 20:33:59 +00:00
Jamal Carvalho 9e7f3b2c56 content/static: add break word unit details
Breaks words in unit details to fix overflow issue on
portrait mobile screens.

Change-Id: I70e205c39c4454e3f65835ad9fadf363b62c438b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259857
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-10-06 17:38:35 +00:00
Jamal Carvalho 9e73625b7c content/static: update accordion controller init
Updates accordion controller to select active panel
on init. Opens doc panel on init for pages without
readme.

Change-Id: I4c0d190217bc109f322b6f5a09fff930bc7ac3a3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259801
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>
2020-10-06 17:38:25 +00:00
Julie Qiu 6d768c80ea content/static/css: increase size of h4
The size of h4s is increased, so that functions and types are displayed
at a more readable size.

Change-Id: I48df1bcfe4d319b0a3ae78f4ab89185525d08a17
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259624
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-10-06 16:44:50 +00:00
Julie Qiu bc74c0ffb7 internal/frontend: trim prefix from nested modules
The directories section is refactored to display content using the new
NestedModule and Subdirectory structs, rather than the old
createDirectory.

The path prefix is now trimmed from nested modules. For example,
golang.org/x/tools/gopls is displayed as "module gopls" on the
golang.org/x/tools page, instead of "module golang.org/x/gopls".

Change-Id: I6e1a160bec42055c78d566e6ed4bc14d542bbfd3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259319
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-06 16:42:43 +00:00
Jamal Carvalho f8c85f7147 content/static: create accordion controller for sidebar
Creates accordion controller for use in the left sidebar.
Collapses and expands top level sidenav sections.

Change-Id: I11122b96a10241d55e125515b5b8ccb41f27c461
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259629
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-06 14:32:24 +00:00
Miguel Acero cd0bd5e540 content/static: move generated github styles to readme.css
Moves the generated github styles into its own "readme.css" file. This
is preparing for the next CL that will generate changes for the
readme.css file.

Change-Id: Ic9f617695030129334b2eb9a47cb74a982576748
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257697
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Miguel Acero <acero@google.com>
2020-10-06 00:33:29 +00:00
Jamal Carvalho 6a4d28f83c content/static: add icon to jump to button
Adds icon to jump to button in left sidebar.

Change-Id: If0abe4dd94e741f15a17571c4916c7bacbbbeb40
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259628
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>
2020-10-06 00:19:41 +00:00
Jamal Carvalho c47c5bd4a8 content/static: readme collapse and expand without query param
Adds event listeners to collapse and expand readme
without a page reload.

Change-Id: I3eac89c55e77cf41ba5296c1dc5e02b8960dcd2e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259627
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>
2020-10-06 00:19:27 +00:00
Jamal Carvalho e53c44586d content,internal: add canonical path keyboard shortcut
Adds the canonical path keyboard shorcut to the unit page.

Change-Id: I3f8882db0d779674471b94d90b25f651c5dd2527
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259626
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>
2020-10-06 00:19:13 +00:00
Jamal Carvalho 32090f4576 content,internal: update empty documentation sections
Updates template to deemphasize empty sections. Fixes
empty and non-empty view of notes sections.

Change-Id: I1fb8c130554ff9c4c92b3fea00c704155471ca07
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259622
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>
2020-10-06 00:18:54 +00:00
Jamal Carvalho 5ab64318ef content,internal: documentation outline updates
Hides the expand icon on the left of outline sections for functions,
types, and notes when the sections are empty. Adds anchor links to the
functions, types, and notes sections. Collapses inactive sections when
a new section is focussed. The file sidenav.js is copied into
legacy_sidenav.js.

Change-Id: I637cdc867c7d1b4aee941f12c09f061fdef070f7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259446
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>
2020-10-05 20:17:52 +00:00
Julie Qiu 96718d5258 content: add external icon to play button
The play button now shows an icon to indicate that clicking that button
will take the user to an external site.

Change-Id: I92c0f13ee22f1f04ae12196d0d656f8ec088ffcb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259214
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-05 16:02:46 +00:00
Julie Qiu 2a9cd5d552 content/static/html: use a single link for licenses
The header is updated so that a single link to the license tab is shown,
instead of a separate anchor link to each license.

Change-Id: Ib6b2d948f96227805e73816c0cc1108eea1ca8a5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259213
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-05 16:02:33 +00:00
Julie Qiu 0d8d905d71 content,internal/frontend: use consistent casing for standard library
"Standard library" is also cased with a lowercase "library" throughout
the site. Previously, some parts of the site displayed "Standard
Library".

Change-Id: I41e1ff411f19ebd592991c39edaed68534cf8dc1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259205
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-02 22:22:45 +00:00
Jamal Carvalho b2266ec0c7 content/static: add styles for package files
Updates source files section to match design spec.

Change-Id: I5f13c90eb8e5159e778143c775f1f321a517e7f7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259211
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-02 22:08:37 +00:00
Jamal Carvalho d99a9cd928 content/static: highlight active outline section in sidebar
Adds JS to update the active sidebar section on page load
and adds event listeners to update the active section on
selection.

Change-Id: Ib5a8948089cf1981d8a3097183bf9f85659e49da
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259202
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-02 19:41:58 +00:00
Jamal Carvalho 256840e901 content/static: add copy on click to unit page header
Adds copy on click code to unit page.

Change-Id: I2a7e350e002bfc5459cc9204d92690a245a4f32f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259201
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-02 19:40:48 +00:00
Jamal Carvalho 7ec7293591 content/static: pad unit page anchor link targets
Adds spacing above anchor link targets on the details page to
account for sticky header.

Change-Id: Iaf1c5e1189a3cae92475ddeab1fb3fe6b9ea6e7f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259200
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-02 19:40:36 +00:00
Jamal Carvalho c690f3f592 content/static: fix details sections margins
Updates margins on content sections to account for dynamic sections

Change-Id: I5f4f2970869f89949ff2fa3dca71ab3fa120112c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259199
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-02 19:40:19 +00:00
Jamal Carvalho 5c3884d8a3 content,internal: fix imported by count in unit page header
Updates unit page count to use db.GetImportedBy for data. This will report
incorrect numbers when using proxy datasource.

Change-Id: Ie5b0004f3ef7a00436cb6cddfb030f263cdacbe8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259197
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-02 19:39:48 +00:00
Jamal Carvalho 5ab99ebd82 content/static: fix jump to identifier input button
Generates jump to identifier list when sidebar button is clicked.

Change-Id: I10ed8cd606303af77d78774c2e0c46391199c49d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259198
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>
2020-10-02 19:27:00 +00:00
Julie Qiu bbd80adee6 content,internal: add source files to unit page
An initial version of the source files section is added to the unit
page. The content for this section should be present, but needs to be
styled in a future CL accordingly to spec.

Change-Id: I398bcd3052048567e5c3a9695427afc3a85a0731
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259005
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-02 19:18:27 +00:00
Jamal Carvalho 93eb9a73ca content/static: switch jump to input for button
Changes jump to input to button in sidebar to
account for keyboard navigation. Prevents modal
from opening on element focus.

Change-Id: I79515cae0338d0e0dcfadde70193346c47e5e434
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258526
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>
2020-09-30 21:18:53 +00:00
Jamal Carvalho 8cc2d1307c content/static: unsticky right side bar
Makes right sidebar scroll with the rest of the
documentation page.

Change-Id: I9f433f4f8d8542e2db29482938e3aecfbf1c9246
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258287
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>
2020-09-30 16:45:38 +00:00
Jamal Carvalho 76b67facd7 content,internal: cleanup aria-landmark values
Adjusts aria-landmark values to match updated greenlines.

Change-Id: I4573039ebf62df20a91ac3a52b1171f0d192d774
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258258
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>
2020-09-30 16:45:28 +00:00
Jamal Carvalho 51473e3429 content/static: add title badges for command and directory
Adds badges for command and directory. Command badge
excludes package badge but others may appear together.

Change-Id: Ifbd82d620a5d0c33ca3142fd0220d9bf3558b3f9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258221
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-09-29 16:40:52 +00:00
Jamal Carvalho 12efbb039e 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>
2020-09-29 16:40:42 +00:00
Jonathan Amsterdam bbe36a9256 internal/worker: add more info to home page
To understand worker behavior better, add more information
the worker home page.

- The name of the pod (hostname), so we can know which pod we're
  looking at.

- More memory statistics, to understand why workers restart.

- Information about all the fetches in progess, and finished within
  the last minute.

Change-Id: I38098069f5e03166971e67ad53a64c539ef8b5cf
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258017
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-29 14:53:03 +00:00
Jamal Carvalho ed2b6b22c3 content/static: drop empty details page sections with exceptions
Drop all empty sections. Use airplane gopher image with a empty
message for packages without documentation.

Change-Id: I35e8d074b96b9b218799f4e4139ea3662a73eb62
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257975
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-09-29 14:31:10 +00:00
Jamal Carvalho 58f2885207 content/static: metadata page link update
Updates the copy in the back link on metadata pages.

Change-Id: I6e938e88f440f39261fdb3b6c240648d7988329d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257970
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>
2020-09-29 14:08:54 +00:00
Jamal Carvalho 9c1943b7d7 content/static: jump to indentifier sidebar element
Adds jump to identifier element to the right sidebar.
Focusing on the element will open the jump to modal.

Change-Id: I0dc49d0d5fd93b7f1e4c85f0960cffe03fbb1df8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257661
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>
2020-09-28 21:50:45 +00:00
Jamal Carvalho db069347ea content/static: add js-documentation class selector for jump.js
Updates the class selector in jump.js to use a js specific class.
Classes used in js to select elements should have the js prefix.

Change-Id: I6481b29c14fa9da11ccdaa76842919283a25fe39
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257657
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>
2020-09-25 20:28:08 +00:00
Jamal Carvalho 0d66fc4d5e content/static: module and package page title badges
Adds badges to unit page for packages and modules.
A unit that contains both a module and package
will show both badges.

https://drive.google.com/file/d/1aXb3xGUw6fHDegdw5F_sK_Xb2N_qYjkp/view

Change-Id: I5c72694970633e84da68d6a248eb9052d6d83a17
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257200
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-24 20:47:01 +00:00
Jamal Carvalho e15472716d content,internal: remove safehtml.HTML pointers from unitpage struct
Removes pointers from unit page struct
replacing nil values with empty HTML values.

Change-Id: I1ada25a8ee59b41f67ba4399a37fed3301050b94
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257197
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-24 20:41:26 +00:00
Jamal Carvalho 484f6716e3 content/static: add back button to package data pages
Adds a navigation element to return to
the unit page from package data pages.

Change-Id: I704e60e37ae587365c3713b448260944c384f34b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257140
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>
2020-09-24 20:39:31 +00:00
Jamal Carvalho d9ef819191 content/static: responsive layout fixes
Adds minor fixes for responsive layout to
follow updated rules in styleguide.

Change-Id: I6f2cb51a2350473199adc6b4974635c3d3b16ae5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257139
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-24 20:17:07 +00:00
Julie Qiu 89b49a7abd content/static/html/pages: remove experiment executable-examples
Change-Id: I3e81ceab33e45f43db44ff65515f9aeb4e39a5a9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257199
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-24 19:03:13 +00:00
Jamal Carvalho 61f3346b76 content,internal: add metadata tab content to unit page
Adds package details data to unit struct and
render pages for versions, licenses, imports
and imported by tabs.

Change-Id: I38ce022bd7ea4a2df53310f3d2dd631fcca020ce
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256879
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-24 15:39:47 +00:00
Jonathan Amsterdam 1c8f229061 internal/worker: add cgroup memory statistics
Gather information about the current cgroup, which
is the implementation of a docker container.

Move all the memory functions to a separate file.

Reduce the display values to the ones that seem to be the most
meaningful.

Change-Id: Ifad13d96750356b6343a65d4945314029e092567
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256519
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-23 21:25:02 +00:00
Jamal Carvalho 8314b73291 content/static: add unit metadata to fixed nav
Replaces tab navigation in fixed nav with unit metadata links.

Change-Id: Ib21bd7a1b473ac9af0f49220dd77db79c5d1960d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256819
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>
2020-09-23 20:22:58 +00:00
Jamal Carvalho 9ed9db4fd2 content,internal: fixed nav a11y updates
Uses aria-hidden to hide the duplicated content
and prevents tab navigation into child anchors.

Change-Id: I56f75bfa68e9c136254d26f28ab65e4a3ba87a9f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256539
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>
2020-09-23 20:22:38 +00:00
Jamal Carvalho d5eb0625a0 content,internal: separate and rename fixed header ui code
Creates new files for unit fixed header ui
in preparation for future changes that diverge
from the existing fixed nav. Contains no code changes
outside of renamed css classes.

Change-Id: I450565deea86d88bb10c580f840d0cdd59c5c683
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256540
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2020-09-23 20:22:27 +00:00
Jamal Carvalho 20eb00166b content,internal: add the doc index to the unit page
Adds css to unhide the doc index on the unit page and
an index link in the sidenav that is hidden on the
package details page.

Change-Id: Ieffe1368aaa1fc7cfcd4250359279b94d18a500b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256537
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>
2020-09-23 20:22:13 +00:00
Jamal Carvalho d2aeefc581 content/static: update responsive panel rules
Updates breakpoints for responsive layout and
centers content with max width on large screens.

Change-Id: I981bdd944047fef13d3805b74fdcedc9e96a4212
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256305
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>
2020-09-23 20:21:57 +00:00
Jamal Carvalho 01500ba3f8 content,internal: add sidenav and mobile nav
Adds the seperated sidenav and mobile nav to unit page.

Change-Id: Iae960e4ff103591d101b6300ccdf70a05d575fe5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256039
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>
2020-09-23 20:21:45 +00:00
Jonathan Amsterdam 235d95262a internal/worker: remove experiment update form if from config
If the experiments come from a config file, they can't be dynamically
updated. So remove the update form on the worker home page.

Change-Id: I1a6dda10570aa7e08b0392af593dfcc6b44cfa91
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/256517
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-22 15:16:18 +00:00
Jonathan Amsterdam bff646bd52 internal/fetch: make a loadshedding struct
Instead of using globals, put all loadshedding state
into a struct.

Also, generalize the names so they're not zip-specific.

This CL address Rob's comments on https://golang.org/cl/c/pkgsite/+/255759/6.

Change-Id: I2200ec45bfc9b2d3dc82aa62b4eb211849d9d9ca
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255979
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-09-21 20:32:09 +00:00
Jonathan Amsterdam 45eb81e124 internal/worker: compute and display stats
Keep track of load-shedding statistics.

Display them on the worker home page, along
with various memory statistics that help
to understand the worker's memory usage.

Change-Id: I6582ffbd2be5c0f4c6c6d1750f489a77922b0ffb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255977
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-18 20:10:28 +00:00
Miguel Acero d24daa283b content/static/css: fix incorrect path in comments
Update comment that points to an incorrect path to the correct one.

Change-Id: Ie7c923cec5afe9c195b71ff8a33c542e1d2816da
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255962
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Julie Qiu <julie@golang.org>
Trust: Miguel Acero <acero@google.com>
Run-TryBot: Miguel Acero <acero@google.com>
2020-09-18 16:17:59 +00:00
Jamal Carvalho 1836aa16cd internal,content: add fixed header and clean up unit page template
Adds the initial unit page port of the fixed nav and restructures
the unit page template to match design requirements.

Change-Id: I49eac0bb3fe5809a5e755b8c7ee925dafdfeb2e0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255598
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-17 19:29:29 +00:00
Jamal Carvalho b7a364fa53 content/static: implements boilerplate for sidenav layout on unit page
Initial scaffolding of double sidebar layout on the unit page.

Change-Id: I99e56956e9a05899bd6308624185f2be259bc87e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255361
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>
2020-09-17 13:57:20 +00:00
Jamal Carvalho 80d96cd5ca content/static: html template and styles for directories section
Creates the html template for the directories section of the unit page.

Change-Id: Ie52a432096d0b7eec9ff6a6b06581954cce92485
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255041
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-16 19:39:45 +00:00
Jamal Carvalho fb6d3f0014 content/static: html template and styles for docs section
Creates the html template for the documentation section of the unit page.

Change-Id: I2d87a1d577b785829441f9e3621a021c442fd01a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255022
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>
2020-09-16 19:31:55 +00:00
Jamal Carvalho 65ae8f792a content/static: html template and styles for readme section
Creates the html template for the new readme. Part of a series of
changes related to the new unit page.

Change-Id: Idbddcd00837aaa399d64aff4ef897d8dd75d0136
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254842
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-16 19:31:22 +00:00
Jamal Carvalho ddc09e6a12 content/static: update "Search Help" button on homepage with a11y fixes
This change adds various a11y fixes and reconfigures the search help button.

Updates golang/go#40624

Change-Id: Ifaad23aca326a8d88b55d0385eed16d32ddea85c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254878
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-16 16:46:50 +00:00
Jonathan Amsterdam c4480d418e content/static/html/pages: link to package-adding instructions on 404
In addition to providing a frontend fetch button, link to the manual
way to add a package.

Fixes golang/go#41347

Change-Id: Iaf767e0cff773ddb9f099067d6bc11e2d6fd25e7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255097
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-16 14:14:02 +00:00
Julie Qiu a594912ed2 Revert "content/static/css: delete unused Documentation classes"
This reverts commit dd6f8882c0.

Reason for revert: these classes are still being used

Change-Id: I996d02b1f4c318f4eb2e1b1710e3492314196eda
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255024
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-09-15 15:15:46 +00:00
Julie Qiu 6a12a42408 internal/frontend: remove tab=doc query param
Previously, requests to pkg.go.dev/<path> were redirected to
pkg.go.dev/<path>?tab=doc.

The behavior is now the opposite: requests to pkg.go.dev/<path>?tab=doc
will redirect to pkg.go.dev/<path>. Requests to pkg.go.dev/<path>
will stay there.

Additionally, requests to pkg.go.dev/<path> will always show the
documentation tab, regardless of whether the package is redistributable.
Previously, users were shown the overview tab when a package is not
redistributable.

Fixes golang/go#37351

Change-Id: Ic7ccbbb840cf04511d419f06eb7fb40ac57f68be
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254745
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-09-15 13:38:12 +00:00
Julie Qiu dd6f8882c0 content/static/css: delete unused Documentation classes
These classes are no longer used and are deleted:

- Documentation-nav
- Documentation-toc
- Documentation-tocItem

Change-Id: I9cc35ffe252c9bd0953e3ffcac90302f03b82977
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254749
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-15 01:54:50 +00:00
Jamal Carvalho 300c31bfb8 content,internal: implement redesigned header for unit page
This is partial implementation of the site redesign. Implements
the new header behind the "unit-page" feature.

Change-Id: I5fdd5c55bb9a9257311f9fd35bafbfab1ea7b7f0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253738
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Trust: Jamal Carvalho <jamal@golang.org>
2020-09-14 20:41:21 +00:00
Miguel Acero 4be2e9ddc1 content/static: add HTML/CSS changes for nested modules in the subdirectories page
This change adds the HTML and CSS changes for the subdirectories
template to include nested modules in the table with a modules badge.
This includes adding a --light-blue CSS variable to reflect the blue
background of the modules badge.

This change also deletes the _directories.tmpl helper template so that
iterating through the packages and nested modules in the HTML table is a
lot clearer.

before/after images: https://photos.app.goo.gl/2reDtNHxThVnDMiL9

Updates golang/go#38596

Change-Id: Id1dad1ba3a28881a203bf90afe1d5372ede2317c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254019
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-11 16:19:25 +00:00
Jonathan Amsterdam e1846b8bb9 content/static/js: prettify analytics.js
prettier seems to want this file to change.

Change-Id: Iccbe119050ebe9cb8d92252892f22581125c199c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254237
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-11 15:29:52 +00:00
Julie Qiu 2589034d31 content: update example searches on homepage
Change-Id: Id6ec4515a3139a581cc36151a0bb65907f9f0e64
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254177
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-09-10 22:48:39 +00:00
Julie Qiu a5c6be2ad4 devtools/cmd/css: moved from content/static/css
content/static/css is moved to devtools/cmd/css (pure code in motion).

Change-Id: I7b48bf017edffb1b4c3c571ed44bac7e09e37918
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253608
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-09 21:13:57 +00:00
Miguel Acero c8f2699f91 content/static/css: remove commented line to enable executable examples
This change replaces display: none; with display: flex; to enable
executable examples in in the documentation page. The HTML changes used
for this CSS change requires the executable-examples feature flag.

Updates golang/go#36865

Change-Id: I2cb62438663ecbfbccfe1f5b4b6b1e2dbe3e3916
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253599
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-09 19:54:11 +00:00
Jamal Carvalho 7ccd23c20a content/static: add rejected promise tracking
Adds a handler to capture rejected promises and
report them to Google Analytics.

For golang/go#40958

Change-Id: Ic0a48d03acbe238bedb2b4eeac7dfb31a8e26d25
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253597
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-09-08 17:26:58 +00:00
Jamal Carvalho f4642ae1ac content/static,internal/middleware: add unhandled exception tracking
Adds a handler to catch unhandled exceptions and report them to
Google Analytics.

Updates golang/go#40958

Change-Id: I9d9a501da4fea2e95a36809535b234a7d2537f02
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/251918
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-09-02 19:14:58 +00:00
Jamal Carvalho 97f55b5d3f content,internal,third_party: adds web vitals script for metrics tracking
Adds the web vitals script built from source to track web vitals metrics
with Google Tag Manager. This will give us more insight into how pkgsite
is performing in the wild and allow us to track changes in performance
before and after the redesign.

Updates golang/go#40958

Change-Id: Ieba237150b6a7056b5dee57911432678bb914b19
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/251537
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-09-02 19:08:33 +00:00
Julie Qiu ecdf6e4d07 content,internal/worker: move VersionStates to /versions page
VersionStats is a relatively costly query, and can cause it the worker
homepage to take a long time to load. This data is moved to the
/versions page instead to reduce latency on the main worker page.

Change-Id: I7273d8244185a2df94b101d2f48174102f2d23de
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/252357
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-09-02 16:55:18 +00:00
Jamal Carvalho 3b43f7523b content/static: fixes search input focus and supports quickfind in Firefox
Fixes search input focus key on detail pages and removes the behavior
in Firefox to support quickfind.

Updates golang/go#41093

Change-Id: Iae0c8fdde0df592e7f9eeac37183b27231bb441c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/252117
Reviewed-by: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-09-01 18:07:41 +00:00
Miguel Acero a611316e91 internal: add GetLatestMajorVersion banner in documentation HTML
This change creates the HTML and CSS changes necessary to show the
latest major version banner.

before (desktop): https://i.imgur.com/YaVw9c8.png
after (desktop): https://i.imgur.com/3XVQPlT.png
before (mobile): https://i.imgur.com/gj54j1o.png
after (mobile): https://i.imgur.com/Xl68EjN.png

Fixes golang/go#37765

Change-Id: I60d6818385c986f9d1ab4dcc8ff663da0e9fe3a3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/251817
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-01 17:45:24 +00:00
Miguel Acero 2a24ee1d3c internal/middleware: change latestversion to latestminorversion
With the inclusion of the latest major version function, this commit
changes current "latestversion" naming to "latestminorversion" in the
latestversion middleware to specify the difference between both
functions.

Updates golang/go#37765

Change-Id: I1c4d8edf6ac30431ef1278abaa334d96cd459258
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/251083
Reviewed-by: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-08-28 13:57:26 +00:00
Miguel Acero 4d82bb1a3f content/static: expand examples automatically when clicked or navigated
This change includes auto expand functionality for examples in
playground.js which is included with the executable-examples feature
flag. This includes:

When users click on an example href that links to an example, the
example will be auto expanded as such:
before example link: https://i.imgur.com/7fSa3E9.gif
after example link: https://i.imgur.com/4dQ4UWO.gif

When a user navigates to a pkg.go.dev url with an example hash (i.e:
?tab=doc#example-AtomicLevel), the example is auto exapnded.
before hash change: https://i.imgur.com/luKw5uo.gif
after hash change: https://i.imgur.com/mzUl33F.gif

Updates golang/go#37520

Change-Id: I6cba5ea979ed516bcdb753eee92eecec7839c2f4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/250467
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-08-25 20:55:57 +00:00
Jonathan Amsterdam 41dc6b274d internal/worker: improve home page
- Fix link to task queue: the URL now includes a location ID

- Remove reference to "etl"

Change-Id: Iaa95e1821afde929e93202dc667fd54b5fd27b54
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/250097
Reviewed-by: Julie Qiu <julie@golang.org>
2020-08-25 18:43:50 +00:00
Rahul Wadhwani 99719cd130 x/pkgsite: fix the width of Subdirectories table
The subdirectories table is overflowing for package
https://pkg.go.dev//k8s.io/kubernetes hence adding a maximum width
to the table.

Fixes golang/go#40946

Change-Id: I6166292fe0d3dfefb634491660f8408addaa3735
GitHub-Last-Rev: ea918f1e1e
GitHub-Pull-Request: golang/pkgsite#4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/249839
Reviewed-by: Julie Qiu <julie@golang.org>
2020-08-22 00:56:00 +00:00
Jonathan Amsterdam 605d451104 content/static/html: restore GTM iframe
Add the iframe that loads Google Tag Manager when JS is disabled.
It doesn't need a nonce.

Fixes golang/go#40321.

Change-Id: I93871833c55aa41185cf5d1c2d5a759937fe79b7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/245557
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-08-21 19:57:46 +00:00
Andrew Bonventre 47151e4cbe content/static,internal: allow fluid width for documentation
This change places the side navigation flush left and allows the
documentation to expand to fill the rest of the page. The
documentation container has a maximum width of 60rem (960px)
and is flush left in the main container when it can no longer
expand.

Also moves tab name strings into constants and documents the
fields on the basePage struct.

Updates golang/go#40612
Fixes golang/go#40557

Change-Id: Ia1be6ffb04d6c8819371ad12f56e133e2167d2fd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/248857
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-08-20 20:13:29 +00:00
Kush Patel 6440758d8a content/static,internal/frontend,internal/middleware: add 'y' keyboard shortcut to canonicalise URL with version
The address bar URL will be updated to be the canonical url of package.
Canonical url includes the module version in address bar.

Fixes golang/go#36807

Change-Id: I4a6f9737ff7e112ebf1d093b2eebe2af311fb0c6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/239179
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-08-20 19:08:49 +00:00