golang/go

x/pkgsite: change browser URL to canonical path

オープン

#40,936 opened on 2020/08/20

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Go (19,008 件のフォーク)batch import
NeedsInvestigationhelp wantedpkgsite

Repository metrics

Stars
 (133,883 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

If the URL passed to the frontend is path@version.

it resolves this internally to module@version/suffix.

and all the links it puts on the page have this form. However, the browser URL still says "path@version".

We could use window.history.replaceState to change the browser URL without a page reload. According to https://computerrock.com/blog/html5-changing-the-browser-url-without-refreshing-page, it is available in modern browsers.

/cc @jba @jamalc

コントリビューターガイド