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

577 Коммитов

Автор SHA1 Сообщение Дата
Jamal Carvalho 28ae1d368e content/static: rewrite worker.js with typescript
For golang/go#43359

Change-Id: I3322816e860f7107dee9ab49f85c891af920242a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/300070
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamal@golang.org>
2021-03-09 18:24:25 +00:00
Jamal Carvalho c9a527b474 content/static: rewrite sidenav.js with typescript
For golang/go#43359

Change-Id: Icd5d9bdf06694e823b898d7972ba2fb697454896
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/300069
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-09 17:42:56 +00:00
Jamal Carvalho 5b10f690a0 content,third_party: remove unused JS files
For golang/go#43359

Change-Id: Ib2aed959229e630fc779534859121ced469054a9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299261
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>
2021-03-08 15:59:41 +00:00
Jamal Carvalho 9a9d5ef0fc content/static: rewrite unit.js with typescript
For golang/go#43359

Change-Id: I4256144908205463a70a6bd1b6c8b5b751ec2cc6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299260
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-08 15:59:37 +00:00
Jamal Carvalho c8014eb244 content/static: rewrite unit_fixed_header.js with typescript
For golang/go#43359

Change-Id: Iae32a7872f207abd7b2667097ac1d3e57f4bbd92
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299259
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>
2021-03-08 15:59:33 +00:00
Jamal Carvalho 9826220f9b content/static: rewrite toggle-tip.js with typescript
For golang/go#43359

Change-Id: Ifca0779ae6a949c06c765b20d7a3e0f1c591f60a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299258
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>
2021-03-08 15:59:29 +00:00
Jamal Carvalho bc3f77d9ae content/static: fix unit page type error
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>
2021-03-08 15:59:24 +00:00
Jamal Carvalho d8cbc4f9d7 content/static: rewrite keyboard.js with typescript
For golang/go#43359

Change-Id: I5d5331c5aa072650bb97d4bf70c6a1df00a3602f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299256
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-08 15:59:20 +00:00
Jamal Carvalho b56d986367 content,internal: rewrite jump.js with typescript
For golang/go#43359

Change-Id: I4ceef713fac50cf69ca4f79954a0a9bdb932f1d8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299255
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>
2021-03-08 15:59:16 +00:00
Jamal Carvalho 4155e54eb9 content,internal: rewrite fetch.js with typescript
For golang/go#43359

Change-Id: Id668a6e7c307233b55388235bbc5011a339e5680
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299254
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>
2021-03-08 15:59:12 +00:00
Jamal Carvalho 60231949ce content,internal: rewrite badge.js with typescript
For golang/go#43359

Change-Id: I48e21ddecb5a26e28d112f0ede5779ec599b8b4f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299253
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>
2021-03-08 15:59:07 +00:00
Jamal Carvalho fda88804ce content,internal: consolidate smaller JS scripts into sitewide entry file
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>
2021-03-08 15:58:55 +00:00
Jamal Carvalho 277cf832bf content/static: print message on playground error
Error messages were being overwritten with an
empty string. This change ensures error messages
print to the playground console.

Change-Id: Ia47626fd675e2347bbbe8040a62babec28d600b4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299250
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-03-05 21:40:29 +00:00
Jamal Carvalho cc2e324ca4 content/static: make playground share links update with edited text
Fixes golang/go#44719

Change-Id: Iedfa4d677b5512f9e140fc647ef6144517e697c1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297874
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-03-03 16:44:35 +00:00
Jamal Carvalho 541bb3e3a3 content/static: fix directories expand toggle click target size
Fixes golang/go#44721

Change-Id: Iae116be9759c506975c81d4b1b1a0ea7add21cdf
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297873
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-03-03 16:44:28 +00:00
Jonathan Amsterdam 5c56ea46d3 content/static/html: gate deprecated/retracted by experiment
For golang/go#43265
For golang/go#41321

Change-Id: Ie0296d9a00c188621029252f6f91109860a1a0bc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297529
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-02 13:42:53 +00:00
Jonathan Amsterdam 901f4fe0bf internal/frontend: add deprecated/retracted info to versions
For golang/go#43265
For golang/go#41321

Change-Id: I1c53af8cd04ec0d3d2b13874cd028a3f97b5101b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297509
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-02 13:42:48 +00:00
Julie Qiu 4ffe3ca24b content,internal/frontend: refactor directories section
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>
2021-03-01 17:00:57 +00:00
Julie Qiu b031c16de3 content: delete legacy_unit_directories
Change-Id: Ida13b26d63a1c2d627b4eceb9648f08d960d818b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297210
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-03-01 16:59:59 +00:00
Julie Qiu efb0c4dfd7 content,internal/frontend: fix directories tests
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>
2021-03-01 16:59:51 +00:00
Julie Qiu 5382f3daf4 content/static/html/helpers: split directory template
A helper template is added to _unit_directories.tmpl.

Change-Id: Ia378ffc1f477be4e0f1e2f3f9ba81291249565c4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297209
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-03-01 16:59:38 +00:00
Jonathan Amsterdam e8cda2f832 content/static: add deprecated and retracted banners
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>
2021-02-26 20:47:12 +00:00
Jamal Carvalho 41ca6b309e content/static: fix null reference error in jump.js
Change-Id: I2acdf9ac7f0ba697f3de7fb0b8f5568ec0f852f5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295969
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-02-25 16:04:19 +00:00
Jamal Carvalho f5b8213723 tsconfig,content/static: change TS build target to ES2019
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>
2021-02-24 18:46:28 +00:00
Jamal Carvalho dc9827cf06 content/static: fix directory indentation
Fixes golang/go#44399

Change-Id: I298986d2219a6c8333bfa7d49cb0bed9818f59e0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295591
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>
2021-02-23 20:36:02 +00:00
Jamal Carvalho 60c442b37e content/static: example playground output fixes
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>
2021-02-23 16:41:44 +00:00
Jamal Carvalho f27d2df993 content/static: interactive example playgrounds
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>
2021-02-22 15:54:52 +00:00
Jamal Carvalho 4fdd4a386f content/static: copy dochtml templates into legacy files
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>
2021-02-22 15:54:12 +00:00
Jonathan Amsterdam 4306f9590a internal/frontend: do latest-major-version logic in main serving path
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.

Fixes golang/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>
2021-02-19 18:55:45 +00:00
Jamal Carvalho 19ae0765f7 content/static: fix null reference errors in unit.js
Fixes golang/go#43434

Change-Id: I0af7549c9acdb16202d6d77ca2993eea6cb35f7f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293841
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-02-19 17:20:26 +00:00
Jonathan Amsterdam 7abdc20687 internal/frontend: handle redirect in main serving path
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>
2021-02-17 14:24:52 +00:00
Jonathan Amsterdam 9fad5fb2a4 internal/middleware: remove latest-minor-class substitution
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>
2021-02-16 20:58:55 +00:00
Julie Qiu 84574e5b8d content,internal: update versions page
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>
2021-02-12 21:21:49 +00:00
Julie Qiu c8d7045b9b internal/frontend: limit synopsis on search page
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.

Fixes golang/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>
2021-02-09 16:32:45 +00:00
Jamal Carvalho d6e3fd9139 content/static: fix jump to dialog positioning
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.

Fixes golang/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>
2021-02-08 22:29:43 +00:00
Jamal Carvalho 12cbd43747 content/static,devtools: migrate playground.js to typescript
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>
2021-02-08 18:08:24 +00:00
Jamal Carvalho 54d798018a content/static: directory tree fixes
- Reduces padding inside of directories rows.
- Directories expand when entering text search.

Change-Id: Idba574f0b6ca71d6bb940553f2a3e727b07218ef
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290070
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-02-08 17:54:13 +00:00
Jonathan Amsterdam 4c18cf855d internal/frontend: show build context on doc page
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>
2021-02-08 17:35:39 +00:00
Jamal Carvalho 6ddc1f3f3b content/static: remove highlighting from doc examples
Change-Id: Ifbc3675b3f6035fb90469daa1c66a239dc4ff346
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288990
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-02-03 16:38:32 +00:00
Julie Qiu 24f7a58013 content,internal/frontend: update count on importedby page
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>
2021-02-02 19:57:36 +00:00
Julie Qiu c87e85bce1 content/static/html/helpers: lowercase module in directories section
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>
2021-02-02 19:57:21 +00:00
Jamal Carvalho a9a10d0c1d content,internal/godoc: add table of contents to command pages
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.

Fixes golang/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>
2021-02-01 22:48:37 +00:00
Jamal Carvalho 55ac839594 content/static: responsive design updates
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>
2021-02-01 16:05:07 +00:00
Jamal Carvalho 7588e3daea content/static: re-enable target highlighting
Now that the directory tree layout is active we can
re-enable target highlighting.

Fixes golang/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>
2021-01-28 20:35:08 +00:00
Julie Qiu 34b331ad78 internal/middleware: delete GodocURL
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>
2021-01-26 15:56:29 +00:00
Julie Qiu 4da3fcf7c7 content/static: strip known utm sources on page load
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>
2021-01-26 15:48:54 +00:00
Omkar 283cc4fc7c content/static/css: make .Dialog's position fixed
Add `position:fixed` in `.Dialog` class to make appearance of both
`.JumpDialog` and `ShortcutsDialog` consistent

Fixes golang/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>
2021-01-25 21:11:18 +00:00
Jamal Carvalho 8703e010fc content/static: add whitespace to fix lint error
Change-Id: Ibd3e9dc0e07752b196905a8b5788e802b8bcb03b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/286392
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-25 20:52:57 +00:00
Onkar Jadhav 134df66487 content/static/css: make .JumpDialog's position fixed.
add `position:fixed;` to `.JumpDialog` class to always keep it on visible viewport even if the page is scrolled.
fixes golang/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>
2021-01-22 15:49:30 +00:00
Jonathan Amsterdam 5b39ce470f content/static/html: use the term "redistributable"
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>
2021-01-19 15:44:17 +00:00