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

72 Коммитов

Автор SHA1 Сообщение Дата
Julie Qiu b158f01f45 all: add tool for enabling all experiments
A script is added to create an experiment.yaml file which will enable
all experiments.

Documentation on how to enable experiments is consolidated in
experiment.md. Instructions on how to use this script is added.

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

Change-Id: I860e4512a5ff281a6d53210293cb310d5c5e074c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258257
Trust: Miguel Acero <acero@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-10-07 17:19:48 +00:00
Jonathan Amsterdam 89cffa002d devtools/cmd/experiment: remove
Experiments are now managed via a YAML config file.

Change-Id: I8c70e14bcbdcf3372994b80b1fa420fcbc5232f0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259839
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-10-06 18:46:50 +00:00
Miguel Acero 4f2b555c55 devtools/cmd/css: update incorrect relative path
Change-Id: I8331a06e4f5d0dfb3b9dee1e9b6d8de2add25bc6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/255967
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Miguel Acero <acero@google.com>
2020-09-18 20:43:54 +00:00
Julie Qiu 88f8a28ab2 devtools/cmd/css: various fixes
Package documentation is added to devtools/cmd/css and the css filepath is fixed since being moved from content/static/css.

Change-Id: I4f12513a26c273e605a57c8101a1ed06f72e1b23
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253609
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-09 21:14:02 +00:00
Julie Qiu a5c6be2ad4 devtools/cmd/css: moved from content/static/css
content/static/css is moved to devtools/cmd/css (pure code in motion).

Change-Id: I7b48bf017edffb1b4c3c571ed44bac7e09e37918
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253608
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-09-09 21:13:57 +00:00
Julie Qiu 909213404b cmd,internal: clean up package documentation
Several packages were missing package documentation, which is now added.

Change-Id: I1a88ebebaee0fddeb5a7bb9e2573375ad887c311
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/253607
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-09-09 21:13:21 +00:00
Kush Patel 6440758d8a content/static,internal/frontend,internal/middleware: add 'y' keyboard shortcut to canonicalise URL with version
The address bar URL will be updated to be the canonical url of package.
Canonical url includes the module version in address bar.

Fixes golang/go#36807

Change-Id: I4a6f9737ff7e112ebf1d093b2eebe2af311fb0c6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/239179
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2020-08-20 19:08:49 +00:00
Andrew Bonventre 98472f3dd8 content/static,devtools,internal: update header to spec
This change implements the latest designs for the site header,
adds a new fixed header to details pages, and updates to the
latest Closure Compiler Docker image tag to support an API used
by the new fixed header implementation (ResizeObserver).

The global header is no longer sticky, but on the details page
a hybrid header that shows a combination of the header content
and details tabs is displayed when the inline tab list goes out
of view.

Both the inline and fixed tab lists are responsive in that the
elements are pushed to an overflow container when they can no
longer fit on screen. A native <select> tag is used for this to
avoid implementing a popup menu (perhaps that can be done in a
future change).

The mechanism used to copy the current path to the clipboard has
also been updated to avoid hacks that didn’t play well with
screen readers. This method does not work on iOS, but a message
is displayed to the user in that case.

Fixes golang/go#37110

Change-Id: I2b8b73d7e85c122992b106e9b89d7e207be9f099
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/245400
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-07-30 19:31:21 +00:00
Miguel Acero 11298021f9 content/static,internal: add JS functionality to the new embedded playground
This CL implements a "play button" for each example in a given package
that redirects to play.golang.org.

This code is based on https://golang.org/lib/godoc/playground.js, it was
modified to remove the dependence on jquery and bootstrap, as well as
removing DOM creation to prevent jittering of the website.

Example behavior: https://i.imgur.com/NcGO3kx.gif

For golang/go#36865

Change-Id: Ic17ebd038561ef4dabbd139f6fa2e378968b01a1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243699
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-07-30 16:59:53 +00:00
Jamal Carvalho d37103e11f content,internal: add badge generation for package authors
This change creates a badge generation tool page for package authors. A future change will add
documenation of this feature and a link to the about page.

Fixes golang/go#36982

Change-Id: Ia64ba9db73ed92b853f1f955330caf93d996da91
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241273
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-07-14 18:56:54 +00:00
Julie Qiu 5f3d1516c2 devtools/cmd/experiment: add support for removing experiments
Users can now remove experiments using the experiment devtool.

Change-Id: I02e2a2b10686271f4b63cd40cdfac6eea28878ae
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241602
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-09 16:37:22 +00:00
Rob Findley 1a979796ae devtools: use an auto-generated name for ci
There's no reason to use a hard-coded name when running postgres in the
CI script (and in fact, that's why we're storing the resulting container
name in a variable).

Change-Id: I9db408fac8c02f07d038240afed5d17ead9bbefe
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241738
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-09 15:43:23 +00:00
Rob Findley ea15bff89b devtools: add a script for running pure docker CI
For simplicity, add a new script that runs all.bash CI using Docker
only. This will facilitate hooking into Kokoro (a Google internal CI
runner).

Change-Id: I2faa6190e6ecc35a2b2dc9151f173dc07f80d9b5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241603
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-09 12:11:21 +00:00
Julie Qiu d74fab8567 devtools,internal: rename experiments
Experiments are renamed to be shorter, so that they are easier to type
in query params and when inserting into the database.

Descriptions are added for each experiment, which will be used when
inserting an experiment with the script in
devtools/cmd/experiment/experiment.go.

Change-Id: Ie3f6ba05dbe075c899fc09f139c9b9fc93f7650d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240944
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-07 15:28:36 +00:00
Julie Qiu d5f6a03a63 devtools/cmd/experiment: add script for experiments
A script is added to add/update/list experiments.

Change-Id: I9fa306ab102a4ac458ee93f5751b43b9999db4c5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240948
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-07 15:28:10 +00:00
Julie Qiu 993436f73a content: update frontend fetch UI
The frontend fetch UI is updated with a styled button, and loading dots
to indicate that a fetch request is in progress.

The Fetch API is now used instead of AJAX to make requests.

Updates golang/go#36811
Updates golang/go#37002

Change-Id: Ia37113dd9976f8e147875371c099f7b2bfd4bd85
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240459
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-07-01 17:52:00 +00:00
Jonathan Amsterdam fe9a181e9f devtools/cmd/csphash: check for template expansion in scripts
Report any scripts that will change dynamically due to a template
expansion. CSP hashing can't support scripts like that, because the
contents and therefore the hash will change on each execution.

Change-Id: I975859a59c8f5d19bcd0ffc5dad1e5068a380587
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240500
Reviewed-by: Julie Qiu <julie@golang.org>
2020-06-30 19:15:17 +00:00
Jonathan Amsterdam 1705eb3beb devtools/cmd/csphash: check script hashes for CSP
Add a tool that checks the script hashes used
for our Content Security Policy (CSP).

Run the tool from all.bash.

(Also, prettier decided to change CONTRIBUTING.md.)

Fixes b/159711607.

Change-Id: I4498a19143c53fb90bcf0560ccaf529f4fb72a81
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240138
Reviewed-by: Julie Qiu <julie@golang.org>
2020-06-30 15:51:38 +00:00
Julie Qiu 97312c3aed devtools: fix references to scripts
In commit 947bb6d235, scripts was renamed
to devtools. There are some lingering references to scripts, which are now fixed.

Change-Id: Icca8b2fa05694fd546c141d045acd13c7679048f
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/753924
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-05-26 23:06:21 +00:00
Andrew Bonventre dec9db9ed0 content/static: rearrange loading order of scripts plus cleanup
+ Load all JavaScript files at the end of the page so that DOM
  parsing won’t be blocked by script execution.
+ Extract out Google Tag Manager script tag and place init logic in
  a separate file instead of using an inscrutable, minified inline
  script.
+ Add the JavaScript compilation script.
+ Update license headers to have a range so that multiple licenses
  are not included in the minified source when only the date is
  different.
+ Update the prettier config to avoid arrow parentheses unless they
  are needed to match existing style.

Change-Id: I7331ee7fab04eb2ff45b5f59928b3e5817d35813
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/752822
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Reviewed-by: Alexander Rakoczy <rakoczy@google.com>
2020-05-26 17:03:21 +00:00
Julie Qiu 947bb6d235 devtools: renamed from scripts
Change-Id: I1bf0f8a3297b2a83bb6515db25cb04e1b67220d0
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/752611
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-05-21 19:10:19 +00:00