From d6257ac5a90d22113d0bbc97615cfd941ac44090 Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Tue, 24 Dec 2024 17:21:00 +0200 Subject: [PATCH] website: add algolia --- website/docs/getting-started/index.mdx | 2 +- website/docs/support/index.mdx | 4 ++-- website/docusaurus.config.ts | 26 ++++++++++++++++++++++++-- website/package-lock.json | 18 ++++++++---------- website/package.json | 4 +++- website/static/robots.txt | 7 +++++++ 6 files changed, 45 insertions(+), 16 deletions(-) create mode 100644 website/static/robots.txt diff --git a/website/docs/getting-started/index.mdx b/website/docs/getting-started/index.mdx index 77edbed..1ef72fe 100644 --- a/website/docs/getting-started/index.mdx +++ b/website/docs/getting-started/index.mdx @@ -30,7 +30,7 @@ import Status from './_status.mdx' {/* ------------------------------------------------------------------------ */} [![license](https://img.shields.io/github/license/xpack-dev-tools/xpack-build-box.svg)](https://github.com/xpack-dev-tools/xpack-build-box/blob/xpack/LICENSE) -![GitHub Repo stars](https://img.shields.io/github/stars/xpack-dev-tools/xpack-build-box) +![GitHub Repo stars](https://img.shields.io/github/stars/xpack-dev-tools/xpack-build-box/) # Getting Started with the xPack Build Box diff --git a/website/docs/support/index.mdx b/website/docs/support/index.mdx index 0a672f4..5ec0cae 100644 --- a/website/docs/support/index.mdx +++ b/website/docs/support/index.mdx @@ -101,8 +101,8 @@ project, and some of their questions are tagged with `xpack` too. ## The Discord channel -For live discusssions among members, join the **xPack Community** on -[Discord](https://discord.gg/kbzWaJerFG). +For live discussions among members, join the **xPack Community** on +[Discord](https://discord.com/invite/kbzWaJerFG). Currently, there are three channels available: diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 12123a3..20ca10b 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -207,6 +207,9 @@ const config: Config = { } ], + // No longer needed. + // themes: [ '@docusaurus/theme-search-algolia' ], + themeConfig: { // The project's social card, og:image, twitter:image, 1200x630 image: 'img/sunrise-og-image.jpg', @@ -235,7 +238,7 @@ const config: Config = { }, { type: 'dropdown', - label: 'Documentation', + label: 'Getting Started', to: 'docs/getting-started', position: 'left', items: [ @@ -340,7 +343,7 @@ const config: Config = { }, { label: 'Discord', - href: 'https://discord.gg/kbzWaJerFG', + href: 'https://discord.com/invite/kbzWaJerFG', }, { label: 'X/Twitter', @@ -376,6 +379,25 @@ const config: Config = { theme: prismThemes.github, darkTheme: prismThemes.dracula, }, + algolia: { + // https://docsearch.algolia.com/docs/docsearch-v3/ + appId: "KIDD7R4CL1", + apiKey: "ca2ffc431941284609f2d50202fc5506", + indexName: "xpackio", + + // It ensures that search results are relevant to the current + // language and version. Enabled by default. + contextualSearch: false, // true, + // Optional: Replace parts of the item URLs from Algolia. + // Useful when using the same search index for multiple deployments + // using a different baseUrl. You can use regexp or string in the + // `from` param. For example: localhost:3000 vs myCompany.com/docs + // replaceSearchResultPathname: undefined, + // Optional: Algolia search parameters + searchParameters: {}, + // Optional: path for search page that enabled by default (`false` to disable it) + searchPagePath: false, // 'search', + }, } satisfies Preset.ThemeConfig, customFields: customFields, diff --git a/website/package-lock.json b/website/package-lock.json index 155cc9d..870fd86 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -12,7 +12,9 @@ "@docusaurus/plugin-client-redirects": "3.6.3", "@docusaurus/plugin-ideal-image": "3.6.3", "@docusaurus/preset-classic": "3.6.3", + "@docusaurus/theme-search-algolia": "3.6.3", "@mdx-js/react": "^3.1.0", + "clean-css": "~5.3.3", "clsx": "^2.1.1", "del-cli": "^6.0.0", "prism-react-renderer": "^2.4.0", @@ -25,7 +27,7 @@ "@docusaurus/types": "3.6.3", "docusaurus-plugin-typedoc": "^1.1.1", "json": "^11.0.0", - "typedoc": "^0.27.3", + "typedoc": "^0.27.5", "typedoc-plugin-markdown": "^4.3.2", "typescript": "~5.6.3" }, @@ -36,11 +38,13 @@ "../../../xpack.github/npm-packages/docusaurus-template-liquid.git": { "name": "@xpack/docusaurus-template-liquid", "version": "0.0.0", + "extraneous": true, "license": "MIT" }, "../../../xpack.github/npm-packages/npm-packages-helper.git": { "name": "@xpack/npm-packages-helper", "version": "1.0.0", + "extraneous": true, "license": "MIT", "devDependencies": {}, "engines": { @@ -4621,14 +4625,6 @@ "@xtuc/long": "4.2.2" } }, - "node_modules/@xpack/docusaurus-template-liquid": { - "resolved": "../../../xpack.github/npm-packages/docusaurus-template-liquid.git", - "link": true - }, - "node_modules/@xpack/npm-packages-helper": { - "resolved": "../../../xpack.github/npm-packages/npm-packages-helper.git", - "link": true - }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "license": "BSD-3-Clause" @@ -15342,7 +15338,9 @@ } }, "node_modules/typedoc": { - "version": "0.27.4", + "version": "0.27.5", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.5.tgz", + "integrity": "sha512-x+fhKJtTg4ozXwKayh/ek4wxZQI/+2hmZUdO2i2NGDBRUflDble70z+ewHod3d4gRpXSO6fnlnjbDTnJk7HlkQ==", "dev": true, "license": "Apache-2.0", "dependencies": { diff --git a/website/package.json b/website/package.json index a0dedd2..6e74d31 100644 --- a/website/package.json +++ b/website/package.json @@ -29,7 +29,9 @@ "@docusaurus/plugin-client-redirects": "3.6.3", "@docusaurus/plugin-ideal-image": "3.6.3", "@docusaurus/preset-classic": "3.6.3", + "@docusaurus/theme-search-algolia": "3.6.3", "@mdx-js/react": "^3.1.0", + "clean-css": "~5.3.3", "clsx": "^2.1.1", "prism-react-renderer": "^2.4.0", "react": "^18.0.0", @@ -42,7 +44,7 @@ "@docusaurus/types": "3.6.3", "docusaurus-plugin-typedoc": "^1.1.1", "json": "^11.0.0", - "typedoc": "^0.27.3", + "typedoc": "^0.27.5", "typedoc-plugin-markdown": "^4.3.2", "typescript": "~5.6.3" }, diff --git a/website/static/robots.txt b/website/static/robots.txt new file mode 100644 index 0000000..f46b724 --- /dev/null +++ b/website/static/robots.txt @@ -0,0 +1,7 @@ +Sitemap: https://xpack-dev-tools.github.io/xpack-build-box/sitemap.xml + +User-agent: * +Disallow: /xpack-build-box/blog/archive/ +Disallow: /xpack-build-box/blog/authors/ +Disallow: /xpack-build-box/blog/page/ +Disallow: /xpack-build-box/blog/tags/