Makes expandAll toggle for ExpandableRowsTableController
optional to fix a type error in unit.ts
For golang/go#43359
Change-Id: I5680283ea71d0aabde3511c76ac8ee39ab288905
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299257
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>
Moves analytics, utm_source and base site code to a new file called
site.ts. This file contains all initialization scripts for pkg.go.dev
that should be run before other scripts are added to the page.
For golang/go#43359
Change-Id: I49dbf7afdaffa9c0638266ae58e1059802936fc1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299251
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
The following is refactored:
* The UnitPage fields Subdirectories and NestedModules are removed,
since they are not needed. UnitPage.Directories is used to determine
if the directories section should be shown.
* The directories section now displays the internal directory at the
bottom of the page.
For golang/go#44356
Change-Id: I3e6f7e3cacf27e129d6d7ea78d7a89e6e58e4be7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296953
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The frontend server tests are currently testing the old directories
section, not the one with experiment directory-tree.
Change-Id: Ieb03cf5ace4fc36ac2ee5ac39086418ff0a12566
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297212
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>
When a module is deprecated or retracted, add a banner to the main
page.
Test with an integration test to verify that the
deprecation/retraction information makes it through the entire
pipeline.
For golang/go#43265
For golang/go#41321
Change-Id: I0ffd1a9d1617e2865a10f0b0a8a8a3af6ed4d420
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296815
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>
ES2020 adds support for optional chaining to the JavaScript
language and has been adopted in all major browsers. However,
support for optional chaining is not universal so we are seeing
some JavaScript errors related to the syntax. Downgrading our
build target to ES2019 to prevent these errors in older browsers.
Change-Id: I7bb08d26ab6fe54a4341db5a517356573bce6e1d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295932
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The example playgrounds now clear the existing output before
printing new output when the Run button is pressed. Ensures
the loading message is cleared when example code produces no
output. Additionally, the output box will now display for all
examples because they are editable. Examples that don't
initially have output can be changed to produce output.
Change-Id: Ie70f98ab505a28705e2ea65869bddb84ef6927ec
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295192
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>
Example playgrounds on documentation pages are
editable and interactive. Below each example code
snippet on the documentation page we’ll display
buttons to run, format, and share the snippet.
Pressing run displays the result output below the
code snippet, format will reformat the code inline
and share will display a share link below the code
snippet and open the playground in a new window.
For golang/go#44090
Change-Id: I56d635e60a89a382974ef7100eb4348dbbb4b893
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293833
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Copies body.tmpl and example.tmpl into legacy files to
prepare for interactive playground related updates.
For golang/go#44090
Change-Id: I2b7650693d3f3cc373c9a757048e0442ce37f1be
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293830
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>
Instead of using middleware to replace information about latest major
versions in the HTML, insert them in the usual way, via templates.
This is possible because the worker invalidates the cache when a new
latest version comes in.
Delete the latest-version middleware.
Fixesgolang/go#44210
Change-Id: I348a25d6b8777bad555e034d38ddb4137eb6ff18
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293009
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Handle the logic of the redirect banner in the ordinary serving path,
instead of using a middleware layer.
To make this work, we have to bypass the cache when the redirect
cookie is set, so we don't cache the page with the banner.
For golang/go#44210
Change-Id: I145f058373980ff9e5d3617529e849b25161b390
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/292489
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>
Remove the $$ substitution for the latest-minor CSS class.
Instead, determine the class on the normal serving path.
This is possible because the worker invalidates the cache when
processing a new latest version, so pages will not be stale
even though they are cached.
For golang/go#44210
Change-Id: Ide18e8257369810cd98f0b7d4fb41b75af961b83
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/292492
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>
The versions page is updated to:
- Display incompatible versions in a separate section
- Remove minor versions of other modules
A version.IsIncompatible function is added to the internal/version package for determining
if a version is an incompatible version.
Mock: https://photos.app.goo.gl/wWEFsMrmtaxggTAk7
Change-Id: I9a1c533066c3ea8b3f9f9b65f9bd171290655b5e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288762
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>
The package synopsis for each package on the search page is limited to
two lines. An ellipsis is displayed on the second line if the synopsis
is longer.
Fixesgolang/go#44174
Change-Id: I8484a3defeea23285e47e6e15de3d2d4595aca26
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290549
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>
The jump to dialog stopped rendering as expected
in FireFox and Safari. Adjusts position and styles
so the dialog elements appear above the main content
on the page.
Fixesgolang/go#44077
Change-Id: I9f5776c3d1ac4a042a9a0d3b7ba8b16fee5acc82
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290191
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>
Migrates playground.js code to TypeScript in preparation
of enhancements to the example playgrounds.
Change-Id: I185e9fe05c0e7bf3deb683f1583f9a26b4960237
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288991
Trust: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
If it is not all/all, show the build context at
the bottom of the documentation.
This is just a preliminary implementation, so users
can experience the feature before we provide a proper UI.
For golang/go#37232
Change-Id: Ic48a246a8793e61917a31f66580249997255ba77
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290095
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
When loading the imported by page, fetch the imported by count from
search_documents.num_imported_by, instead of limiting at 20,000.
This will use the same logic for the imported by count with the
main page and search page.
For golang/go#39138
Change-Id: Iae188d01129b6e35cfd82b79e51a0ef12938c459
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288849
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>
The names in the page type labels in the header are lowercase. Also
lowercase "module" in the label in the directories section to match.
Change-Id: I55e497ced0a8c32994487cb8939107ba795d651a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288911
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>
This change supports the table of contents section
in the overview section of command pages. This helps
give us feature parity with command pages on golang.org.
Fixesgolang/go#38073
Change-Id: I396fcebbc569d046fc6ca7bf8beed037c9321a1b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288553
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>
Adjusts layout of header detail items for mobile display sizes.
Removes the vertical bars after each item and lays the items out
vertically.
Change-Id: Ifba829524d0d30a2c6e5a29a5c7c179a91cdd584
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288152
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
Now that the directory tree layout is active we can
re-enable target highlighting.
Fixesgolang/go#43773
Change-Id: Ie29c5428e18938b8b99fd3920b3b17ca3f448965
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/287635
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>
Delete the GodocURL middleware since it is no longer needed.
Change-Id: I24b717e4d060ed19320e778afae6803b5404e49f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/286512
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
Requests originating from gopls and redirected from godoc.org have a
"utm_source=gopls" and "utm_source=godoc" query param in the URL,
respectively.
If we see this, we will strip the query param on page load, so that so
that it doesn’t remain in all our URLs coming from these sites.
This is done to page load so that requests are still sent to GA with
these utm_sources intact.
For golang/go#42602
Change-Id: I63defcb50ba54b1e476de0f0db63c23494000046
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/270800
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>
Add `position:fixed` in `.Dialog` class to make appearance of both
`.JumpDialog` and `ShortcutsDialog` consistent
Fixesgolang/go#43877
Change-Id: I9a1940455251ae057f53e1dbb210854e4cd203a1
GitHub-Last-Rev: 30611f1b21
GitHub-Pull-Request: golang/pkgsite#22
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/286092
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
add `position:fixed;` to `.JumpDialog` class to always keep it on visible viewport even if the page is scrolled.
fixesgolang/go#43840
Change-Id: Id692319fff66cd26453acbf50000da92e9f6e373
GitHub-Last-Rev: 47879a522f
GitHub-Pull-Request: golang/pkgsite#21
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/285674
Trust: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Use "redistributable" instead of "permissive" because it is more accurate.
For golang/go##43758
Change-Id: I13b7d11002ba740bc2729133db6579ad31d059ca
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/284234
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>