Skip to content

Commit 5fcd9e6

Browse files
committed
feat: new style
1 parent 14dc963 commit 5fcd9e6

33 files changed

+229
-158
lines changed

assets/styles/global.css

-67
This file was deleted.

docs/_meta.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
},
1212
{
1313
"text": "论坛",
14-
"link": "https://github.com/orgs/BiliUniverse/discussions",
15-
"activeMatch": "^/discussions/"
14+
"link": "https://github.com/orgs/BiliUniverse/discussions"
1615
},
1716
{
1817
"type": "custom-link",
1918
"text": "赞助",
20-
"link": "https://afdian.com/a/HashBrown",
21-
"activeMatch": "^/a/HashBrown"
19+
"link": "https://afdian.com/a/HashBrown"
2220
}
2321
]

docs/public/rspress-dark-logo.png

-6.15 KB
Binary file not shown.

docs/public/rspress-icon.png

-100 KB
Binary file not shown.

docs/public/rspress-light-logo.png

-6.23 KB
Binary file not shown.

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@
99
},
1010
"dependencies": {
1111
"@iringo/doc-ui": "^2.0.0",
12-
"rehype-urls": "^1.2.0",
12+
"remark-github": "^12.0.0",
1313
"rspress": "^1.37.2",
1414
"rspress-plugin-changelog": "^1.1.2",
15-
"rspress-plugin-font-open-sans": "^1.0.0",
1615
"rspress-plugin-sitemap": "^1.1.1"
1716
},
1817
"devDependencies": {
1918
"@biomejs/biome": "^1.9.4",
2019
"@rspress/shared": "^1.37.4",
2120
"@types/node": "^16.18.121",
22-
"remark-github": "^12.0.0"
21+
"@types/react": "^18.3.11",
22+
"typescript": "^5.7.2"
2323
},
2424
"repository": {
2525
"type": "git",
2626
"url": "https://github.com/Auraflare/Auraflare.github.io.git"
27-
}
27+
},
28+
"packageManager": "[email protected]"
2829
}

pnpm-lock.yaml

+16-51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rspress.config.ts

+3-27
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
3-
import type { UrlWithStringQuery } from 'node:url';
43
import { pluginChangelog } from 'rspress-plugin-changelog';
54
import type { ChangelogPluginOptions } from 'rspress-plugin-changelog';
6-
import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
75
import pluginSitemap from 'rspress-plugin-sitemap';
86
import { defineConfig } from 'rspress/config';
97

10-
const siteUrl = 'https://Auraflare.github.io';
11-
128
const generateChangelogParams = (items: Omit<ChangelogPluginOptions['items'][number], 'type'>[]) =>
139
items.map<ChangelogPluginOptions['items'][number]>((item) => ({
1410
type: 'github-releases',
@@ -22,15 +18,15 @@ export default defineConfig({
2218
description: 'Cloudflare® 资源集成解决方案',
2319
icon: 'https://avatars.githubusercontent.com/u/190900859?s=200&v=4',
2420
logo: 'https://avatars.githubusercontent.com/u/190900859?s=80&v=4',
21+
logoText: 'Auraflare',
2522
// logo: {
2623
// light: '/rspress-light-logo.png',
2724
// dark: '/rspress-dark-logo.png',
2825
// },
29-
globalStyles: path.resolve('./assets/styles/global.css'),
3026
head: [
3127
['link', { ref: 'preconnect', href: '//ipolyfill.edge-byted.com' }],
3228
['link', { ref: 'dns-prefetch', href: '//ipolyfill.edge-byted.com' }],
33-
['script', { src: '//ipolyfill.edge-byted.com/0.0.24/polyfill.min.js', crossorigin: '' }],
29+
['script', { src: '//ipolyfill.edge-byted.com/0.0.25/polyfill.min.js', crossorigin: '' }],
3430
],
3531
themeConfig: {
3632
socialLinks: [
@@ -52,30 +48,10 @@ export default defineConfig({
5248
markdown: {
5349
mdxRs: false,
5450
remarkPlugins: [[require('remark-github')]],
55-
rehypePlugins: [
56-
[
57-
require('rehype-urls'),
58-
(url: UrlWithStringQuery, node: any) => {
59-
switch (url.host) {
60-
case 't.me':
61-
case 'github.com':
62-
node.properties.target = '_blank';
63-
break;
64-
case null:
65-
//console.log(url);
66-
break;
67-
default:
68-
//console.log(url);
69-
break;
70-
}
71-
},
72-
],
73-
],
7451
},
7552
plugins: [
76-
pluginFontOpenSans(),
7753
pluginSitemap({
78-
domain: siteUrl,
54+
domain: 'https://Auraflare.github.io',
7955
}),
8056
pluginChangelog({
8157
fetchOnDev: false,
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { useEffect, useState } from 'react';
2+
3+
export const useTopArrived = () => {
4+
const [scrollY, setScrollY] = useState(0);
5+
const topArrived = scrollY < 100;
6+
7+
useEffect(() => {
8+
const handleScroll = () => {
9+
setScrollY(window.scrollY);
10+
};
11+
window.addEventListener('scroll', handleScroll, {
12+
capture: false,
13+
passive: true,
14+
});
15+
return () => {
16+
window.removeEventListener('scroll', handleScroll);
17+
};
18+
}, []);
19+
20+
return {
21+
topArrived,
22+
};
23+
};

theme/components/layout/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './layout';

0 commit comments

Comments
 (0)