Skip to content

Commit

Permalink
feat: new style
Browse files Browse the repository at this point in the history
  • Loading branch information
VirgilClyne committed Dec 14, 2024
1 parent 14dc963 commit 41bfe45
Show file tree
Hide file tree
Showing 33 changed files with 328 additions and 157 deletions.
67 changes: 0 additions & 67 deletions assets/styles/global.css

This file was deleted.

6 changes: 2 additions & 4 deletions docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
},
{
"text": "论坛",
"link": "https://github.com/orgs/BiliUniverse/discussions",
"activeMatch": "^/discussions/"
"link": "https://github.com/orgs/BiliUniverse/discussions"
},
{
"type": "custom-link",
"text": "赞助",
"link": "https://afdian.com/a/HashBrown",
"activeMatch": "^/a/HashBrown"
"link": "https://afdian.com/a/HashBrown"
}
]
Binary file removed docs/public/rspress-dark-logo.png
Binary file not shown.
Binary file removed docs/public/rspress-icon.png
Binary file not shown.
Binary file removed docs/public/rspress-light-logo.png
Binary file not shown.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@iringo/doc-ui": "^2.0.0",
"rehype-urls": "^1.2.0",
"remark-github": "^12.0.0",
"rspress": "^1.37.2",
"rspress-plugin-changelog": "^1.1.2",
"rspress-plugin-font-open-sans": "^1.0.0",
Expand All @@ -19,10 +19,12 @@
"@biomejs/biome": "^1.9.4",
"@rspress/shared": "^1.37.4",
"@types/node": "^16.18.121",
"remark-github": "^12.0.0"
"@types/react": "^18.3.11",
"typescript": "^5.7.2"
},
"repository": {
"type": "git",
"url": "https://github.com/Auraflare/Auraflare.github.io.git"
}
},
"packageManager": "[email protected]"
}
67 changes: 16 additions & 51 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 3 additions & 27 deletions rspress.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import fs from 'node:fs';
import path from 'node:path';
import type { UrlWithStringQuery } from 'node:url';
import { pluginChangelog } from 'rspress-plugin-changelog';
import type { ChangelogPluginOptions } from 'rspress-plugin-changelog';
import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
import pluginSitemap from 'rspress-plugin-sitemap';
import { defineConfig } from 'rspress/config';

const siteUrl = 'https://Auraflare.github.io';

const generateChangelogParams = (items: Omit<ChangelogPluginOptions['items'][number], 'type'>[]) =>
items.map<ChangelogPluginOptions['items'][number]>((item) => ({
type: 'github-releases',
Expand All @@ -22,15 +18,15 @@ export default defineConfig({
description: 'Cloudflare® 资源集成解决方案',
icon: 'https://avatars.githubusercontent.com/u/190900859?s=200&v=4',
logo: 'https://avatars.githubusercontent.com/u/190900859?s=80&v=4',
logoText: 'Auraflare',
// logo: {
// light: '/rspress-light-logo.png',
// dark: '/rspress-dark-logo.png',
// },
globalStyles: path.resolve('./assets/styles/global.css'),
head: [
['link', { ref: 'preconnect', href: '//ipolyfill.edge-byted.com' }],
['link', { ref: 'dns-prefetch', href: '//ipolyfill.edge-byted.com' }],
['script', { src: '//ipolyfill.edge-byted.com/0.0.24/polyfill.min.js', crossorigin: '' }],
['script', { src: '//ipolyfill.edge-byted.com/0.0.25/polyfill.min.js', crossorigin: '' }],
],
themeConfig: {
socialLinks: [
Expand All @@ -52,30 +48,10 @@ export default defineConfig({
markdown: {
mdxRs: false,
remarkPlugins: [[require('remark-github')]],
rehypePlugins: [
[
require('rehype-urls'),
(url: UrlWithStringQuery, node: any) => {
switch (url.host) {
case 't.me':
case 'github.com':
node.properties.target = '_blank';
break;
case null:
//console.log(url);
break;
default:
//console.log(url);
break;
}
},
],
],
},
plugins: [
pluginFontOpenSans(),
pluginSitemap({
domain: siteUrl,
domain: 'https://Auraflare.github.io',
}),
pluginChangelog({
fetchOnDev: false,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions theme/components/layout/hooks/use-top-arrived.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useEffect, useState } from 'react';

export const useTopArrived = () => {
const [scrollY, setScrollY] = useState(0);
const topArrived = scrollY < 100;

useEffect(() => {
const handleScroll = () => {
setScrollY(window.scrollY);
};
window.addEventListener('scroll', handleScroll, {
capture: false,
passive: true,
});
return () => {
window.removeEventListener('scroll', handleScroll);
};
}, []);

return {
topArrived,
};
};
1 change: 1 addition & 0 deletions theme/components/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './layout';
Loading

0 comments on commit 41bfe45

Please sign in to comment.