From 6440758d8a036dcc9617843e943783b52a28efe2 Mon Sep 17 00:00:00 2001 From: Kush Patel Date: Sat, 20 Jun 2020 15:19:24 -0700 Subject: [PATCH] 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 Reviewed-by: Andrew Bonventre Run-TryBot: Andrew Bonventre TryBot-Result: kokoro --- content/static/html/pages/details.tmpl | 1 + content/static/js/details.min.js | 8 +++---- content/static/js/keyboard.js | 32 ++++++++++++++++++++++++++ devtools/compile_js.sh | 2 +- internal/frontend/details.go | 6 +++++ internal/frontend/directory.go | 5 ++++ internal/frontend/module.go | 4 ++++ internal/frontend/package.go | 5 ++++ 8 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 content/static/js/keyboard.js diff --git a/content/static/html/pages/details.tmpl b/content/static/html/pages/details.tmpl index a08f7993..6b7fd794 100644 --- a/content/static/html/pages/details.tmpl +++ b/content/static/html/pages/details.tmpl @@ -208,6 +208,7 @@ {{end}} {{define "post_content"}} +