diff --git a/.env b/.env new file mode 100644 index 0000000..1f30cfc --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +TYPESENSE_API_KEY=xyz +TYPESENSE_HOST=xxx.a1.typesense.net +TYPESENSE_PORT=443 +TYPESENSE_PROTOCOL=https \ No newline at end of file diff --git a/.gitignore b/.gitignore index bbd20f1..299ae84 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +build/ node_modules .next .DS_Store diff --git a/config.json b/config.json new file mode 100644 index 0000000..f19225e --- /dev/null +++ b/config.json @@ -0,0 +1,50 @@ +{ + "index_name": "openmev-docs", + "start_urls": [ + "https://docs.openmev.org/" + ], + "sitemap_urls": [ + "https://docs.openmev.org/sitemap.xml" + ], + "sitemap_alternate_links": true, + "stop_urls": [ + "/tests" + ], + "selectors": { + "lvl0": { + "selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]", + "type": "xpath", + "global": true, + "default_value": "Documentation" + }, + "lvl1": "header h1", + "lvl2": "article h2", + "lvl3": "article h3", + "lvl4": "article h4", + "lvl5": "article h5, article td:first-child", + "lvl6": "article h6", + "text": "article p, article li, article td:last-child" + }, + "strip_chars": " .,;:#", + "custom_settings": { + "separatorsToIndex": "_", + "attributesForFaceting": [ + "language", + "version", + "type", + "openmev_version" + ], + "attributesToRetrieve": [ + "hierarchy", + "content", + "anchor", + "url", + "url_without_anchor", + "type" + ] + }, + "conversation_id": [ + "833762294" + ], + "nb_hits": 46250 +} \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index fdae222..513601d 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -29,20 +29,25 @@ module.exports = { [ '@docusaurus/preset-classic', /** @type {import('@docusaurus/preset-classic').Options} */ - ({ + ({ docs: { sidebarPath: require.resolve('./sidebars.js'), editUrl: 'https://github.com/openmev/docs/edit/main/', routeBasePath: '/', }, + sitemap: { + changefreq: 'weekly', + priority: 0.5, + }, theme: { customCss: require.resolve('./src/css/custom.css'), customCss2: require.resolve('./src/css/colors.css'), }, }), ], - ], + + ], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ diff --git a/package.json b/package.json index d923974..515bb28 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "dependencies": { "@cmfcmf/docusaurus-search-local": "^0.10.0", "@docusaurus/core": "2.0.0-beta.18", - "@docusaurus/preset-classic": "2.0.0-beta.18", + "@docusaurus/plugin-sitemap": "^2.0.0-beta.18", + "@docusaurus/preset-classic": "^2.0.0-beta.18", "@mdx-js/react": "^1.6.22", "clsx": "^1.1.1", "commitizen": "^4.2.4", diff --git a/run-indexer.sh b/run-indexer.sh new file mode 100755 index 0000000..2723ed2 --- /dev/null +++ b/run-indexer.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run -it --env-file=/path/to/your/.env -e "CONFIG=$(cat /path/to/your/config.json | jq -r tostring)" typesense/docsearch-scraper \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 710a2e0..b125d2c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1806,9 +1806,9 @@ "@docusaurus/utils-validation" "2.0.0-beta.18" tslib "^2.3.1" -"@docusaurus/plugin-sitemap@2.0.0-beta.18": +"@docusaurus/plugin-sitemap@2.0.0-beta.18", "@docusaurus/plugin-sitemap@^2.0.0-beta.18": version "2.0.0-beta.18" - resolved "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.0.0-beta.18.tgz" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.0.0-beta.18.tgz#7e8217e95bede5719bd02265dcf7eb2fea76b675" integrity sha512-Klonht0Ye3FivdBpS80hkVYNOH+8lL/1rbCPEV92rKhwYdwnIejqhdKct4tUTCl8TYwWiyeUFQqobC/5FNVZPQ== dependencies: "@docusaurus/core" "2.0.0-beta.18" @@ -1819,9 +1819,9 @@ sitemap "^7.1.1" tslib "^2.3.1" -"@docusaurus/preset-classic@2.0.0-beta.18": +"@docusaurus/preset-classic@^2.0.0-beta.18": version "2.0.0-beta.18" - resolved "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-2.0.0-beta.18.tgz" + resolved "https://registry.yarnpkg.com/@docusaurus/preset-classic/-/preset-classic-2.0.0-beta.18.tgz#82f6905d34a13e46289ac4d2f1125e47033bd9d8" integrity sha512-TfDulvFt/vLWr/Yy7O0yXgwHtJhdkZ739bTlFNwEkRMAy8ggi650e52I1I0T79s67llecb4JihgHPW+mwiVkCQ== dependencies: "@docusaurus/core" "2.0.0-beta.18"