Skip to content

Commit 3e4020b

Browse files
eric-schneidersmatiolids
authored andcommitted
docs: Improve the search UX in Langflow docs (langflow-ai#4089)
* Add Mendable search bar component * Align Mendable anon_key retrieval * Update url and tagline in docusaurus config * Move sitemap config to preset options * Add Mendable anon key to docusaurus config
1 parent 590bf4d commit 3e4020b

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

docs/docusaurus.config.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const { remarkCodeHike } = require("@code-hike/mdx");
88
/** @type {import('@docusaurus/types').Config} */
99
const config = {
1010
title: "Langflow Documentation",
11-
tagline: "Langflow is a GUI for LangChain, designed with react-flow",
11+
tagline: "Langflow is a low-code app builder for RAG and multi-agent AI applications.",
1212
favicon: "img/favicon.ico",
13-
url: "https://langflow-ai.github.io",
13+
url: "https://docs.langflow.org",
1414
baseUrl: "/",
1515
onBrokenLinks: "throw",
1616
onBrokenMarkdownLinks: "warn",
@@ -19,7 +19,7 @@ const config = {
1919
trailingSlash: false,
2020
staticDirectories: ["static"],
2121
customFields: {
22-
mendableAnonKey: process.env.MENDABLE_ANON_KEY,
22+
mendableAnonKey: "b7f52734-297c-41dc-8737-edbd13196394", // Mendable Anon Client-side key, safe to expose to the public
2323
},
2424
i18n: {
2525
defaultLocale: "en",
@@ -46,6 +46,13 @@ const config = {
4646
],
4747
],
4848
},
49+
sitemap: {
50+
// https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-sitemap
51+
// https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap
52+
lastmod: 'datetime',
53+
changefreq: null,
54+
priority: null,
55+
},
4956
gtag: {
5057
trackingID: "G-XHC7G628ZP",
5158
anonymizeIP: true,
@@ -87,12 +94,6 @@ const config = {
8794
themeConfig:
8895
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
8996
({
90-
sitemap: {
91-
// https://www.sitemaps.org/protocol.html#xmlTagDefinitions
92-
changefreq: "weekly",
93-
priority: 0.5,
94-
ignorePatterns: [],
95-
},
9697
navbar: {
9798
hideOnScroll: true,
9899
title: "Langflow",

docs/src/theme/Footer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function FooterWrapper(props) {
3737

3838
const mendableFloatingButton = React.createElement(MendableFloatingButton, {
3939
floatingButtonStyle: { color: "#000000", backgroundColor: "#f6f6f6" },
40-
anon_key: 'b7f52734-297c-41dc-8737-edbd13196394', // Mendable Search Public ANON key, ok to be public
40+
anon_key: customFields.mendableAnonKey,
4141
showSimpleSearch: true,
4242
icon: icon,
4343
});

docs/src/theme/SearchBar.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,22 @@
22
// If you swizzled this, it is your responsibility to provide an implementation
33
// Tip: swizzle the SearchBar from the Algolia theme for inspiration:
44
// npm run swizzle @docusaurus/theme-search-algolia SearchBar
5-
export {default} from '@docusaurus/Noop';
5+
import React from 'react'
6+
import { MendableSearchBar } from '@mendable/search'
7+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
8+
9+
export default function SearchBarWrapper() {
10+
const {
11+
siteConfig: { customFields },
12+
} = useDocusaurusContext()
13+
return (
14+
<div className="mendable-search">
15+
<MendableSearchBar
16+
anon_key={customFields.mendableAnonKey}
17+
placeholder="Search..."
18+
dialogPlaceholder="How to deploy my application?"
19+
showSimpleSearch
20+
/>
21+
</div>
22+
)
23+
}

0 commit comments

Comments
 (0)