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

577 Коммитов

Автор SHA1 Сообщение Дата
Julie Qiu f23d417b0f content,internal: add redirected from banner
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.

Fixes golang/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>
2021-01-19 14:59:49 +00:00
Julie Qiu 6de9ee3544 content/static/css: hide highlight CSS on anchors
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>
2021-01-19 14:48:02 +00:00
Jamal Carvalho 29b3091570 content/static: run stylelint fix on css files
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>
2021-01-19 14:08:49 +00:00
Jamal Carvalho 59d3285af8 content/static: update responsive layout of header and details section
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>
2021-01-15 21:33:55 +00:00
Jamal Carvalho 65736d22ee content/static: remove intermediary page layout
Removes the 1023 — 832px page layout to prepare
for new responsive page layout for tablet or smaller
screen size

Change-Id: I7897b4430e013b72f43653c7b15de611bc06576b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/284195
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2021-01-15 21:32:50 +00:00
Jamal Carvalho 3ad1231171 content,internal: fix anchor target links for constants and variables
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.

Fixes golang/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>
2021-01-15 21:06:09 +00:00
Jamal Carvalho 5b7305cfbe content/static: simplify and update target behavior to match godoc
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>
2021-01-15 21:05:55 +00:00
Jamal Carvalho d97e5ef760 content/static: fix nav tree bug in sidebar
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>
2021-01-15 16:36:08 +00:00
Jamal Carvalho fb38b64431 content/static: run prettier on table.js
Change-Id: I1e5e7b72280e621b57778968488b06e170613f29
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283953
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-01-14 21:36:45 +00:00
Jamal Carvalho fad54382f9 content/static: unit directories tree layout
Updates unit directories section to nest subdirectories
in a two level tree structure.

For golang/go#43694

Change-Id: I374c042234aeb426b24ae44c861bfb61e6511db1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/283715
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: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-01-14 17:08:53 +00:00
Julie Qiu b907762fd5 content: delete unit-sidebar-details and unused experiments
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>
2021-01-12 16:09:23 +00:00
Jamal Carvalho ed59347142 content/static: styles for view source link in code snippets
Fixes golang/go#40939
Fixes golang/go#42486

Change-Id: I9937dc3b0c9f27b1324c7fd144ed658caa56d539
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/282072
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-01-11 15:29:21 +00:00
Jamal Carvalho e53c610ccf content/static: update styles for not at latest flag
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>
2021-01-08 18:31:22 +00:00
Jamal Carvalho 2b20326fa5 content: simplify content directory structure
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>
2021-01-08 18:30:54 +00:00
Jamal Carvalho db2e9f3344 content: remove postcss processed styles
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>
2021-01-08 18:30:37 +00:00
Julie Qiu 6194055fb0 Revert "content,internal/frontend: add redirect banner for alternative modules"
This reverts commit bdfe56fa17.

Reason for revert: caching issues

Change-Id: I3273b3f79bf7fc9d41e24c95ef0633328a622c09
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/282123
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
2021-01-07 17:56:49 +00:00
Julie Qiu bdfe56fa17 content,internal/frontend: add redirect banner for alternative modules
When a request is redirected from an alternative module path, a banner
is added which displays that result.

Fixes golang/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>
2021-01-07 02:47:43 +00:00
Jamal Carvalho 2ba3da7947 content,internal: remove goldmark and readme-outline experiments
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>
2021-01-06 17:24:24 +00:00
Jamal Carvalho 79b22c6944 content,internal: badges form improvements
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.

Fixes golang/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>
2021-01-06 17:22:14 +00:00
Jamal Carvalho f04319e8d9 content/static: transform unit page css with postcss
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>
2021-01-05 23:57:21 +00:00
Jonathan Amsterdam 9402fb1b4b content/static: use warning image for not-at-latest badge
Change-Id: I7297888faa43a165818a7a207ac51abca3fe1d07
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/280623
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>
2021-01-05 16:32:45 +00:00
Jamal Carvalho 47d0537e4d content: move clipboard.js code to content/ts
Migrates CopyToClipboardController to TypeScript
and adds a unit test.

For golang/go#43359
For golang/go#43361

Change-Id: I2e1179aa7cecb0e280a57d420ee2f885c4d6db3c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/280893
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2021-01-05 15:59:00 +00:00
Jonathan Amsterdam ab708d049d content/static: display NotAtLatest badge
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>
2021-01-05 15:24:13 +00:00
Julie Qiu 5cf9f100a9 content: wrap functions and methods
Overflow fext for functions and methods are now wrapped.

Fixes golang/go#43368

Change-Id: Ieb5aa88ddda918a94333724880dfaa4317674fbd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/279726
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-12-28 18:53:09 +00:00
Julie Qiu f5ca8b02c5 content,internal: delete autocomplete code
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>
2020-12-22 14:54:15 +00:00
Baokun Lee 9bb8e5c33b content/static/css: make pages more printer-friendly
Fixes golang/go#43238

Change-Id: Ice5386fc7e0293fbfa831069ae9e23526d5893e2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278873
Run-TryBot: Baokun Lee <bk@golangcn.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-12-22 03:56:22 +00:00
Julie Qiu d2e7228342 content/static/html/helpers: fix links header
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>
2020-12-17 05:07:15 +00:00
Julie Qiu a4719aeffd content/static: CSS updates to right sidebar
CSS updates are added to right sidebar:

https://photos.app.goo.gl/YYuu8mvNSLP5yxe89

Change-Id: Id9e990ecac7da43d7f3334d1a37b9068f283e25e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278754
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-12-16 21:50:16 +00:00
Jamal Carvalho 240d26d25a content/static: style fixes for sidebar details section
Adds responsive styles to sidebar details
to prevent overflow issue on smaller screens.

Change-Id: I1b8da3830e7bdd8a4311c3d71c1066dcfb22d944
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278536
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-12-15 23:26:40 +00:00
Jamal Carvalho 99f531baf1 content/static: update copy in sidebar details section
Changes "Has go.mod file" to "Valid go.mod" file.

Change-Id: Ib6820f16fb257c3e15da69d00dddfc099de75809
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278533
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-12-15 22:22:23 +00:00
Maia Lee 635c5a975a content/static: improve alt text for image tags in header/footer
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.

Fixes golang/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>
2020-12-15 21:17:08 +00:00
Alex Hays 957d9d02d1 internal/frontend: make links on 404 => Request page clickable
If the user arrives at the 404 page and clicks the
Request <package-name> button, there are two possible
responses from fetch.go that contain links. This
makes those links clickable.

These URLs show these two locations upon clicking Request:
https://pkg.go.dev/github.com/google/go-cloud@v0.20.0
https://pkg.go.dev/github.com/hashicorp/vault/@master/api

Fixes golang/go#40306

Change-Id: I1dacc8ad3a7337a3c02079381ab454a1678cc681
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277117
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
2020-12-15 21:16:03 +00:00
Julie Qiu 553d8719ce content/static: add source code link HTML
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>
2020-12-15 20:46:54 +00:00
Maia Lee 2b3da7da48 content: fix UX issue with highlight above "Discover Packages"
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.

Fixes golang/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>
2020-12-15 15:11:11 +00:00
Jamal Carvalho 10f755d2f8 content/static: update experiment name in unit_meta.tmpl
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>
2020-12-14 21:05:46 +00:00
Julie Qiu 5f73b018d1 content,internal/godoc/dochtml/internal/render: move pre tag to tmpl
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>
2020-12-14 19:22:12 +00:00
Jamal Carvalho 69dd2296af content/static: additional metadata in the right sidebar
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>
2020-12-14 17:56:01 +00:00
Julie Qiu 21cccc17ed content,internal/godoc/dochtml: add declaration.tmpl
Logic for rendering code snippets from the output of render_decl is
moved to a helper template.

The </br> tag is removed for the Constants and Variables sections:
https://photos.app.goo.gl/FosXd66T3nfufaXf7

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

Change-Id: Icfe61be5f164e0be54e5357602477fc9ed24b05d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277632
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
2020-12-14 16:59:27 +00:00
Jamal Carvalho 1556c6bf5b content/static: add new svg icons for sidebar details section
For golang/go#43129

Change-Id: I5b5231270efc298186e84444fc72241416888376
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277852
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-12-14 16:41:19 +00:00
Julie Qiu e2000c72b9 content,internal: check latest minor version in tests
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>
2020-12-14 15:45:23 +00:00
Julie Qiu 410a3bac6b content,internal: change TestServer to differentiate between latest minor and latest major
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>
2020-12-14 15:45:18 +00:00
Julie Qiu 5c340b5c8b content/static/html/pages: change tabs to spaces
Tabs in templates are replace with two spaces.

Change-Id: I9561dd3e0bec9f45e2bf158156ee9e3ec176a7e6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277494
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-12-14 14:28:03 +00:00
Julie Qiu 4f339b46e0 content/static/html/doc: change tabs to spaces
Tabs in templates are replace with two spaces.

Change-Id: If3bf45e5fcd5d71fde263cd31f36da9651951c8c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277493
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-12-14 14:27:51 +00:00
Jamal Carvalho bd196e9f58 content,internal: add page descriptions to unit main pages
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.

Fixes golang/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>
2020-12-10 16:35:36 +00:00
Charlotte Brandhorst-Satzkorn 69b3ffd964 internal: direct user to latest major version in current package
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.

Fixes golang/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>
2020-12-08 18:30:19 +00:00
Jonathan Amsterdam 28e964bf4b internal/frontend: show module readme links in sub-units
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>
2020-12-07 20:34:35 +00:00
Jamal Carvalho fd734f2d17 content/static: fix spacing between links in right sidebar
Screenshot: https://photos.app.goo.gl/djZcwfA8mDtRGQzy7

Change-Id: I5b62d37b4a62da6b10958746ff1bee9eff4cd806
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275876
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
2020-12-07 19:36:49 +00:00
Julie Qiu 7f241d37d8 internal/frontend: add .svg suffix to badge URL
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>
2020-12-04 21:49:12 +00:00
Julie Qiu bf87d50d50 content: update badge snippet alt text
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>
2020-12-04 21:48:48 +00:00
Jonathan Amsterdam f800db3a85 internal/frontend: display godoc links
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>
2020-12-03 20:27:34 +00:00
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