content/static,internal/experiment: remove deprecated homepage code

Now that the new homepage is launched removing the legacy homepage
code and references to the new-homepage experiment.

Change-Id: I94bd2c0cf5f1069c86343cc8972f91ded8600553
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/246440
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Jamal Carvalho 2020-08-03 10:31:15 -04:00
Родитель 0cd9aaec03
Коммит f4260bbd5d
5 изменённых файлов: 52 добавлений и 179 удалений

Просмотреть файл

@ -4,23 +4,19 @@
* license that can be found in the LICENSE file. * license that can be found in the LICENSE file.
*/ */
/* .Homepage {
* Styling for when the new-homepage experiment is active.
*/
.HomepageNew {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 2rem auto; margin: 2rem auto;
max-width: 38rem; max-width: 38rem;
} }
.HomepageNew-logo { .Homepage-logo {
display: block; display: block;
height: 15.25rem; height: 15.25rem;
margin: 3.125rem auto; margin: 3.125rem auto;
width: 22.8125rem; width: 22.8125rem;
} }
.HomepageNew-searchForm input { .Homepage-searchForm input {
background: url('/static/img/icon-search.svg') right no-repeat; background: url('/static/img/icon-search.svg') right no-repeat;
background-position: left 0.75rem center; background-position: left 0.75rem center;
background-size: 1.5rem; background-size: 1.5rem;
@ -33,12 +29,12 @@
padding-left: 2.75rem; padding-left: 2.75rem;
width: 100%; width: 100%;
} }
.HomepageNew-buttonGroup { .Homepage-buttonGroup {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 2.5rem auto auto 0; margin: 2.5rem auto auto 0;
} }
.HomepageNew-searchButton { .Homepage-searchButton {
border: none; border: none;
border-radius: 0.25rem; border-radius: 0.25rem;
background-color: var(--turq-dark); background-color: var(--turq-dark);
@ -50,7 +46,7 @@
margin-right: 0.5rem; margin-right: 0.5rem;
padding: 0 1.375rem; padding: 0 1.375rem;
} }
a.HomepageNew-helpButton { a.Homepage-helpButton {
align-items: center; align-items: center;
display: flex; display: flex;
border: 0.0625rem solid var(--gray-4); border: 0.0625rem solid var(--gray-4);
@ -62,14 +58,14 @@ a.HomepageNew-helpButton {
margin-left: 0.5rem; margin-left: 0.5rem;
padding: 0 1.375rem; padding: 0 1.375rem;
} }
.HomepageNew-helpButton img { .Homepage-helpButton img {
height: 1rem; height: 1rem;
margin-left: 0.25rem; margin-left: 0.25rem;
position: relative; position: relative;
top: 0.1875rem; top: 0.1875rem;
width: 1rem; width: 1rem;
} }
.HomepageNew-popularSearches { .Homepage-exampleSearches {
color: var(--gray-2); color: var(--gray-2);
font-size: 0.875rem; font-size: 0.875rem;
font-weight: 500; font-weight: 500;
@ -77,14 +73,14 @@ a.HomepageNew-helpButton {
margin: 1.5rem auto; margin: 1.5rem auto;
text-align: center; text-align: center;
} }
.HomepageNew-popularSearches a { .Homepage-exampleSearches a {
color: var(--turq-dark); color: var(--turq-dark);
font-size: 1rem; font-size: 1rem;
font-weight: initial; font-weight: initial;
padding: 0 0.625rem; padding: 0 0.625rem;
} }
@media only screen and (max-width: 30rem) { @media only screen and (max-width: 30rem) {
.HomepageNew-popularSearches > span { .Homepage-exampleSearches > span {
display: block; display: block;
} }
} }

Просмотреть файл

@ -176,84 +176,6 @@ code {
} }
} }
/* TODO: Remove deprecated Homepage styles after "new-homepage" launch */
.SearchForm[aria-expanded='false'] .AutoComplete-list,
.Header-searchForm[aria-expanded='false'] .AutoComplete-list {
display: none;
}
/* This class violates the style guide, because it set by autoComplete.js and
* is non-trivial to override. */
.autoComplete_highlighted {
font-weight: bold;
}
.SearchForm-container {
position: relative;
margin: 0 auto;
height: 3rem;
max-width: 38.25rem;
}
.SearchForm {
position: absolute;
left: 0;
right: 0;
border: 0.0625rem solid var(--gray-8);
border-radius: 1.4em;
background-color: white;
font-size: 1rem;
padding: 0.5rem 0.5rem 0.5rem 1rem;
}
.Experiment-autoComplete .SearchForm:hover,
.Experiment-autoComplete .SearchForm:focus-within,
.Experiment-autoComplete .Header-searchForm:hover,
.Experiment-autoComplete .Header-searchForm:focus-within {
box-shadow: 0 0 0.1875rem rgba(0, 0, 0, 0.3);
}
.SearchForm-firstRow {
display: flex;
flex: 1;
min-height: 1.72rem;
}
.SearchForm-input {
border: none;
flex: 1;
font: inherit;
outline: none;
background-color: var(--white);
}
.SearchForm-input::placeholder {
color: var(--gray-5);
}
.SearchForm-submitIcon {
fill: var(--turq-med);
width: 23px;
}
.Search {
margin-top: 135px;
}
.Search-logo {
display: block;
height: 4.5rem;
margin: 0 auto 50px;
width: 194px;
}
.Homepage {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 2rem auto 5rem;
max-width: 38rem;
}
.Homepage-packages {
padding: 0 1rem;
}
.Homepage-packages ul {
list-style: none;
line-height: 1.4;
padding: 0;
}
/* Deprecated homepage styles end here. */
.Header { .Header {
margin: 0 auto; margin: 0 auto;
max-width: 75.75rem; max-width: 75.75rem;

Просмотреть файл

@ -16,9 +16,7 @@
{{if (.Experiments.IsActive "sidenav")}} {{if (.Experiments.IsActive "sidenav")}}
<link href="/static/css/sidenav.css?version={{.AppVersionLabel}}" rel="stylesheet"> <link href="/static/css/sidenav.css?version={{.AppVersionLabel}}" rel="stylesheet">
{{end}} {{end}}
{{if (.Experiments.IsActive "new-homepage")}} {{block "main_content_stylesheet" .}}{{end}}
<link href="/static/css/homepage.css?version={{.AppVersionLabel}}" rel="stylesheet">
{{end}}
<link href="/third_party/dialog-polyfill/dialog-polyfill.css?version={{.AppVersionLabel}}" rel="stylesheet"> <link href="/third_party/dialog-polyfill/dialog-polyfill.css?version={{.AppVersionLabel}}" rel="stylesheet">
<title>{{if .HTMLTitle}}{{.HTMLTitle}} · {{end}}pkg.go.dev</title> <title>{{if .HTMLTitle}}{{.HTMLTitle}} · {{end}}pkg.go.dev</title>
<body class="Site"> <body class="Site">

Просмотреть файл

@ -9,95 +9,54 @@
<wbr> <wbr>
{{end}} {{end}}
{{define "search_additional_attrs"}}{{if not (.Experiments.IsActive "new-homepage")}}autofocus{{end}}{{end}} {{define "main_content_stylesheet"}}
<link href="/static/css/homepage.css?version={{.AppVersionLabel}}" rel="stylesheet">
{{end}}
{{define "main_content"}} {{define "main_content"}}
{{if (.Experiments.IsActive "new-homepage")}} <div class="Container">
<div class="Container"> <div class="Homepage">
<div class="HomepageNew"> <img class="Homepage-logo" src="/static/img/gopher-homepage.jpg" alt="go.dev">
<img class="HomepageNew-logo" src="/static/img/gopher-homepage.jpg" alt="go.dev"> <form class="Homepage-searchForm" action="/search" role="search">
<form class="HomepageNew-searchForm" action="/search" role="search"> <input
<input id="AutoComplete"
id="AutoComplete" role="textbox"
role="textbox" aria-label="Search for Go packages"
aria-label="Search for Go packages" type="text"
type="text" name="q"
name="q" placeholder="Search for Go packages"
placeholder="Search for Go packages" autocapitalize="off"
autocapitalize="off" autocomplete="off"
autocomplete="off" autocorrect="off"
autocorrect="off" spellcheck="false"
spellcheck="false" title="Search for Go packages"
title="Search for Go packages" autofocus="true">
autofocus="true"> <div class="Homepage-buttonGroup">
<div class="HomepageNew-buttonGroup"> <button type="submit" class="Homepage-searchButton">Search</button>
<button type="submit" class="HomepageNew-searchButton">Search</button> <a href="/search-help" target="_blank" class="Homepage-helpButton">
<a href="/search-help" target="_blank" class="HomepageNew-helpButton"> Search help <span><img src="/static/img/icon-launch.svg"></span>
Search help <span><img src="/static/img/icon-launch.svg"></span> </a>
</a>
</div>
</form>
<div class="HomepageNew-popularSearches">
<span>EXAMPLE SEARCHES:</span>
<a href="/search?q=logrus">"logrus"</a>
<a href="/search?q=yaml+OR+json">"yaml OR json"</a>
<a href="/search?q=go%2Fpackages">"go/packages"</a>
</div> </div>
</form>
<div class="Homepage-exampleSearches">
<span>EXAMPLE SEARCHES:</span>
<a href="/search?q=logrus">"logrus"</a>
<a href="/search?q=yaml+OR+json">"yaml OR json"</a>
<a href="/search?q=go%2Fpackages">"go/packages"</a>
</div> </div>
</div> </div>
{{else}} </div>
<div class="Container">
<div class="Search">
<img class="Search-logo" src="/static/img/go-logo-blue.svg" alt="go.dev">
{{template "search" .}}
</div>
<div class="Homepage">
<div class="Homepage-packages">
<h1>Popular Packages</h2>
<ul>
<li><a href="/github.com/sirupsen/logrus">github.com/sirupsen/logrus</a></li>
<li><a href="/github.com/gin-gonic/gin">github.com/gin-gonic/gin</a></li>
<li><a href="/github.com/spf13/cobra">github.com/spf13/cobra</a></li>
<li><a href="/github.com/spf13/viper">github.com/spf13/viper</a></li>
<li><a href="/github.com/golang/glog">github.com/golang/glog</a></li>
<li><a href="/github.com/labstack/echo">github.com/labstack/echo</a></li>
<li><a href="/github.com/urfave/cli">github.com/urfave/cli</a></li>
<li><a href="/github.com/gorilla/mux">github.com/gorilla/mux</a></li>
<li><a href="/net/http">net/http</a></li>
<li><a href="/encoding/json">encoding/json</a></li>
</ul>
</div>
<div class="Homepage-packages">
<h1>Featured Packages</h2>
<ul>
<li><a href="/database/sql">database/sql</a></li>
<li><a href="/google.golang.org/grpc">google.golang.org/grpc</a></li>
<li><a href="/github.com/esimov/caire">github.com/esimov/caire</a></li>
<li><a href="/github.com/gopherjs/gopherjs/js">github.com/gopherjs/gopherjs/js</a></li>
<li><a href="/cloud.google.com/go">cloud.google.com/go</a></li>
<li><a href="/go.uber.org/zap">go.uber.org/zap</a></li>
<li><a href="/github.com/lileio/lile">github.com/lileio/lile</a></li>
<li><a href="/github.com/micro/go-micro">github.com/micro/go-micro</a></li>
<li><a href="/github.com/grailbio/bigslice">github.com/grailbio/bigslice</a></li>
<li><a href="/gobot.io/x/gobot">gobot.io/x/gobot</a></li>
</ul>
</div>
</div>
</div>
{{end}}
{{end}} {{end}}
{{define "pre_footer"}} {{define "pre_footer"}}
{{if (.Experiments.IsActive "new-homepage")}} <div class="Questions">
<div class="Questions"> <div class="Questions-content">
<div class="Questions-content"> <h3>Frequently asked questions:</h2>
<h3>Frequently asked questions:</h2> <ul>
<ul> <li><a href="https://go.dev/about#adding-a-package">How can I add a package?</a></li>
<li><a href="https://go.dev/about#adding-a-package">How can I add a package?</a></li> <li><a href="https://go.dev/about#removing-a-package">How can I remove a package?</a></li>
<li><a href="https://go.dev/about#removing-a-package">How can I remove a package?</a></li> <li><a href="https://go.dev/about#creating-a-badge">How can I add a go badge in my README file?</a></li>
<li><a href="https://go.dev/about#creating-a-badge">How can I add a go badge in my README file?</a></li> </ul>
</ul>
</div>
</div> </div>
{{end}} </div>
{{end}} {{end}}

Просмотреть файл

@ -13,7 +13,6 @@ const (
ExperimentFrontendFetch = "frontend-fetch" ExperimentFrontendFetch = "frontend-fetch"
ExperimentMasterVersion = "master-version" ExperimentMasterVersion = "master-version"
ExperimentExecutableExamples = "executable-examples" ExperimentExecutableExamples = "executable-examples"
ExperimentNewHomepage = "new-homepage"
ExperimentSidenav = "sidenav" ExperimentSidenav = "sidenav"
ExperimentTranslateHTML = "translate-html" ExperimentTranslateHTML = "translate-html"
ExperimentUseDirectories = "use-directories" ExperimentUseDirectories = "use-directories"
@ -27,7 +26,6 @@ var Experiments = map[string]string{
ExperimentAutocomplete: "Enable autocomplete with search.", ExperimentAutocomplete: "Enable autocomplete with search.",
ExperimentFrontendFetch: "Enable ability to fetch a package that doesn't exist on pkg.go.dev.", ExperimentFrontendFetch: "Enable ability to fetch a package that doesn't exist on pkg.go.dev.",
ExperimentMasterVersion: "Enable viewing path@master.", ExperimentMasterVersion: "Enable viewing path@master.",
ExperimentNewHomepage: "Enable the new hompage.",
ExperimentExecutableExamples: "Display executable examples with their import statements, so that they are runnable via the Go playground.", ExperimentExecutableExamples: "Display executable examples with their import statements, so that they are runnable via the Go playground.",
ExperimentSidenav: "Display documentation index on the left sidenav.", ExperimentSidenav: "Display documentation index on the left sidenav.",
ExperimentTranslateHTML: "Parse HTML text in READMEs, to properly display images.", ExperimentTranslateHTML: "Parse HTML text in READMEs, to properly display images.",