зеркало из https://github.com/golang/pkgsite.git
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:
Родитель
0cd9aaec03
Коммит
f4260bbd5d
|
@ -4,23 +4,19 @@
|
|||
* license that can be found in the LICENSE file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Styling for when the new-homepage experiment is active.
|
||||
*/
|
||||
|
||||
.HomepageNew {
|
||||
.Homepage {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 2rem auto;
|
||||
max-width: 38rem;
|
||||
}
|
||||
.HomepageNew-logo {
|
||||
.Homepage-logo {
|
||||
display: block;
|
||||
height: 15.25rem;
|
||||
margin: 3.125rem auto;
|
||||
width: 22.8125rem;
|
||||
}
|
||||
.HomepageNew-searchForm input {
|
||||
.Homepage-searchForm input {
|
||||
background: url('/static/img/icon-search.svg') right no-repeat;
|
||||
background-position: left 0.75rem center;
|
||||
background-size: 1.5rem;
|
||||
|
@ -33,12 +29,12 @@
|
|||
padding-left: 2.75rem;
|
||||
width: 100%;
|
||||
}
|
||||
.HomepageNew-buttonGroup {
|
||||
.Homepage-buttonGroup {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 2.5rem auto auto 0;
|
||||
}
|
||||
.HomepageNew-searchButton {
|
||||
.Homepage-searchButton {
|
||||
border: none;
|
||||
border-radius: 0.25rem;
|
||||
background-color: var(--turq-dark);
|
||||
|
@ -50,7 +46,7 @@
|
|||
margin-right: 0.5rem;
|
||||
padding: 0 1.375rem;
|
||||
}
|
||||
a.HomepageNew-helpButton {
|
||||
a.Homepage-helpButton {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
border: 0.0625rem solid var(--gray-4);
|
||||
|
@ -62,14 +58,14 @@ a.HomepageNew-helpButton {
|
|||
margin-left: 0.5rem;
|
||||
padding: 0 1.375rem;
|
||||
}
|
||||
.HomepageNew-helpButton img {
|
||||
.Homepage-helpButton img {
|
||||
height: 1rem;
|
||||
margin-left: 0.25rem;
|
||||
position: relative;
|
||||
top: 0.1875rem;
|
||||
width: 1rem;
|
||||
}
|
||||
.HomepageNew-popularSearches {
|
||||
.Homepage-exampleSearches {
|
||||
color: var(--gray-2);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
|
@ -77,14 +73,14 @@ a.HomepageNew-helpButton {
|
|||
margin: 1.5rem auto;
|
||||
text-align: center;
|
||||
}
|
||||
.HomepageNew-popularSearches a {
|
||||
.Homepage-exampleSearches a {
|
||||
color: var(--turq-dark);
|
||||
font-size: 1rem;
|
||||
font-weight: initial;
|
||||
padding: 0 0.625rem;
|
||||
}
|
||||
@media only screen and (max-width: 30rem) {
|
||||
.HomepageNew-popularSearches > span {
|
||||
.Homepage-exampleSearches > span {
|
||||
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 {
|
||||
margin: 0 auto;
|
||||
max-width: 75.75rem;
|
||||
|
|
|
@ -16,9 +16,7 @@
|
|||
{{if (.Experiments.IsActive "sidenav")}}
|
||||
<link href="/static/css/sidenav.css?version={{.AppVersionLabel}}" rel="stylesheet">
|
||||
{{end}}
|
||||
{{if (.Experiments.IsActive "new-homepage")}}
|
||||
<link href="/static/css/homepage.css?version={{.AppVersionLabel}}" rel="stylesheet">
|
||||
{{end}}
|
||||
{{block "main_content_stylesheet" .}}{{end}}
|
||||
<link href="/third_party/dialog-polyfill/dialog-polyfill.css?version={{.AppVersionLabel}}" rel="stylesheet">
|
||||
<title>{{if .HTMLTitle}}{{.HTMLTitle}} · {{end}}pkg.go.dev</title>
|
||||
<body class="Site">
|
||||
|
|
|
@ -9,95 +9,54 @@
|
|||
<wbr>
|
||||
{{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"}}
|
||||
{{if (.Experiments.IsActive "new-homepage")}}
|
||||
<div class="Container">
|
||||
<div class="HomepageNew">
|
||||
<img class="HomepageNew-logo" src="/static/img/gopher-homepage.jpg" alt="go.dev">
|
||||
<form class="HomepageNew-searchForm" action="/search" role="search">
|
||||
<input
|
||||
id="AutoComplete"
|
||||
role="textbox"
|
||||
aria-label="Search for Go packages"
|
||||
type="text"
|
||||
name="q"
|
||||
placeholder="Search for Go packages"
|
||||
autocapitalize="off"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
spellcheck="false"
|
||||
title="Search for Go packages"
|
||||
autofocus="true">
|
||||
<div class="HomepageNew-buttonGroup">
|
||||
<button type="submit" class="HomepageNew-searchButton">Search</button>
|
||||
<a href="/search-help" target="_blank" class="HomepageNew-helpButton">
|
||||
Search help <span><img src="/static/img/icon-launch.svg"></span>
|
||||
</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 class="Container">
|
||||
<div class="Homepage">
|
||||
<img class="Homepage-logo" src="/static/img/gopher-homepage.jpg" alt="go.dev">
|
||||
<form class="Homepage-searchForm" action="/search" role="search">
|
||||
<input
|
||||
id="AutoComplete"
|
||||
role="textbox"
|
||||
aria-label="Search for Go packages"
|
||||
type="text"
|
||||
name="q"
|
||||
placeholder="Search for Go packages"
|
||||
autocapitalize="off"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
spellcheck="false"
|
||||
title="Search for Go packages"
|
||||
autofocus="true">
|
||||
<div class="Homepage-buttonGroup">
|
||||
<button type="submit" class="Homepage-searchButton">Search</button>
|
||||
<a href="/search-help" target="_blank" class="Homepage-helpButton">
|
||||
Search help <span><img src="/static/img/icon-launch.svg"></span>
|
||||
</a>
|
||||
</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>
|
||||
{{else}}
|
||||
<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}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{define "pre_footer"}}
|
||||
{{if (.Experiments.IsActive "new-homepage")}}
|
||||
<div class="Questions">
|
||||
<div class="Questions-content">
|
||||
<h3>Frequently asked questions:</h2>
|
||||
<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#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>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="Questions">
|
||||
<div class="Questions-content">
|
||||
<h3>Frequently asked questions:</h2>
|
||||
<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#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>
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
@ -13,7 +13,6 @@ const (
|
|||
ExperimentFrontendFetch = "frontend-fetch"
|
||||
ExperimentMasterVersion = "master-version"
|
||||
ExperimentExecutableExamples = "executable-examples"
|
||||
ExperimentNewHomepage = "new-homepage"
|
||||
ExperimentSidenav = "sidenav"
|
||||
ExperimentTranslateHTML = "translate-html"
|
||||
ExperimentUseDirectories = "use-directories"
|
||||
|
@ -27,7 +26,6 @@ var Experiments = map[string]string{
|
|||
ExperimentAutocomplete: "Enable autocomplete with search.",
|
||||
ExperimentFrontendFetch: "Enable ability to fetch a package that doesn't exist on pkg.go.dev.",
|
||||
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.",
|
||||
ExperimentSidenav: "Display documentation index on the left sidenav.",
|
||||
ExperimentTranslateHTML: "Parse HTML text in READMEs, to properly display images.",
|
||||
|
|
Загрузка…
Ссылка в новой задаче