Add DocSearch and styles

* add images
This commit is contained in:
Defectink
2022-04-14 11:00:03 +08:00
parent 5f11971a90
commit 3a42b44612
34 changed files with 6245 additions and 29 deletions

View File

@ -1,34 +1,19 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
<img src="./public/images/img/64.png" style="width: 128px; height: 128px;" alt=''/>
## Getting Started
## 小破站
First, run the development server:
<div>
<img src="https://img.shields.io/github/workflow/status/DefectingCat/DefectingCat.github.io/Export%20static%20to%20github%20pages?style=flat-square" alt=''/>
<a href="https://rua.plus/" target="_blank" rel="noreferrer">
<img src="https://img.shields.io/website?style=flat-square&url=https%3A%2F%2Frua.plus" alt=''/>
</a>
</div>
```bash
npm run dev
# or
yarn dev
```
咸鱼的个人站点 ✍,[RUA](https://rua.plus/)。
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## ❤️
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
- Host on [Vercel](https://vercel.com/)
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Powered by [Next.js](https://nextjs.org/) ❤️ [Tailwind CSS](https://tailwindcss.com/).

View File

@ -3,6 +3,8 @@ import Link from 'next/link';
import { FC, useCallback, useState } from 'react';
import { FiMenu } from 'react-icons/fi';
import dynamic from 'next/dynamic';
import { DocSearch } from '@docsearch/react';
import '@docsearch/css';
const DarkModeBtn = dynamic(() => import('components/DarkModeBtn'));
@ -70,7 +72,7 @@ const HeadBar: FC = () => {
showMenu || 'hidden'
)}
>
<ul className={cn('flex flex-col', 'md:flex-row')}>
<ul className={cn('flex flex-col ', 'md:flex-row md:items-center')}>
{txtMenu.map((m) => (
<li
key={m.id}
@ -89,6 +91,13 @@ const HeadBar: FC = () => {
>
<DarkModeBtn />
</li>
<li className="DocSearch-wrapper">
<DocSearch
appId="R2IYF7ETH7"
indexName="599cec31baffa4868cae4e79f180729b"
apiKey="docsearch"
/>
</li>
</ul>
</nav>
</header>

View File

@ -12,6 +12,7 @@
},
"dependencies": {
"@codesandbox/sandpack-react": "^0.18.1",
"@docsearch/react": "3",
"@mapbox/rehype-prism": "^0.8.0",
"@mdx-js/loader": "^2.1.0",
"@mdx-js/react": "^2.1.0",

View File

@ -10,6 +10,11 @@ export default function Document() {
href="https://fonts.googleapis.com/css2?family=Aleo&family=Aref+Ruqaa&family=Barlow:ital,wght@0,400;0,600;1,400;1,600&family=Poppins:ital@0;1&display=swap"
rel="stylesheet"
/>
<link
rel="preconnect"
href="https://YOUR_APP_ID-dsn.algolia.net"
crossOrigin=""
/>
</Head>
<body>
<Main />

4801
public/images/img/64.ai Normal file

File diff suppressed because one or more lines are too long

BIN
public/images/img/64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

1
public/images/img/64.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

890
public/images/img/avatar.ai Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
public/images/img/mona.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
public/images/img/post.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<style>
.prefix__b {
fill: #fad33e
}
</style>
</defs>
<path
d="M.02 46.14v-10c1.85-12.07 6.63-22.49 17-29.68a37 37 0 0117-6.46h12.19C58.42 1.53 67.1 8.75 74.3 18c2.39 3.05 3.26 2.69 5.47-.1C87.04 8.72 95.69 1.48 107.92.02h12.21c24.77 3.94 39.1 27.49 32.3 53.22-3.73 14.13-11.64 26-21 36.9-4.94 5.79-10.3 11.22-15.47 16.81-11.25 9.63-22.56 19.16-35 27.25-3 1.94-5 1.94-7.95 0a315.43 315.43 0 01-27.87-21c-1.05-5 1.86-8 5.31-10.73 2.65-2.08 6-2.79 8.93-4.39 1.47-.81 3.05-1.64 3-3.63a3.39 3.39 0 00-2.88-3.08c-11-2.51-15-11.09-18.26-20.47a7.32 7.32 0 00-.55-1.39c-1.37-2.3-1.38-6.31-4.85-6.16-3.22.14-3.74 3.86-4.88 6.34-1.88 4.07-3.29 8.37-5.47 12.29-1.29 2.31-2.51 5.31-6.26 4.38C10.02 74.25 2.27 61.51.02 46.14z"
fill="#f72e5f" />
<path class="prefix__b"
d="M19.15 86.29c3.43-1 4.83-3.83 6.11-6.77 2.18-5 4.37-10.06 6.53-15.1.77-1.79 1.83-3.17 4-3.25s3.21 1.48 4 3.21c2.12 4.87 4.37 9.71 6.23 14.68a14.89 14.89 0 009.28 9.1c1.86.7 3.71 1.45 5.51 2.31s3.23 1.73 3.34 3.94c.12 2.48-1.57 3.52-3.39 4.43a29.75 29.75 0 01-4.56 2c-6.18 1.89-9.72 6.08-11 12.29-1.78 3.91-3.57 7.82-5.33 11.74-.87 1.92-1.94 3.46-4.4 3.29-2.19-.16-3-1.69-3.78-3.43-1.94-4.57-4.19-9-5.79-13.72a15.61 15.61 0 00-10.15-10.09 27.42 27.42 0 01-2.78-1.06c-2.34-1.14-5.4-1.87-5.5-5.05-.12-3.52 3.11-4.34 5.63-5.46 1.99-.94 4.31-1.41 6.05-3.06zM118.2 16.23c1.53.06 2 1.19 2.47 2.25 2.41 5.82 4.38 11.85 11.54 13.91 2.1.6 1.93 3.06-.13 3.63-6.79 1.86-8.87 7.42-11.1 13-.52 1.32-.9 3.08-2.86 3s-2.23-1.84-2.77-3.16c-2.2-5.37-3.92-10.89-10.71-12.64-2.66-.68-2.38-3.58.14-4.22 6.59-1.66 8.32-7 10.45-12.24.59-1.46.93-3.33 2.97-3.53z" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
public/images/img/tags.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -53,3 +53,48 @@ font-family: 'Poppins', sans-serif;
box-shadow: inset 0 0 10px rgba(185, 69, 69, 0.2);
}
}
/* DocSearch */
html.dark {
--docsearch-text-color: #f5f6f7;
--docsearch-container-background: rgba(9, 10, 17, 0.8);
--docsearch-modal-background: #15172a;
--docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
--docsearch-searchbox-background: #090a11;
--docsearch-searchbox-focus-background: #000;
--docsearch-hit-color: #bec3c9;
--docsearch-hit-shadow: none;
--docsearch-hit-background: #090a11;
--docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b);
--docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d,
0 2px 2px 0 rgba(3, 4, 9, 0.3);
--docsearch-footer-background: #1e2136;
--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
0 -4px 8px 0 rgba(0, 0, 0, 0.2);
--docsearch-logo-color: #fff;
--docsearch-muted-color: #7f8497;
}
html {
--docsearch-primary-color: rgb(75, 85, 99) !important;
}
.DocSearch-wrapper .DocSearch-Button {
margin-left: unset;
}
@media (max-width: 640px) {
.DocSearch-wrapper .DocSearch-Button {
align-items: unset;
background: unset;
padding: unset;
height: unset;
}
}
.DocSearch-wrapper .DocSearch-Button .DocSearch-Search-Icon {
@apply text-gray-600 dark:text-gray-200;
}
.DocSearch .DocSearch-Form {
border-radius: 6px;
}
.DocSearch .DocSearch-Screen-Icon {
display: flex;
justify-content: center;
}

158
yarn.lock
View File

@ -2,6 +2,129 @@
# yarn lockfile v1
"@algolia/autocomplete-core@1.5.2":
version "1.5.2"
resolved "https://registry.npmmirror.com/@algolia/autocomplete-core/-/autocomplete-core-1.5.2.tgz#ec0178e07b44fd74a057728ac157291b26cecf37"
integrity sha512-DY0bhyczFSS1b/CqJlTE/nQRtnTAHl6IemIkBy0nEWnhDzRDdtdx4p5Uuk3vwAFxwEEgi1WqKwgSSMx6DpNL4A==
dependencies:
"@algolia/autocomplete-shared" "1.5.2"
"@algolia/autocomplete-preset-algolia@1.5.2":
version "1.5.2"
resolved "https://registry.npmmirror.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.5.2.tgz#36c5638cc6dba6ea46a86e5a0314637ca40a77ca"
integrity sha512-3MRYnYQFJyovANzSX2CToS6/5cfVjbLLqFsZTKcvF3abhQzxbqwwaMBlJtt620uBUOeMzhdfasKhCc40+RHiZw==
dependencies:
"@algolia/autocomplete-shared" "1.5.2"
"@algolia/autocomplete-shared@1.5.2":
version "1.5.2"
resolved "https://registry.npmmirror.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.5.2.tgz#e157f9ad624ab8fd940ff28bd2094cdf199cdd79"
integrity sha512-ylQAYv5H0YKMfHgVWX0j0NmL8XBcAeeeVQUmppnnMtzDbDnca6CzhKj3Q8eF9cHCgcdTDdb5K+3aKyGWA0obug==
"@algolia/cache-browser-local-storage@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.13.0.tgz#f8aa4fe31104b19d616ea392f9ed5c2ea847d964"
integrity sha512-nj1vHRZauTqP/bluwkRIgEADEimqojJgoTRCel5f6q8WCa9Y8QeI4bpDQP28FoeKnDRYa3J5CauDlN466jqRhg==
dependencies:
"@algolia/cache-common" "4.13.0"
"@algolia/cache-common@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/cache-common/-/cache-common-4.13.0.tgz#27b83fd3939d08d72261b36a07eeafc4cb4d2113"
integrity sha512-f9mdZjskCui/dA/fA/5a+6hZ7xnHaaZI5tM/Rw9X8rRB39SUlF/+o3P47onZ33n/AwkpSbi5QOyhs16wHd55kA==
"@algolia/cache-in-memory@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/cache-in-memory/-/cache-in-memory-4.13.0.tgz#10801a74550cbabb64b59ff08c56bce9c278ff2d"
integrity sha512-hHdc+ahPiMM92CQMljmObE75laYzNFYLrNOu0Q3/eyvubZZRtY2SUsEEgyUEyzXruNdzrkcDxFYa7YpWBJYHAg==
dependencies:
"@algolia/cache-common" "4.13.0"
"@algolia/client-account@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/client-account/-/client-account-4.13.0.tgz#f8646dd40d1e9e3353e10abbd5d6c293ea92a8e2"
integrity sha512-FzFqFt9b0g/LKszBDoEsW+dVBuUe1K3scp2Yf7q6pgHWM1WqyqUlARwVpLxqyc+LoyJkTxQftOKjyFUqddnPKA==
dependencies:
"@algolia/client-common" "4.13.0"
"@algolia/client-search" "4.13.0"
"@algolia/transporter" "4.13.0"
"@algolia/client-analytics@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/client-analytics/-/client-analytics-4.13.0.tgz#a00bd02df45d71becb9dd4c5c993d805f2e1786d"
integrity sha512-klmnoq2FIiiMHImkzOm+cGxqRLLu9CMHqFhbgSy9wtXZrqb8BBUIUE2VyBe7azzv1wKcxZV2RUyNOMpFqmnRZA==
dependencies:
"@algolia/client-common" "4.13.0"
"@algolia/client-search" "4.13.0"
"@algolia/requester-common" "4.13.0"
"@algolia/transporter" "4.13.0"
"@algolia/client-common@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/client-common/-/client-common-4.13.0.tgz#8bc373d164dbdcce38b4586912bbe162492bcb86"
integrity sha512-GoXfTp0kVcbgfSXOjfrxx+slSipMqGO9WnNWgeMmru5Ra09MDjrcdunsiiuzF0wua6INbIpBQFTC2Mi5lUNqGA==
dependencies:
"@algolia/requester-common" "4.13.0"
"@algolia/transporter" "4.13.0"
"@algolia/client-personalization@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/client-personalization/-/client-personalization-4.13.0.tgz#10fb7af356422551f11a67222b39c52306f1512c"
integrity sha512-KneLz2WaehJmNfdr5yt2HQETpLaCYagRdWwIwkTqRVFCv4DxRQ2ChPVW9jeTj4YfAAhfzE6F8hn7wkQ/Jfj6ZA==
dependencies:
"@algolia/client-common" "4.13.0"
"@algolia/requester-common" "4.13.0"
"@algolia/transporter" "4.13.0"
"@algolia/client-search@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/client-search/-/client-search-4.13.0.tgz#2d8ff8e755c4a37ec89968f3f9b358eed005c7f0"
integrity sha512-blgCKYbZh1NgJWzeGf+caKE32mo3j54NprOf0LZVCubQb3Kx37tk1Hc8SDs9bCAE8hUvf3cazMPIg7wscSxspA==
dependencies:
"@algolia/client-common" "4.13.0"
"@algolia/requester-common" "4.13.0"
"@algolia/transporter" "4.13.0"
"@algolia/logger-common@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/logger-common/-/logger-common-4.13.0.tgz#be2606e71aae618a1ff1ea9a1b5f5a74284b35a8"
integrity sha512-8yqXk7rMtmQJ9wZiHOt/6d4/JDEg5VCk83gJ39I+X/pwUPzIsbKy9QiK4uJ3aJELKyoIiDT1hpYVt+5ia+94IA==
"@algolia/logger-console@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/logger-console/-/logger-console-4.13.0.tgz#f28028a760e3d9191e28a10b12925e48f6c9afde"
integrity sha512-YepRg7w2/87L0vSXRfMND6VJ5d6699sFJBRWzZPOlek2p5fLxxK7O0VncYuc/IbVHEgeApvgXx0WgCEa38GVuQ==
dependencies:
"@algolia/logger-common" "4.13.0"
"@algolia/requester-browser-xhr@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.13.0.tgz#e2483f4e8d7f09e27cd0daf6c77711d15c5a919f"
integrity sha512-Dj+bnoWR5MotrnjblzGKZ2kCdQi2cK/VzPURPnE616NU/il7Ypy6U6DLGZ/ZYz+tnwPa0yypNf21uqt84fOgrg==
dependencies:
"@algolia/requester-common" "4.13.0"
"@algolia/requester-common@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/requester-common/-/requester-common-4.13.0.tgz#47fb3464cfb26b55ba43676d13f295d812830596"
integrity sha512-BRTDj53ecK+gn7ugukDWOOcBRul59C4NblCHqj4Zm5msd5UnHFjd/sGX+RLOEoFMhetILAnmg6wMrRrQVac9vw==
"@algolia/requester-node-http@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/requester-node-http/-/requester-node-http-4.13.0.tgz#7d981bbd31492f51dd11820a665f9d8906793c37"
integrity sha512-9b+3O4QFU4azLhGMrZAr/uZPydvzOR4aEZfSL8ZrpLZ7fbbqTO0S/5EVko+QIgglRAtVwxvf8UJ1wzTD2jvKxQ==
dependencies:
"@algolia/requester-common" "4.13.0"
"@algolia/transporter@4.13.0":
version "4.13.0"
resolved "https://registry.npmmirror.com/@algolia/transporter/-/transporter-4.13.0.tgz#f6379e5329efa2127da68c914d1141f5f21dbd07"
integrity sha512-8tSQYE+ykQENAdeZdofvtkOr5uJ9VcQSWgRhQ9h01AehtBIPAczk/b2CLrMsw5yQZziLs5cZ3pJ3478yI+urhA==
dependencies:
"@algolia/cache-common" "4.13.0"
"@algolia/logger-common" "4.13.0"
"@algolia/requester-common" "4.13.0"
"@ampproject/remapping@^2.1.0":
version "2.1.2"
resolved "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34"
@ -539,6 +662,21 @@
react-devtools-inline "4.4.0"
react-is "^17.0.2"
"@docsearch/css@3.0.0":
version "3.0.0"
resolved "https://registry.npmmirror.com/@docsearch/css/-/css-3.0.0.tgz#fe57b474802ffd706d3246eab25d52fac8aa3698"
integrity sha512-1kkV7tkAsiuEd0shunYRByKJe3xQDG2q7wYg24SOw1nV9/2lwEd4WrUYRJC/ukGTl2/kHeFxsaUvtiOy0y6fFA==
"@docsearch/react@3":
version "3.0.0"
resolved "https://registry.npmmirror.com/@docsearch/react/-/react-3.0.0.tgz#d02ebdc67573412185a6a4df13bc254c7c0da491"
integrity sha512-yhMacqS6TVQYoBh/o603zszIb5Bl8MIXuOc6Vy617I74pirisDzzcNh0NEaYQt50fVVR3khUbeEhUEWEWipESg==
dependencies:
"@algolia/autocomplete-core" "1.5.2"
"@algolia/autocomplete-preset-algolia" "1.5.2"
"@docsearch/css" "3.0.0"
algoliasearch "^4.0.0"
"@eslint/eslintrc@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.1.tgz#8b5e1c49f4077235516bc9ec7d41378c0f69b8c6"
@ -1372,6 +1510,26 @@ ajv@^6.10.0, ajv@^6.12.4:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
algoliasearch@^4.0.0:
version "4.13.0"
resolved "https://registry.npmmirror.com/algoliasearch/-/algoliasearch-4.13.0.tgz#e36611fda82b1fc548c156ae7929a7f486e4b663"
integrity sha512-oHv4faI1Vl2s+YC0YquwkK/TsaJs79g2JFg5FDm2rKN12VItPTAeQ7hyJMHarOPPYuCnNC5kixbtcqvb21wchw==
dependencies:
"@algolia/cache-browser-local-storage" "4.13.0"
"@algolia/cache-common" "4.13.0"
"@algolia/cache-in-memory" "4.13.0"
"@algolia/client-account" "4.13.0"
"@algolia/client-analytics" "4.13.0"
"@algolia/client-common" "4.13.0"
"@algolia/client-personalization" "4.13.0"
"@algolia/client-search" "4.13.0"
"@algolia/logger-common" "4.13.0"
"@algolia/logger-console" "4.13.0"
"@algolia/requester-browser-xhr" "4.13.0"
"@algolia/requester-common" "4.13.0"
"@algolia/requester-node-http" "4.13.0"
"@algolia/transporter" "4.13.0"
ansi-align@^2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f"