Skip to content

Commit de781e5

Browse files
committed
_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 <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 3bfcf05 commit de781e5

File tree

3 files changed

+1
-104
lines changed

3 files changed

+1
-104
lines changed

_content/godoc.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,6 @@
6161
<li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li>
6262
{{end}}
6363
{{end}}
64-
<li class="Header-menuItem Header-menuItem--search">
65-
<form class="HeaderSearch" role="search" action="/search">
66-
<input class="HeaderSearch-input"
67-
type="search"
68-
name="q"
69-
placeholder="Search"
70-
aria-label="Search"
71-
autocapitalize="off"
72-
autocomplete="off"
73-
autocorrect="off"
74-
spellcheck="false"
75-
required>
76-
<button class="HeaderSearch-submit">
77-
<!-- 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>
78-
</button>
79-
</form>
80-
</li>
8164
</ul>
8265
</nav>
8366
</header>

_content/style.css

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,7 @@ a#start .desc {
470470
}
471471
.Header-menuItem,
472472
.Header-menuItem a:link,
473-
.Header-menuItem a:visited,
474-
.Header-menuItem--search,
475-
.HeaderSearch {
473+
.Header-menuItem a:visited {
476474
width: 100%;
477475
}
478476
.Header-menuItem,
@@ -485,59 +483,6 @@ a#start .desc {
485483
.Header-menuItem a:visited {
486484
padding: 0.5rem 0;
487485
}
488-
.Header-menuItem--search {
489-
margin-top: 0.5rem;
490-
}
491-
.HeaderSearch,
492-
.HeaderSearch-label {
493-
display: inline-block;
494-
position: relative;
495-
}
496-
.HeaderSearch {
497-
border: 0.0625rem solid #979797;
498-
border-radius: 0.1875rem;
499-
display: inline-flex;
500-
overflow: hidden;
501-
position: relative;
502-
}
503-
.HeaderSearch-input {
504-
-webkit-appearance: none;
505-
border: none;
506-
border-radius: 0;
507-
box-sizing: border-box;
508-
display: block;
509-
flex: 1;
510-
font: inherit;
511-
font-size: 16px;
512-
/* Prevents automatic zoom on mobile devices */
513-
margin: 0;
514-
padding: 0.5rem;
515-
}
516-
.HeaderSearch-input::-webkit-search-decoration {
517-
-webkit-appearance: none;
518-
}
519-
.HeaderSearch-input::-moz-ui-invalid {
520-
box-shadow: unset;
521-
}
522-
.HeaderSearch-submit {
523-
background-color: #fff;
524-
border: none;
525-
box-sizing: border-box;
526-
cursor: pointer;
527-
margin: 0;
528-
padding: 0.125rem 0.5rem 0 0.55rem;
529-
transition: background-color 200ms;
530-
}
531-
.HeaderSearch:focus-within .HeaderSearch-submit {
532-
background-color: #e5f6fb;
533-
}
534-
.HeaderSearch-icon {
535-
fill: #757575;
536-
transition: fill 200ms;
537-
}
538-
.HeaderSearch:focus-within .HeaderSearch-icon {
539-
fill: #007d9c;
540-
}
541486
@media only screen and (min-width: 56rem) {
542487
.Header {
543488
display: block;
@@ -587,20 +532,6 @@ a#start .desc {
587532
.Header-menuItem a:focus {
588533
text-decoration: underline;
589534
}
590-
.Header-menuItem--search,
591-
.HeaderSearch {
592-
width: 8.75rem;
593-
}
594-
.Header-menuItem--search {
595-
margin-left: 1.5rem;
596-
margin-top: 0;
597-
}
598-
.HeaderSearch-input {
599-
min-width: 5.625rem;
600-
}
601-
.HeaderSearch-submit {
602-
padding: 0.125rem 0.5rem 0;
603-
}
604535
}
605536
@media only screen and (min-width: 57.5rem) {
606537
.Header {

internal/dl/tmpl.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,6 @@ const templateHTML = `
101101
<li class="Header-menuItem"><a href="/blog/">Blog</a></li>
102102
<li class="Header-menuItem"><a href="https://play.golang.org/">Play</a></li>
103103
{{end}}
104-
<li class="Header-menuItem Header-menuItem--search">
105-
<form class="HeaderSearch" role="search" action="/search">
106-
<input class="HeaderSearch-input"
107-
type="search"
108-
name="q"
109-
placeholder="Search"
110-
aria-label="Search"
111-
autocapitalize="off"
112-
autocomplete="off"
113-
autocorrect="off"
114-
spellcheck="false"
115-
required>
116-
<button class="HeaderSearch-submit">
117-
<!-- 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>
118-
</button>
119-
</form>
120-
</li>
121104
</ul>
122105
</nav>
123106
</header>

0 commit comments

Comments
 (0)