Files
OpenBB/website/utils/initialAlgoliaCrawler.js
jose-donato df1a5e4f70 fix: trying new bg color (#4583)
* fix: trying new bg color

* changes to docs from conf page

* ref for bot

* playing with ref cards - feel free to revert

* update bot references

* Update ReferenceCard.tsx

* refactor doc generation files

* Delete generate_index.py

* feat: initial algoliacrawler

* Update generate_sdk_markdown.py

* new error page

* fix: lot of bug fixes

* deleting image

* fix: improved light mode and not found page

---------

Co-authored-by: andrewkenreich <andrew.kenreich@gmail.com>
Co-authored-by: teh_coderer <me@tehcoderer.com>
2023-03-28 18:14:49 +00:00

89 lines
2.5 KiB
JavaScript
Vendored

new Crawler({
rateLimit: 8,
maxDepth: 10,
startUrls: ["https://docs.openbb.co/"],
sitemaps: [],
ignoreCanonicalTo: false,
discoveryPatterns: ["https://docs.openbb.co/**"],
schedule: "at 1:44 PM on Friday",
actions: [
{
indexName: "openbbterminal",
pathsToMatch: ["https://docs.openbb.co/**"],
recordExtractor: ({ helpers }) => {
return helpers.docsearch({
recordProps: {
lvl1: ["header h1", "article h1", "main h1", "h1", "head > title"],
content: ["article p, article li", "main p, main li", "p, li"],
lvl0: {
selectors: "",
defaultValue: "Documentation",
},
lvl2: ["article h2", "main h2", "h2"],
lvl3: ["article h3", "main h3", "h3"],
lvl4: ["article h4", "main h4", "h4"],
lvl5: ["article h5", "main h5", "h5"],
lvl6: ["article h6", "main h6", "h6"],
},
aggregateContent: true,
recordVersion: "v3",
});
},
},
],
initialIndexSettings: {
openbbterminal: {
attributesForFaceting: ["type", "lang"],
attributesToRetrieve: [
"hierarchy",
"content",
"anchor",
"url",
"url_without_anchor",
"type",
],
attributesToHighlight: ["hierarchy", "content"],
attributesToSnippet: ["content:10"],
camelCaseAttributes: ["hierarchy", "content"],
searchableAttributes: [
"unordered(hierarchy.lvl0)",
"unordered(hierarchy.lvl1)",
"unordered(hierarchy.lvl2)",
"unordered(hierarchy.lvl3)",
"unordered(hierarchy.lvl4)",
"unordered(hierarchy.lvl5)",
"unordered(hierarchy.lvl6)",
"content",
],
distinct: true,
attributeForDistinct: "url",
customRanking: [
"desc(weight.pageRank)",
"desc(weight.level)",
"asc(weight.position)",
],
ranking: [
"words",
"filters",
"typo",
"attribute",
"proximity",
"exact",
"custom",
],
highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">',
highlightPostTag: "</span>",
minWordSizefor1Typo: 3,
minWordSizefor2Typos: 7,
allowTyposOnNumericTokens: false,
minProximity: 1,
ignorePlurals: true,
advancedSyntax: true,
attributeCriteriaComputedByMinProximity: true,
removeWordsIfNoResults: "allOptional",
},
},
appId: "",
apiKey: "",
});