A banner is now displayed when a request is redirected from pkg.go.dev
to another path.
This is used when redirecting requests for alternative module paths and
paths not in the v1 module.
Fixesgolang/go#43693
Change-Id: I46c342f6b6def8b70461e43bde2ce844292a58dc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283716
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
When visiting a #section-directories anchor tag, the entire section will
turn yellow.
This CSS is commented out for today's deploy.
For golang/go#43773
Change-Id: Ic9c26845203c6518a368ea19af36c42a21958354
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/284572
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Runs stylelint --fix on stylesheets. Most of the changes
are reordering css properties.
Change-Id: I8431371f6bc0c54a081de58f36ee913e526d9115
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/284197
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamal@golang.org>
Improves flow of items in the header and makes the content
in the right sidebar visible on smaller screens.
Change-Id: Ia5dd9a978e7f82c3f538bffa265222b3aa883c09
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/284196
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
This change adds content to anchor links for package scoped
constants and variables and scroll padding to code blocks to
fix the issue where items selected from jump to identifier or
navigated to directly by page URL would appear off-screen.
Fixesgolang/go#38575
Change-Id: I19a197be46b7e5f444e03e2a0a03146bf92cc953
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283955
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Anchor link targets were given artificial height with a negative
margin to make their content appear below the fixed header. When
attempting to highlight links this caused a large area above the
identifiers to be yellow as well as the text. A new CSS feature,
scroll marging, is used instead.
Highlights do not appear on consts, vars, and fields because their
targets contain no content. A separate change will address this
issue.
Change-Id: I795919cf29ebfa5c127dc1993458beba5b2ad9ba
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283952
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Theres a bug in the navtree where if the README
headings are expanded and the jump to identifier
tool is used, both the README headings and the
documentation headings will be visible. This change
closes the inactive top level nav when a new item
is selected.
Change-Id: I3c88f0654039bb3b7ca1725f0c02918a3780061d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283956
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>
There are several unused experiments in the templates that have been
fully rolled out and are now deleted.
Change-Id: I603c5e56c24406f718b02e68109b46c347657a75
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283258
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
Fixes the styles for the warning indicator on the
'LATEST' badge that appears on package when it no
longer exists in the latest version of a module.
Change-Id: Id8a7ecbde246760875a7fccb4b2fc7350db319e8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/282122
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>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Removes separate directory for TypeScript files and
updates frontend tools to match updated directory
structure. TypeScript files will be co-located with
the JavaScript files making easier to identify files
that have already been migrated to TypeScript.
Change-Id: I4deb5b22c550fc34c98529bbe19bec6d28759a02
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/282377
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>
Removes PostCSS cli dependency and minified CSS files.
Reverts the changes from https://golang.org/cl/281772
to simplify the development process for CSS files. We
may revisit minifying and bundling CSS with a Go package
in the future.
Change-Id: I34936eefc0d9aced9a13badace2c950f53ac84da
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/282376
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
When a request is redirected from an alternative module path, a banner
is added which displays that result.
Fixesgolang/go#43518
Change-Id: Ifed01073561b5a55a053c626691cfc176d936440
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/281678
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>
Now that goldmark and readme-outline experiments are fully
rolled out we can remove related legacy code.
Change-Id: Ibb1a653726a4a58d5a26b2db308778a0c5ddcffc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/281674
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>
Updates badges form to mirror behavior of search input.
If a module url is entered with an http(s):// prefix
the prefix will be stripped and the resulting path is
used in the badge URL. Removes the interactive update
in lieu of an update button after the badge has been
created. Live updates with our scheme removal logic
lead to a strange experience when changing urls after
a badge was already created.
Fixesgolang/go#43458
Change-Id: I1732a3eeb54f475c90f0b6f5f2976fb25cbfe039
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/281712
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
This change moves pkgsite page styles to lib/css directory
and writes processed and minified css to static/css.
For golang/go#43360
Change-Id: I42d61f4a270e3cde5016c6063555eb037f35c302
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/281772
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Display a variant of the "latest" badge when the unit is not
in the latest version of the module.
For golang/go#337631
Change-Id: I82aa30711f1f1e162e44fd1db9195c6e05718de1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/280612
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: Jamal Carvalho <jamal@golang.org>
Autocomplete no longer works in dev, and the experiment is not active
in any other environment.
Change-Id: I8865539862a4d1b84bf91641e7662d4926d30488
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/279133
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
At the moment the "Links" header is always displayed. It should only be
displayed if there are links.
Change-Id: I212083e1b1b4a085b6a5511348fdd0c88a491929
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278757
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 modifies alt text for the header and footer logos. The goal
of this change is to make the alt text more descriptive of the image
being shown on the page.
Fixesgolang/go#41104
Change-Id: Ifda884be828a12712b4c7741ea646d3ef9e58cb5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275938
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
The HTML for the source code link is added. The style is set to
display:none, and will be styled in a future CL.
There are no user facing changes in this CL.
For golang/go#40939
For golang/go#42486
Change-Id: I01ba3ead6b2d0a9ea7dc1488d3b9f5eadb33d472
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278434
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
This change modifies the CSS for the header tabs. The goal of this
change is for improved UX design and to provide a clearer connection
between tab highlight and page content. Tab position is changed from top
to bottom and tab hover color is changed from red to white.
Fixesgolang/go#39847
Change-Id: I26c96ba538fbefbfa7ffbc61809fa0e5d872d725
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275952
Trust: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
The unit-meta-details was renamed to unit-sidebar-details.
This change adds that update to the unit_meta.tmpl file.
Change-Id: Ia54f56ee0fdde22e4686d44a14cad3ea1af3fd71
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277960
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
The $out.decl <pre> tag is now generated in the declaration.tmpl,
instead of as a string concatentation in formatDeclHTML.
This will make it easier to style this element in a future CL.
For golang/go#40939
For golang/go#42486
Change-Id: I2f5c0a339020deac002ed32a12ccf68f691cba8f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277633
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>
Adds a section to the right sidenav highlighting
metadata about modules to help reinforce best practices
for maintaining modules on the pkgsite. This feature is
implemented behind the "unit-meta-details" experiment.
For golang/go#43129
Change-Id: I2755756b10f5cb1b1d1a2f9caf42c90fc715ff3b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277854
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Previously, UnitHeader was not validating that the header had the
correct latest minor version. This check is now added and tests are
updated accordingly.
Change-Id: Ia46914a38c71a74130d5b5801b03539ad67a4c83
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277692
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 pagecheck.Page.IsLatest field is split into IsLatestMajor and
IsLatestMinor.
The class UnitHeader-versionBanner is also renamed to
UnitHeader-majorVersionBanner.
Change-Id: Iae3dacfba739c70b0606c264c3e2cba258839872
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277675
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>
Adds page descriptions to the unit main pages
by using a safehtml escape hatch to build the
HTML meta tag manually. This a workaround for
a safehtml limitation.
See: https://github.com/google/safehtml/issues/6.
Fixesgolang/go#40752
Change-Id: I021e77bd2d01bb435751d353b809087ce818f57d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275874
Trust: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Currently, the pkgsite allows the user to click a link to be taken
to the latest major version for that module. When a user is in a sub
package, clicking this link transports them to the top of the
directory, rather than the latest major version for that package.
Changes the behaviour of the link by directing to the latest
major version of the currently viewed package. If the package
does not exist in the latest major version, it falls back to
the root of the module.
The direct proxy datasource implementation does not attempt to
perform this resolution and maintains the current behaviour.
Fixesgolang/go#42292
Change-Id: I6c17978034f87ceddb0edeae3894ce2cd4913fd2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274413
Trust: Julie Qiu <julie@golang.org>
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Show a module's README links on all units within the module.
For golang/go#42968
Change-Id: I8701a04a16e1dd766b1b23ce12d52d01190840fd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275276
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>
A .svg suffix is added to the end of the badge image URL path, to
indicate that the link is an SVG image.
Test for "?tab=imports" in TestBadgeHandler_ServeBadgeTool are now
deleted, since that use case is no longer supported.
Change-Id: I1f159dad37abe94c5e3ce6f9b65f3b36cec977bf
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275435
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
The alt text is changed from PkgGoDev to "Go Reference" to match the
alt text with the badge text and improve accessibility.
Change-Id: I53edeb706fa802a5a347004345fea60987f306ff
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275304
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>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Display the links from the godoc "Links" section in the right sidebar.
For golang/go#42968
Change-Id: Ibf21a74133e10ed4c7b5a310e85999f590938c6a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/274958
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>
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>
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>
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.
Fixesgolang/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>
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>
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>
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>
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>
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>
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.
Fixesgolang/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>
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>
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>
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.
Fixesgolang/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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>