Skip to content

[Do not merge] Fix site search: Replace Algolia with Redocly's inbuilt search. #3100

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 0 additions & 17 deletions @theme/components/Navbar/AlgoliaSearch.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions @theme/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LanguagePicker } from "@redocly/theme/components/LanguagePicker/Languag
import { slugify } from "../../helpers";
import { Link } from "@redocly/theme/components/Link/Link";
import { ColorModeSwitcher } from "@redocly/theme/components/ColorModeSwitcher/ColorModeSwitcher";
import { AlgoliaSearch } from "./AlgoliaSearch";
import { Search } from "@redocly/theme/components/Search/Search";
import arrowUpRight from "../../../static/img/icons/arrow-up-right-custom.svg";

// @ts-ignore
Expand Down Expand Up @@ -139,7 +139,7 @@ export function Navbar(props) {
<NavItems>
{navItems}
<div id="topnav-search" className="nav-item search">
<AlgoliaSearch />
<Search className="topnav-search"/>
</div>
<div id="topnav-language" className="nav-item">
<LanguagePicker
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"dependencies": {
"@codemirror/state": "6.5.2",
"@codemirror/view": "^6.22.2",
"@docsearch/react": "^3.8.0",
"@lezer/highlight": "^1.2.0",
"@redocly/realm": "0.120.2",
"@uiw/codemirror-themes": "4.21.21",
Expand Down
15 changes: 13 additions & 2 deletions redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ responseHeaders:
'/@l10n/es-ES/**':
- name: X-Robots-Tag
value: noindex
search:
engine: typesense
ai:
hide: true
metadataGlobs:
'docs/**':
redocly_category: Documentation
'blog/**':
redocly_category: Blog
'resources/**':
redocly_category: Resources
'community/**':
redocly_category: Community
seo:
siteUrl: https://xrpl.org/
rbac:
Expand Down Expand Up @@ -62,8 +75,6 @@ links:
rel: stylesheet
- href: https://www.unpkg.com/@xrpl/ai-css/xrplai.css
rel: stylesheet
- href: https://cdn.jsdelivr.net/npm/@docsearch/css@3
rel: stylesheet

logo:
srcSet: ./static/img/XRPLedger_DevPortal-black.svg light ./static/img/XRPLedger_DevPortal-white.svg dark
Expand Down
2 changes: 1 addition & 1 deletion static/css/devportal2024-v1.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions styles/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
z-index: 1100 !important;
}

.xrp-ledger-dev-portal {
.DocSearch-Modal {
top: 85px;
background-color: #232325;
box-shadow: none;
}
}
// Algolia Search results --------------------------------------------------
html {
// The extra specificity makes this override the default Algolia styles.
Expand Down
3 changes: 2 additions & 1 deletion styles/_top-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ $banner-height: 52px; // Apex 2025 banner is 52px. 0 for no pencil banner.
}

#topnav-search {
flex-grow: 1;
.input-group {
flex-grow: 1;
flex-wrap: nowrap; // Fix search bar splitting into two lines on iPhone 5
Expand Down Expand Up @@ -315,7 +316,7 @@ $banner-height: 52px; // Apex 2025 banner is 52px. 0 for no pencil banner.

@include media-breakpoint-up(xl) {
#topnav-search {
margin-left: auto;
margin-left: 3.5rem;
margin-right: 0.5rem;
}
#topnav-language {
Expand Down
3 changes: 2 additions & 1 deletion styles/light/_light-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ main article .card-grid {
}
}

/* Search styles */
/* Algolia Search styles

.algolia-autocomplete .ds-dropdown-menu::before {
background-color: $gray-100;
Expand All @@ -1352,3 +1352,4 @@ main article .card-grid {
.DocSearch-Modal {
box-shadow: $light-box-shadow;
}
*/