mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 12:45:50 +00:00
Merge pull request #3100 from XRPLF/update-site-search
Fix site search: Replace Algolia with Redocly's inbuilt search.
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
import { DocSearch } from '@docsearch/react';
|
|
||||||
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
||||||
|
|
||||||
export function AlgoliaSearch() {
|
|
||||||
const { useL10n } = useThemeHooks()
|
|
||||||
let { lang } = useL10n()
|
|
||||||
return (
|
|
||||||
<DocSearch
|
|
||||||
appId="R39QY3MZC7"
|
|
||||||
indexName="xrpl"
|
|
||||||
apiKey="3431349deec23b0bc3dcd3424beb9a6e"
|
|
||||||
searchParameters={{
|
|
||||||
facetFilters: ['lang:'+lang],
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ import { LanguagePicker } from "@redocly/theme/components/LanguagePicker/Languag
|
|||||||
import { slugify } from "../../helpers";
|
import { slugify } from "../../helpers";
|
||||||
import { Link } from "@redocly/theme/components/Link/Link";
|
import { Link } from "@redocly/theme/components/Link/Link";
|
||||||
import { ColorModeSwitcher } from "@redocly/theme/components/ColorModeSwitcher/ColorModeSwitcher";
|
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";
|
import arrowUpRight from "../../../static/img/icons/arrow-up-right-custom.svg";
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -139,7 +139,7 @@ export function Navbar(props) {
|
|||||||
<NavItems>
|
<NavItems>
|
||||||
{navItems}
|
{navItems}
|
||||||
<div id="topnav-search" className="nav-item search">
|
<div id="topnav-search" className="nav-item search">
|
||||||
<AlgoliaSearch />
|
<Search className="topnav-search"/>
|
||||||
</div>
|
</div>
|
||||||
<div id="topnav-language" className="nav-item">
|
<div id="topnav-language" className="nav-item">
|
||||||
<LanguagePicker
|
<LanguagePicker
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/state": "6.5.2",
|
"@codemirror/state": "6.5.2",
|
||||||
"@codemirror/view": "^6.22.2",
|
"@codemirror/view": "^6.22.2",
|
||||||
"@docsearch/react": "^3.8.0",
|
|
||||||
"@lezer/highlight": "^1.2.0",
|
"@lezer/highlight": "^1.2.0",
|
||||||
"@redocly/realm": "0.120.2",
|
"@redocly/realm": "0.120.2",
|
||||||
"@uiw/codemirror-themes": "4.21.21",
|
"@uiw/codemirror-themes": "4.21.21",
|
||||||
|
|||||||
17
redocly.yaml
17
redocly.yaml
@@ -23,6 +23,21 @@ responseHeaders:
|
|||||||
'/@l10n/es-ES/**':
|
'/@l10n/es-ES/**':
|
||||||
- name: X-Robots-Tag
|
- name: X-Robots-Tag
|
||||||
value: noindex
|
value: noindex
|
||||||
|
search:
|
||||||
|
engine: typesense
|
||||||
|
ai:
|
||||||
|
hide: true
|
||||||
|
filters:
|
||||||
|
hide: true
|
||||||
|
metadataGlobs:
|
||||||
|
'docs/**':
|
||||||
|
redocly_category: Documentation
|
||||||
|
'blog/**':
|
||||||
|
redocly_category: Blog
|
||||||
|
'resources/**':
|
||||||
|
redocly_category: Resources
|
||||||
|
'community/**':
|
||||||
|
redocly_category: Community
|
||||||
seo:
|
seo:
|
||||||
siteUrl: https://xrpl.org/
|
siteUrl: https://xrpl.org/
|
||||||
rbac:
|
rbac:
|
||||||
@@ -62,8 +77,6 @@ links:
|
|||||||
rel: stylesheet
|
rel: stylesheet
|
||||||
- href: https://www.unpkg.com/@xrpl/ai-css/xrplai.css
|
- href: https://www.unpkg.com/@xrpl/ai-css/xrplai.css
|
||||||
rel: stylesheet
|
rel: stylesheet
|
||||||
- href: https://cdn.jsdelivr.net/npm/@docsearch/css@3
|
|
||||||
rel: stylesheet
|
|
||||||
|
|
||||||
logo:
|
logo:
|
||||||
srcSet: ./static/img/XRPLedger_DevPortal-black.svg light ./static/img/XRPLedger_DevPortal-white.svg dark
|
srcSet: ./static/img/XRPLedger_DevPortal-black.svg light ./static/img/XRPLedger_DevPortal-white.svg dark
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -30,6 +30,13 @@
|
|||||||
z-index: 1100 !important;
|
z-index: 1100 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.xrp-ledger-dev-portal {
|
||||||
|
.DocSearch-Modal {
|
||||||
|
top: 85px;
|
||||||
|
background-color: #232325;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Algolia Search results --------------------------------------------------
|
// Algolia Search results --------------------------------------------------
|
||||||
html {
|
html {
|
||||||
// The extra specificity makes this override the default Algolia styles.
|
// The extra specificity makes this override the default Algolia styles.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
background: #32E685 !important;
|
background: #32E685 !important;
|
||||||
padding: 7px 35px;
|
padding: 7px 35px;
|
||||||
font-family: "Space Grotesk";
|
font-family: "Space Grotesk";
|
||||||
z-index: 9999;
|
z-index: 10;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ $banner-height: 52px; // Apex 2025 banner is 52px. 0 for no pencil banner.
|
|||||||
}
|
}
|
||||||
|
|
||||||
#topnav-search {
|
#topnav-search {
|
||||||
|
flex-grow: 1;
|
||||||
.input-group {
|
.input-group {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-wrap: nowrap; // Fix search bar splitting into two lines on iPhone 5
|
flex-wrap: nowrap; // Fix search bar splitting into two lines on iPhone 5
|
||||||
@@ -315,7 +316,7 @@ $banner-height: 52px; // Apex 2025 banner is 52px. 0 for no pencil banner.
|
|||||||
|
|
||||||
@include media-breakpoint-up(xl) {
|
@include media-breakpoint-up(xl) {
|
||||||
#topnav-search {
|
#topnav-search {
|
||||||
margin-left: auto;
|
margin-left: 3.5rem;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
#topnav-language {
|
#topnav-language {
|
||||||
|
|||||||
@@ -27,3 +27,6 @@ html.light .MarkpromptContentDialog h3:not(.chip) {
|
|||||||
.MarkpromptOverlay {
|
.MarkpromptOverlay {
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
}
|
}
|
||||||
|
.MarkpromptContentDialog{
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
@@ -1340,7 +1340,7 @@ main article .card-grid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Search styles */
|
/* Algolia Search styles
|
||||||
|
|
||||||
.algolia-autocomplete .ds-dropdown-menu::before {
|
.algolia-autocomplete .ds-dropdown-menu::before {
|
||||||
background-color: $gray-100;
|
background-color: $gray-100;
|
||||||
@@ -1352,3 +1352,4 @@ main article .card-grid {
|
|||||||
.DocSearch-Modal {
|
.DocSearch-Modal {
|
||||||
box-shadow: $light-box-shadow;
|
box-shadow: $light-box-shadow;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user