Skip to content

add search to docs homepage #3595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions src/css/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
.home-page-hero-left {
align-self: center;
padding: 2rem 0rem;
flex: 1;

@media (min-width: 768px) {
padding-right: 2rem;
Expand All @@ -67,11 +68,14 @@
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
flex: 1;
gap: 20px;

@media (min-width: 768px) {
flex-direction: row;
flex: 1;
justify-content: center;
justify-content: space-between;
}
}

Expand All @@ -88,7 +92,6 @@
width: 100%;

@media (min-width: 768px) {
margin-right: 24px;
margin-bottom: 0;
width: 200px;
}
Expand Down Expand Up @@ -196,6 +199,38 @@
}
}

.home-page-section-search {
display: flex;
flex-direction: row;
padding-top: 2rem;
padding-bottom: 2rem;
justify-content: space-between;
border-bottom: 1px solid var(--click-color-stroke);

@media (min-width: 768px) {
flex-direction: row;
padding-top: 2rem;
padding-bottom: 2rem;
padding-right: 2rem;
justify-content: space-between;
}
}

.home-page-hero-right-search {
display: flex;
flex-direction: column;
align-items: center;
justify-content: right;
flex: 1;
max-width: 465px;

@media (min-width: 768px) {
flex-direction: row;
flex: 1;
justify-content: right;
}
}

.home-page-section:last-of-type {
border-bottom: none;
}
Expand Down Expand Up @@ -234,5 +269,7 @@ img.home-svg svg path {
.home-container {
display: flex;
flex-direction: column;
max-width: 1000px;
justify-self: center;
}

13 changes: 13 additions & 0 deletions src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import IconSQLConsole from '@site/src/icons/IconSQLConsole';
import IconLightning from '@site/src/icons/IconLightning';
import IconDownload from '@site/src/icons/IconDownload';
import Image from '@theme/IdealImage';
import SearchBar from "@theme/SearchBar";

export const Hero = ({children, color}) => {
return (
Expand Down Expand Up @@ -88,6 +89,17 @@ export const HomePageOptionButton = ({children, icon, iconWidth, svgIcon, link})
)
}

export const SearchClickHouse = ({children, color}) => {
return (
<div className='home-page-section-search'>
<p style={{fontWeight: '600', fontSize: '18px', margin: 'auto', flex: '1'}}>Search documentation</p>
<div className='home-page-hero-right-search'>
<SearchBar style="width: 75%"/>
</div>
</div>
)
}

export const ConnectToClickHouse = ({children, color}) => {
return (
<div className='home-page-section'>
Expand Down Expand Up @@ -197,6 +209,7 @@ export const HomeContainer = () => {
return (
<div className='home-container'>
<Hero/>
<SearchClickHouse/>
<ConnectToClickHouse/>
<MigrateToClickHouse/>
<DeployClickHouse/>
Expand Down
3 changes: 3 additions & 0 deletions src/theme/SearchBar/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
}
.DocSearch-Button-Placeholder {
font-size: inherit;
}

[data-theme='dark'] .DocSearch-Button-Placeholder {
color: white;
}

.DocSearch-Container {
Expand Down