Skip to content

Commit

Permalink
add search test
Browse files Browse the repository at this point in the history
  • Loading branch information
v1xingyue committed Sep 15, 2023
1 parent f70cdb5 commit 5abc230
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 58 deletions.
120 changes: 62 additions & 58 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

const path = require('path');
const path = require("path");

/**
* Defines a section with overridable defaults
Expand All @@ -13,16 +13,16 @@ const path = require('path');
*/
function defineSection(section, version = {}, options = {}) {
return [
'@docusaurus/plugin-content-docs',
"@docusaurus/plugin-content-docs",
/** @type {import('@docusaurus/plugin-content-docs').Options} */
({
id: section,
path: `docs/${section}`,
routeBasePath: section,
include: ['**/*.md', '**/*.mdx'],
include: ["**/*.md", "**/*.mdx"],
breadcrumbs: false,
sidebarPath: require.resolve('./sidebars.cjs'),
editUrl: 'https://github.com/CreatorsDAO/all-in-one-solana/tree/main',
sidebarPath: require.resolve("./sidebars.cjs"),
editUrl: "https://github.com/CreatorsDAO/all-in-one-solana/tree/main",
// Equivalent to `enableUpdateBy`.
showLastUpdateAuthor: true,
// Equivalent to `enableUpdateTime`.
Expand All @@ -38,126 +38,125 @@ function defineSection(section, version = {}, options = {}) {
}

const SECTIONS = [
defineSection('awesome-solana-zh'),
defineSection('Solana-Co-Learn'),
defineSection('cookbook-zh'),
defineSection("awesome-solana-zh"),
defineSection("Solana-Co-Learn"),
defineSection("cookbook-zh"),
];

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'All in One Solana',
tagline: 'Power by 706 & Rustycab',
url: 'https://www.all-in-one-blockchain.xyz/',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
title: "All in One Solana",
tagline: "Power by 706 & Rustycab",
url: "https://www.all-in-one-blockchain.xyz/",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/favicon.ico",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'CreatorsDAO', // Usually your GitHub org/user name.
projectName: 'all-in-one-solana', // Usually your repo name.
organizationName: "CreatorsDAO", // Usually your GitHub org/user name.
projectName: "all-in-one-solana", // Usually your repo name.

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
defaultLocale: "en",
locales: ["en"],
},

presets: [
[
'@docusaurus/preset-classic',
"@docusaurus/preset-classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: false,
blog: {
showReadingTime: true,
editUrl:
'https://creatorsdao.github.io/all-in-one-solana/blog',
editUrl: "https://creatorsdao.github.io/all-in-one-solana/blog",
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],

plugins: [
...SECTIONS,
path.resolve(__dirname, './plugins/webpack-plugin.cjs'),
path.resolve(__dirname, './plugins/tailwind-loader.cjs'),
path.resolve(__dirname, "./plugins/webpack-plugin.cjs"),
path.resolve(__dirname, "./plugins/tailwind-loader.cjs"),
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'All In One Solana',
title: "All In One Solana",
logo: {
alt: 'Logo',
src: 'img/my_logo.svg',
alt: "Logo",
src: "img/my_logo.svg",
},
items: [
{
href: '/awesome-solana-zh',
position: 'left',
label: 'Awesome Solana Zh',
href: "/awesome-solana-zh",
position: "left",
label: "Awesome Solana Zh",
},
{
href: '/Solana-Co-Learn',
position: 'left',
label: 'Solana Co Learn',
href: "/Solana-Co-Learn",
position: "left",
label: "Solana Co Learn",
},
{
href: '/cookbook-zh',
position: 'left',
label: 'Solana Cookbook Zh',
href: "/cookbook-zh",
position: "left",
label: "Solana Cookbook Zh",
},
{ to: '/blog', label: 'Blog', position: 'left' },
{ to: "/blog", label: "Blog", position: "left" },
{
href: 'https://github.com/CreatorsDAO/all-in-one-solana.git',
label: 'GitHub',
position: 'right',
href: "https://github.com/CreatorsDAO/all-in-one-solana.git",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: 'dark',
style: "dark",
links: [
{
title: 'Products',
title: "Products",
items: [
{
label: 'Forum',
href: 'https://github.com/CreatorsDAO/all-in-one-solana/discussions',
label: "Forum",
href: "https://github.com/CreatorsDAO/all-in-one-solana/discussions",
},
],
},
{
title: 'Community',
title: "Community",
items: [
{
label: 'Discord',
href: 'https://discord.gg/92B7aka3qr',
label: "Discord",
href: "https://discord.gg/92B7aka3qr",
},
{
label: 'Twitter',
href: 'https://twitter.com/SolanaCreators',
label: "Twitter",
href: "https://twitter.com/SolanaCreators",
},
],
},
{
title: 'More',
title: "More",
items: [
{
label: 'Blog',
to: '/blog',
label: "Blog",
to: "/blog",
},
{
label: 'GitHub',
href: 'https://github.com/CreatorsDAO',
label: "GitHub",
href: "https://github.com/CreatorsDAO",
},
],
},
Expand All @@ -168,7 +167,12 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
// Additional languages can be added here.
additionalLanguages: ['powershell', 'rust', 'toml', 'yaml', 'c', 'cpp'],
additionalLanguages: ["powershell", "rust", "toml", "yaml", "c", "cpp"],
},
algolia: {
appId: "WQYN7PW5BU",
apiKey: "a5cb50a59eda17448ce987f18a90aea8",
indexName: "solana-documents",
},
}),
};
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docsearch/react": "^3.5.2",
"@docusaurus/core": "^2.4.1",
"@docusaurus/preset-classic": "^2.4.1",
"@docusaurus/theme-common": "^2.4.1",
"@mdx-js/react": "^1.6.22",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.34",
Expand Down

0 comments on commit 5abc230

Please sign in to comment.