diff --git a/data/friend.ts b/data/friends.tsx similarity index 100% rename from data/friend.ts rename to data/friends.tsx diff --git a/data/project.ts b/data/projects.tsx similarity index 100% rename from data/project.ts rename to data/projects.tsx diff --git a/data/resource.ts b/data/resources.tsx similarity index 99% rename from data/resource.ts rename to data/resources.tsx index fb0e90a8..fc4ca8a3 100644 --- a/data/resource.ts +++ b/data/resources.tsx @@ -1,4 +1,4 @@ -import { Friends } from './friend' +import { Friends } from './friends' export interface Resource { name: string diff --git a/data/social.tsx b/data/social.tsx index ad80c84a..1764ca22 100644 --- a/data/social.tsx +++ b/data/social.tsx @@ -15,7 +15,7 @@ const social: Social = { twitter: 'https://twitter.com/kuizuo', juejin: 'https://juejin.cn/user/1565318510545901', csdn: 'https://blog.csdn.net/kuizuo12', - qq: 'https://wpa.qq.com/msgrd?v=3&uin=911993023&site=qq', + qq: 'https://img.kuizuo.cn/qq.png', wx: 'https://img.kuizuo.cn/wechat.png', // zhihu: 'https://www.zhihu.com/people/kuizuo', // cloudmusic: 'https://music.163.com/#/user/home?id=1333010742', diff --git a/src/components/UserCard/index.tsx b/src/components/UserCard/index.tsx index 7bbf5dee..287f7eff 100644 --- a/src/components/UserCard/index.tsx +++ b/src/components/UserCard/index.tsx @@ -9,7 +9,7 @@ import { useThemeConfig } from '@docusaurus/theme-common' import useBaseUrl from '@docusaurus/useBaseUrl' import useDocusaurusContext from '@docusaurus/useDocusaurusContext' -import { projects } from '@site/data/project' +import { projects } from '@site/data/projects' import styles from './styles.module.scss' diff --git a/src/pages/_components/ProjectSection/index.tsx b/src/pages/_components/ProjectSection/index.tsx index b9206beb..095b8480 100644 --- a/src/pages/_components/ProjectSection/index.tsx +++ b/src/pages/_components/ProjectSection/index.tsx @@ -1,6 +1,6 @@ import React, { useLayoutEffect, useRef } from 'react' import clsx from 'clsx' -import { Project, projects } from '@site/data/project' +import { Project, projects } from '@site/data/projects' import Translate from '@docusaurus/Translate' import styles from './styles.module.scss' import { diff --git a/src/pages/friends/_components/FriendCard/index.tsx b/src/pages/friends/_components/FriendCard/index.tsx index 4ed3600b..c2d344a6 100644 --- a/src/pages/friends/_components/FriendCard/index.tsx +++ b/src/pages/friends/_components/FriendCard/index.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx' import Link from '@docusaurus/Link' import styles from './styles.module.css' -import { type Friend } from '@site/data/friend' +import { type Friend } from '@site/data/friends' const FriendCard = memo(({ friend }: { friend: Friend }) => (
  • diff --git a/src/pages/friends/index.tsx b/src/pages/friends/index.tsx index 0e1e5742..d86c882e 100644 --- a/src/pages/friends/index.tsx +++ b/src/pages/friends/index.tsx @@ -3,7 +3,7 @@ import Layout from '@theme/Layout' import CodeBlock from '@theme/CodeBlock' import FriendCard from './_components/FriendCard' -import { Friends } from '@site/data/friend' +import { Friends } from '@site/data/friends' import styles from './styles.module.css' import { motion } from 'framer-motion' diff --git a/src/pages/project/_components/ShowcaseCard/index.tsx b/src/pages/project/_components/ShowcaseCard/index.tsx index b1519c89..2168d139 100644 --- a/src/pages/project/_components/ShowcaseCard/index.tsx +++ b/src/pages/project/_components/ShowcaseCard/index.tsx @@ -6,31 +6,21 @@ import Translate from '@docusaurus/Translate' import styles from './styles.module.css' import FavoriteIcon from '@site/src/components/svgIcons/FavoriteIcon' import Tooltip from '../ShowcaseTooltip' -import { - Tags, - TagList, - type TagType, - type Project, - type Tag, -} from '@site/data/project' +import { Tags, TagList, type TagType, type Project, type Tag } from '@site/data/projects' import { sortBy } from '@site/src/utils/jsUtils' -const TagComp = React.forwardRef( - ({ label, color, description }, ref) => ( -
  • - {label.toLowerCase()} - -
  • - ), -) +const TagComp = React.forwardRef(({ label, color, description }, ref) => ( +
  • + {label.toLowerCase()} + +
  • +)) function ShowcaseCardTag({ tags }: { tags: TagType[] }) { const tagObjects = tags.map(tag => ({ tag, ...Tags[tag] })) // Keep same order for all tags - const tagObjectsSorted = sortBy(tagObjects, tagObject => - TagList.indexOf(tagObject.tag), - ) + const tagObjectsSorted = sortBy(tagObjects, tagObject => TagList.indexOf(tagObject.tag)) return ( <> @@ -38,12 +28,7 @@ function ShowcaseCardTag({ tags }: { tags: TagType[] }) { const id = `showcase_card_tag_${tagObject.tag}` return ( - + ) @@ -54,17 +39,10 @@ function ShowcaseCardTag({ tags }: { tags: TagType[] }) { const ShowcaseCard = memo(({ project }: { project: Project }) => { return ( -
    +
    {project.preview && (
    - {project.title} + {project.title}
    )}
    @@ -80,10 +58,7 @@ const ShowcaseCard = memo(({ project }: { project: Project }) => { {project.source && ( 源码 diff --git a/src/pages/project/index.tsx b/src/pages/project/index.tsx index edbc37ca..628c7389 100644 --- a/src/pages/project/index.tsx +++ b/src/pages/project/index.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx' import { translate } from '@docusaurus/Translate' import useDocusaurusContext from '@docusaurus/useDocusaurusContext' import ShowcaseCard from './_components/ShowcaseCard' -import { projects, groupByProjects, projectTypeMap } from '@site/data/project' +import { projects, groupByProjects, projectTypeMap } from '@site/data/projects' import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment' @@ -79,7 +79,7 @@ function ShowcaseCards() { return (
    -

    {_.upperFirst(lang === 'en' ? key: projectTypeMap[key])}

    +

    {_.upperFirst(lang === 'en' ? key : projectTypeMap[key])}

      {value.map(project => ( diff --git a/src/pages/resource/_components/ResourceCard/index.tsx b/src/pages/resource/_components/ResourceCard/index.tsx index 41dad9ed..a0287d3e 100644 --- a/src/pages/resource/_components/ResourceCard/index.tsx +++ b/src/pages/resource/_components/ResourceCard/index.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx' import Link from '@docusaurus/Link' import styles from './styles.module.css' -import { type Resource } from '@site/data/resource' +import { type Resource } from '@site/data/resources' import Tooltip from '../../../project/_components/ShowcaseTooltip' const ResourceCard = memo(({ resource }: { resource: Resource }) => ( diff --git a/src/pages/resource/index.tsx b/src/pages/resource/index.tsx index da40baf8..a92bab53 100644 --- a/src/pages/resource/index.tsx +++ b/src/pages/resource/index.tsx @@ -1,15 +1,11 @@ import React from 'react' import clsx from 'clsx' import Link from '@docusaurus/Link' -import { - PageMetadata, - HtmlClassNameProvider, - ThemeClassNames, -} from '@docusaurus/theme-common' +import { PageMetadata, HtmlClassNameProvider, ThemeClassNames } from '@docusaurus/theme-common' import Layout from '@theme/Layout' import ResourceCard from './_components/ResourceCard' import BackToTopButton from '@theme/BackToTopButton' -import { resourceData } from '@site/data/resource' +import { resourceData } from '@site/data/resources' import styles from './resource.module.css' function CategorySidebar() { @@ -20,9 +16,7 @@ function CategorySidebar() { return (