_content: delete search box from home page
The search feature is not used much and does not give terribly useful answers. It accounts for under 2% of golang.org traffic and about one real query per minute. Looking through a log of 1,592 search queries over a 28-hour period last week, almost all of them would have found better answers using Google or pkg.go.dev. Just a few examples of queries for which we had no good answers: - 1.16 - 1.16beta - GOPATH - k8s.io/api/settings/v1alpha1 - language and capacity - linux installation - logical operators - mocking struct - naming convention - remove element from slice - sirupsen/logrus - string template - struct field tag - tutorial - update go - using go modules - visual studio code Removing the search box on the main site will stop acting as though it gives useful information for queries like these. Then hopefully people will find their way to Google or pkg.go.dev instead. Fixes #44357. Change-Id: I400157e478a9faaf35c3fdb60380336ee0b135a3 Reviewed-on: https://go-review.googlesource.com/c/website/+/292590 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Родитель
3bfcf053d6
Коммит
de781e571e
|
@ -61,23 +61,6 @@ window.trackEvent = function(category, action, opt_label, opt_value, opt_noninte
|
|||
<li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<li class="Header-menuItem Header-menuItem--search">
|
||||
<form class="HeaderSearch" role="search" action="/search">
|
||||
<input class="HeaderSearch-input"
|
||||
type="search"
|
||||
name="q"
|
||||
placeholder="Search"
|
||||
aria-label="Search"
|
||||
autocapitalize="off"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
spellcheck="false"
|
||||
required>
|
||||
<button class="HeaderSearch-submit">
|
||||
<!-- magnifying glass: --><svg class="HeaderSearch-icon" width="24" height="24" viewBox="0 0 24 24"><title>Search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
|
|
@ -470,9 +470,7 @@ a#start .desc {
|
|||
}
|
||||
.Header-menuItem,
|
||||
.Header-menuItem a:link,
|
||||
.Header-menuItem a:visited,
|
||||
.Header-menuItem--search,
|
||||
.HeaderSearch {
|
||||
.Header-menuItem a:visited {
|
||||
width: 100%;
|
||||
}
|
||||
.Header-menuItem,
|
||||
|
@ -485,59 +483,6 @@ a#start .desc {
|
|||
.Header-menuItem a:visited {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
.Header-menuItem--search {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
.HeaderSearch,
|
||||
.HeaderSearch-label {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
.HeaderSearch {
|
||||
border: 0.0625rem solid #979797;
|
||||
border-radius: 0.1875rem;
|
||||
display: inline-flex;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.HeaderSearch-input {
|
||||
-webkit-appearance: none;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
flex: 1;
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
/* Prevents automatic zoom on mobile devices */
|
||||
margin: 0;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
.HeaderSearch-input::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
.HeaderSearch-input::-moz-ui-invalid {
|
||||
box-shadow: unset;
|
||||
}
|
||||
.HeaderSearch-submit {
|
||||
background-color: #fff;
|
||||
border: none;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
padding: 0.125rem 0.5rem 0 0.55rem;
|
||||
transition: background-color 200ms;
|
||||
}
|
||||
.HeaderSearch:focus-within .HeaderSearch-submit {
|
||||
background-color: #e5f6fb;
|
||||
}
|
||||
.HeaderSearch-icon {
|
||||
fill: #757575;
|
||||
transition: fill 200ms;
|
||||
}
|
||||
.HeaderSearch:focus-within .HeaderSearch-icon {
|
||||
fill: #007d9c;
|
||||
}
|
||||
@media only screen and (min-width: 56rem) {
|
||||
.Header {
|
||||
display: block;
|
||||
|
@ -587,20 +532,6 @@ a#start .desc {
|
|||
.Header-menuItem a:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.Header-menuItem--search,
|
||||
.HeaderSearch {
|
||||
width: 8.75rem;
|
||||
}
|
||||
.Header-menuItem--search {
|
||||
margin-left: 1.5rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
.HeaderSearch-input {
|
||||
min-width: 5.625rem;
|
||||
}
|
||||
.HeaderSearch-submit {
|
||||
padding: 0.125rem 0.5rem 0;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 57.5rem) {
|
||||
.Header {
|
||||
|
|
|
@ -101,23 +101,6 @@ const templateHTML = `
|
|||
<li class="Header-menuItem"><a href="/blog/">Blog</a></li>
|
||||
<li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li>
|
||||
{{end}}
|
||||
<li class="Header-menuItem Header-menuItem--search">
|
||||
<form class="HeaderSearch" role="search" action="/search">
|
||||
<input class="HeaderSearch-input"
|
||||
type="search"
|
||||
name="q"
|
||||
placeholder="Search"
|
||||
aria-label="Search"
|
||||
autocapitalize="off"
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
spellcheck="false"
|
||||
required>
|
||||
<button class="HeaderSearch-submit">
|
||||
<!-- magnifying glass: --><svg class="HeaderSearch-icon" width="24" height="24" viewBox="0 0 24 24"><title>Search</title><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
|
Загрузка…
Ссылка в новой задаче