diff --git a/__tests__/components/NavBar.test.tsx b/__tests__/components/nav-bar.test.tsx similarity index 93% rename from __tests__/components/NavBar.test.tsx rename to __tests__/components/nav-bar.test.tsx index fcdef07..9446352 100644 --- a/__tests__/components/NavBar.test.tsx +++ b/__tests__/components/nav-bar.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from '@testing-library/react'; -import NavBar from 'components/NavBar'; +import NavBar from 'components/nav-bar'; import '@testing-library/jest-dom'; describe('NavBar', () => { diff --git a/__tests__/components/PostCard.test.tsx b/__tests__/components/post-card.test.tsx similarity index 94% rename from __tests__/components/PostCard.test.tsx rename to __tests__/components/post-card.test.tsx index 778e1ac..9462df5 100644 --- a/__tests__/components/PostCard.test.tsx +++ b/__tests__/components/post-card.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; -import PostCard from 'components/PostCard'; +import PostCard from 'components/post-card'; const post = { slug: 'first-post', diff --git a/components/common/BackToTop.tsx b/components/common/back-to-top.tsx similarity index 96% rename from components/common/BackToTop.tsx rename to components/common/back-to-top.tsx index e5869aa..8d52c50 100644 --- a/components/common/BackToTop.tsx +++ b/components/common/back-to-top.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import Button from 'components/RUA/Button'; +import Button from 'components/rua/button'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { FiChevronUp } from 'react-icons/fi'; diff --git a/components/DarkModeBtn.tsx b/components/dark-mode-btn.tsx similarity index 94% rename from components/DarkModeBtn.tsx rename to components/dark-mode-btn.tsx index bf2f184..9eff738 100644 --- a/components/DarkModeBtn.tsx +++ b/components/dark-mode-btn.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import useMounted from 'lib/hooks/useMounted'; +import useMounted from 'lib/hooks/use-mounted'; import { useTheme } from 'next-themes'; import { memo } from 'react'; import { FiMoon, FiSun } from 'react-icons/fi'; diff --git a/components/Footer.tsx b/components/footer.tsx similarity index 100% rename from components/Footer.tsx rename to components/footer.tsx diff --git a/components/gists/FileContent.tsx b/components/gists/file-content.tsx similarity index 88% rename from components/gists/FileContent.tsx rename to components/gists/file-content.tsx index 1db6208..6394c17 100644 --- a/components/gists/FileContent.tsx +++ b/components/gists/file-content.tsx @@ -1,12 +1,12 @@ -import LinkAnchor from 'components/mdx/LinkAnchor'; -import Loading from 'components/RUA/loading/RUALoading'; +import LinkAnchor from 'components/mdx/link-anchor'; +import Loading from 'components/rua/loading/rua-loading'; import dayjs from 'dayjs'; import { GistData } from 'lib/fetcher'; import dynamic from 'next/dynamic'; import Link from 'next/link'; import { memo, Suspense } from 'react'; -const GistsCode = dynamic(() => import('components/gists/GistsCode'), { +const GistsCode = dynamic(() => import('components/gists/gists-code'), { suspense: true, }); diff --git a/components/gists/GistsCode.module.css b/components/gists/gists-code.module.css similarity index 100% rename from components/gists/GistsCode.module.css rename to components/gists/gists-code.module.css diff --git a/components/gists/GistsCode.tsx b/components/gists/gists-code.tsx similarity index 97% rename from components/gists/GistsCode.tsx rename to components/gists/gists-code.tsx index 77f39a2..87f48c0 100644 --- a/components/gists/GistsCode.tsx +++ b/components/gists/gists-code.tsx @@ -7,7 +7,7 @@ import remarkParse from 'remark-parse'; import remarkRehype from 'remark-rehype'; import { GistsFile } from 'types'; import { unified } from 'unified'; -import styles from './GistsCode.module.css'; +import styles from './gists-code.module.css'; interface Props { file: GistsFile; diff --git a/components/gists/UserInfo.tsx b/components/gists/user-info.tsx similarity index 100% rename from components/gists/UserInfo.tsx rename to components/gists/user-info.tsx diff --git a/components/mdx/Anchor.tsx b/components/mdx/anchor.tsx similarity index 100% rename from components/mdx/Anchor.tsx rename to components/mdx/anchor.tsx diff --git a/components/mdx/components.ts b/components/mdx/components.ts index 73cfda1..5239dee 100644 --- a/components/mdx/components.ts +++ b/components/mdx/components.ts @@ -1,11 +1,11 @@ -import Anchor from 'components/mdx/Anchor'; -import Image from 'components/mdx/Image'; -import Pre from 'components/mdx/Pre'; -import RUACodepen from 'components/RUA/RUACodepen'; -import RUACodeSandbox from 'components/RUA/RUACodeSandbox'; -import RUASandpack from 'components/RUA/RUASandpack'; -import Tab from 'components/RUA/tab'; -import TabItem from 'components/RUA/tab/TabItem'; +import Anchor from 'components/mdx/anchor'; +import Image from 'components/mdx/image'; +import Pre from 'components/mdx/pre'; +import RUACodepen from 'components/rua/rua-codepen'; +import RUACodeSandbox from 'components/rua/rua-code-sandbox'; +import RUASandpack from 'components/rua/rua-sandpack'; +import Tab from 'components/rua/tab'; +import TabItem from 'components/rua/tab/tab-item'; const components = { RUASandpack, diff --git a/components/mdx/Image.module.css b/components/mdx/image.module.css similarity index 100% rename from components/mdx/Image.module.css rename to components/mdx/image.module.css diff --git a/components/mdx/Image.tsx b/components/mdx/image.tsx similarity index 100% rename from components/mdx/Image.tsx rename to components/mdx/image.tsx diff --git a/components/mdx/LinkAnchor.tsx b/components/mdx/link-anchor.tsx similarity index 100% rename from components/mdx/LinkAnchor.tsx rename to components/mdx/link-anchor.tsx diff --git a/components/mdx/Pre.tsx b/components/mdx/pre.tsx similarity index 88% rename from components/mdx/Pre.tsx rename to components/mdx/pre.tsx index 2c681cd..69a134b 100644 --- a/components/mdx/Pre.tsx +++ b/components/mdx/pre.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; -import CopyButton from 'components/post/CopyButton'; -import useCopyToClipboard from 'lib/hooks/useCopyToClipboard'; +import CopyButton from 'components/post/copy-button'; +import useCopyToClipboard from 'lib/hooks/use-copy-to-clipboard'; import { DetailedHTMLProps, HTMLAttributes, diff --git a/components/NavBar.tsx b/components/nav-bar.tsx similarity index 98% rename from components/NavBar.tsx rename to components/nav-bar.tsx index af9b3da..fad8bbe 100644 --- a/components/NavBar.tsx +++ b/components/nav-bar.tsx @@ -6,7 +6,7 @@ import Link from 'next/link'; import { memo, useEffect, useState } from 'react'; import { FiMenu } from 'react-icons/fi'; -const DarkModeBtn = dynamic(() => import('components/DarkModeBtn')); +const DarkModeBtn = dynamic(() => import('components/dark-mode-btn')); const txtMenu = [ { diff --git a/components/pages/ProjectCard.tsx b/components/pages/project-card.tsx similarity index 100% rename from components/pages/ProjectCard.tsx rename to components/pages/project-card.tsx diff --git a/components/PostCard.tsx b/components/post-card.tsx similarity index 100% rename from components/PostCard.tsx rename to components/post-card.tsx diff --git a/components/post/CopyButton.tsx b/components/post/copy-button.tsx similarity index 97% rename from components/post/CopyButton.tsx rename to components/post/copy-button.tsx index 3541c89..07a89a6 100644 --- a/components/post/CopyButton.tsx +++ b/components/post/copy-button.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import { memo, useState } from 'react'; -import styles from './CopytButton.module.css'; +import styles from './copyt-button.module.css'; export type CopyButtonProps = { className?: string; diff --git a/components/post/CopytButton.module.css b/components/post/copyt-button.module.css similarity index 100% rename from components/post/CopytButton.module.css rename to components/post/copyt-button.module.css diff --git a/components/post/PostComment.tsx b/components/post/post-comment.tsx similarity index 100% rename from components/post/PostComment.tsx rename to components/post/post-comment.tsx diff --git a/components/post/PostCommnetLine.tsx b/components/post/post-commnet-line.tsx similarity index 100% rename from components/post/PostCommnetLine.tsx rename to components/post/post-commnet-line.tsx diff --git a/components/post/PostToc.module.css b/components/post/post-toc.module.css similarity index 100% rename from components/post/PostToc.module.css rename to components/post/post-toc.module.css diff --git a/components/post/PostToc.tsx b/components/post/post-toc.tsx similarity index 95% rename from components/post/PostToc.tsx rename to components/post/post-toc.tsx index 8328907..394b66c 100644 --- a/components/post/PostToc.tsx +++ b/components/post/post-toc.tsx @@ -1,9 +1,9 @@ import clsx from 'clsx'; -import Anchor from 'components/mdx/Anchor'; +import Anchor from 'components/mdx/anchor'; import { SingleToc } from 'lib/utils'; import { Fragment, memo, useState } from 'react'; import { FiChevronDown } from 'react-icons/fi'; -import styles from './PostToc.module.css'; +import styles from './post-toc.module.css'; interface Props { toc: SingleToc[]; diff --git a/components/RUA/Button.tsx b/components/rua/button.tsx similarity index 100% rename from components/RUA/Button.tsx rename to components/rua/button.tsx diff --git a/components/RUA/loading/PostCardLoading.tsx b/components/rua/loading/post-card-loading.tsx similarity index 100% rename from components/RUA/loading/PostCardLoading.tsx rename to components/rua/loading/post-card-loading.tsx diff --git a/components/RUA/loading/RUALoading.tsx b/components/rua/loading/rua-loading.tsx similarity index 90% rename from components/RUA/loading/RUALoading.tsx rename to components/rua/loading/rua-loading.tsx index c8ed2f5..e4c2ff3 100644 --- a/components/RUA/loading/RUALoading.tsx +++ b/components/rua/loading/rua-loading.tsx @@ -9,7 +9,7 @@ type Props = { className?: string; }; -const RUALoading = ({ className: classNames }: Props) => { +const RuaLoading = ({ className: classNames }: Props) => { const { systemTheme, theme } = useTheme(); const currentTheme = theme === 'system' ? systemTheme : theme; @@ -34,4 +34,4 @@ const RUALoading = ({ className: classNames }: Props) => { ); }; -export default memo(RUALoading); +export default memo(RuaLoading); diff --git a/components/RUA/loading/VercelLoading.module.css b/components/rua/loading/vercel-loading.module.css similarity index 100% rename from components/RUA/loading/VercelLoading.module.css rename to components/rua/loading/vercel-loading.module.css diff --git a/components/RUA/loading/VercelLoading.tsx b/components/rua/loading/vercel-loading.tsx similarity index 96% rename from components/RUA/loading/VercelLoading.tsx rename to components/rua/loading/vercel-loading.tsx index bec2c6f..6ac803d 100644 --- a/components/RUA/loading/VercelLoading.tsx +++ b/components/rua/loading/vercel-loading.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import { memo } from 'react'; -import styles from './VercelLoading.module.css'; +import styles from './vercel-loading.module.css'; const VercelLoading = () => { return ( diff --git a/components/RUA/RUACodeSandbox.tsx b/components/rua/rua-code-sandbox.tsx similarity index 91% rename from components/RUA/RUACodeSandbox.tsx rename to components/rua/rua-code-sandbox.tsx index 8e3464c..5513457 100644 --- a/components/RUA/RUACodeSandbox.tsx +++ b/components/rua/rua-code-sandbox.tsx @@ -1,8 +1,8 @@ import clsx from 'clsx'; -import useInView from 'lib/hooks/useInView'; +import useInView from 'lib/hooks/use-in-view'; import { useTheme } from 'next-themes'; import { memo, useEffect, useState } from 'react'; -import RUALoading from './loading/RUALoading'; +import RUALoading from './loading/rua-loading'; const pattern = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/; @@ -15,7 +15,7 @@ type Props = { url: string; }; -const RUACodeSandbox = ({ url }: Props) => { +const RuaCodeSandbox = ({ url }: Props) => { const isUrl = pattern.test(url); const { systemTheme, theme } = useTheme(); const currentTheme = theme === 'system' ? systemTheme : theme ?? 'light'; @@ -64,4 +64,4 @@ const RUACodeSandbox = ({ url }: Props) => { ); }; -export default memo(RUACodeSandbox); +export default memo(RuaCodeSandbox); diff --git a/components/RUA/RUACodepen.tsx b/components/rua/rua-codepen.tsx similarity index 91% rename from components/RUA/RUACodepen.tsx rename to components/rua/rua-codepen.tsx index c51df0f..bb7c3ae 100644 --- a/components/RUA/RUACodepen.tsx +++ b/components/rua/rua-codepen.tsx @@ -1,8 +1,8 @@ import clsx from 'clsx'; -import useInView from 'lib/hooks/useInView'; +import useInView from 'lib/hooks/use-in-view'; import { useTheme } from 'next-themes'; import { memo, useEffect, useState } from 'react'; -import RUALoading from './loading/RUALoading'; +import RUALoading from './loading/rua-loading'; export const commonClass = clsx( 'rounded-lg h-[400px] border-0', @@ -14,7 +14,7 @@ type Props = { url: string; }; -const RUACodepen = ({ defaultTab, url }: Props) => { +const RuaCodepen = ({ defaultTab, url }: Props) => { const urlArr = url.split('/'); const { systemTheme, theme } = useTheme(); const currentTheme = theme === 'system' ? systemTheme : theme ?? 'light'; @@ -80,4 +80,4 @@ const RUACodepen = ({ defaultTab, url }: Props) => { ); }; -export default memo(RUACodepen); +export default memo(RuaCodepen); diff --git a/components/RUA/RUAPagination.tsx b/components/rua/rua-pagination.tsx similarity index 91% rename from components/RUA/RUAPagination.tsx rename to components/rua/rua-pagination.tsx index c566f3f..8b4c10d 100644 --- a/components/RUA/RUAPagination.tsx +++ b/components/rua/rua-pagination.tsx @@ -2,7 +2,7 @@ import dynamic from 'next/dynamic'; import Link from 'next/link'; import { DetailedHTMLProps, HTMLAttributes, memo } from 'react'; -const Button = dynamic(() => import('components/RUA/Button')); +const Button = dynamic(() => import('components/rua/button')); type Props = { hasPrev: boolean; @@ -13,7 +13,7 @@ type Props = { total?: number; } & DetailedHTMLProps, HTMLElement>; -const RUAPagination = ({ +const RuaPagination = ({ hasPrev, hasNext, prevLink, @@ -59,4 +59,4 @@ const RUAPagination = ({ ); }; -export default memo(RUAPagination); +export default memo(RuaPagination); diff --git a/components/RUA/RUASandpack.tsx b/components/rua/rua-sandpack.tsx similarity index 86% rename from components/RUA/RUASandpack.tsx rename to components/rua/rua-sandpack.tsx index ea0e0ba..e8d42ba 100644 --- a/components/RUA/RUASandpack.tsx +++ b/components/rua/rua-sandpack.tsx @@ -4,7 +4,7 @@ import { memo } from 'react'; interface Props extends SandpackProps {} -const RUASandpack = ({ ...rest }: Props) => { +const RuaSandpack = ({ ...rest }: Props) => { const { systemTheme, theme } = useTheme(); const currentTheme = theme === 'system' ? systemTheme : theme; @@ -20,4 +20,4 @@ const RUASandpack = ({ ...rest }: Props) => { ); }; -export default memo(RUASandpack); +export default memo(RuaSandpack); diff --git a/components/RUA/tab/index.tsx b/components/rua/tab/index.tsx similarity index 97% rename from components/RUA/tab/index.tsx rename to components/rua/tab/index.tsx index bcf4738..a85cc82 100644 --- a/components/RUA/tab/index.tsx +++ b/components/rua/tab/index.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import React, { memo, useState } from 'react'; -import { ItemProps } from './TabItem'; +import { ItemProps } from './tab-item'; type Props = { defaultValue: string | number; diff --git a/components/RUA/tab/TabItem.tsx b/components/rua/tab/tab-item.tsx similarity index 100% rename from components/RUA/tab/TabItem.tsx rename to components/rua/tab/tab-item.tsx diff --git a/content/mdxData.ts b/content/mdx-data.ts similarity index 100% rename from content/mdxData.ts rename to content/mdx-data.ts diff --git a/content/posts/build-own-store-with-usesyncexternalstore.mdx b/content/posts/build-own-store-with-usesyncexternalstore.mdx index caf8826..fa5d8f8 100644 --- a/content/posts/build-own-store-with-usesyncexternalstore.mdx +++ b/content/posts/build-own-store-with-usesyncexternalstore.mdx @@ -142,7 +142,7 @@ const Couter = () => { }; ``` - { }; ``` -] => [ ]; ``` -(p: Person) => { 来看一个简单的小组件,该组件可以以一个常见的对象类型 `Record` 来根据指定的 key 访问其值,并展示在 DOM 上。 ->({ /> ``` - + diff --git a/content/posts/hello-world.mdx b/content/posts/hello-world.mdx index 9de283f..05663e7 100644 --- a/content/posts/hello-world.mdx +++ b/content/posts/hello-world.mdx @@ -14,7 +14,7 @@ console.log('Hello world'); ## Say hello to world - + diff --git a/content/posts/object-around-in-threejs.mdx b/content/posts/object-around-in-threejs.mdx index 36526e1..bd1a381 100644 --- a/content/posts/object-around-in-threejs.mdx +++ b/content/posts/object-around-in-threejs.mdx @@ -87,4 +87,4 @@ earth.getWorldPosition(position); ## Demo - + diff --git a/content/posts/react18-new-hooks.mdx b/content/posts/react18-new-hooks.mdx index 559407a..2086031 100644 --- a/content/posts/react18-new-hooks.mdx +++ b/content/posts/react18-new-hooks.mdx @@ -26,7 +26,7 @@ tags: [React, TypeScript] `useTransition` 返回的元组中包含两个值 `[pending, setTransiton]` ,分别是 `setTransiton` 方法和表示正在过渡的状态 `pending` 。如果需要在过渡时展示特定的 UI 就可以使用 `pending` 来控制状态。 -` 。 - SSR 到客户端注入时需要 ID 避免错误。 -`  标签等。当 解决这个问题的最好办法就是所有东西呈现给浏览器绘制前就进行改变。没错 `useInsertionEffect` 与 `useEffect` 有着同样的签名,但它会同步的在所有 DOM 更改之前触发。比 `useLayoutEffect` 还要早触发,这样就可以用于在重绘之前注入样式。 - import('components/Footer')); -const HeadBar = dynamic(() => import('components/NavBar')); -const BackToTop = dynamic(() => import('components/common/BackToTop')); +const Footer = dynamic(() => import('components/footer')); +const HeadBar = dynamic(() => import('components/nav-bar')); +const BackToTop = dynamic(() => import('components/common/back-to-top')); type Props = { children: React.ReactNode; diff --git a/lib/gltfLoader.ts b/lib/gltf-loader.ts similarity index 100% rename from lib/gltfLoader.ts rename to lib/gltf-loader.ts diff --git a/lib/hooks/useCopyToClipboard.ts b/lib/hooks/use-copy-to-clipboard.ts similarity index 100% rename from lib/hooks/useCopyToClipboard.ts rename to lib/hooks/use-copy-to-clipboard.ts diff --git a/lib/hooks/useInView.ts b/lib/hooks/use-in-view.ts similarity index 100% rename from lib/hooks/useInView.ts rename to lib/hooks/use-in-view.ts diff --git a/lib/hooks/useMounted.ts b/lib/hooks/use-mounted.ts similarity index 100% rename from lib/hooks/useMounted.ts rename to lib/hooks/use-mounted.ts diff --git a/lib/hooks/useRouterLoading.ts b/lib/hooks/use-router-loading.ts similarity index 100% rename from lib/hooks/useRouterLoading.ts rename to lib/hooks/use-router-loading.ts diff --git a/pages/_app.tsx b/pages/_app.tsx index 3de71f6..4b437c4 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,4 +1,4 @@ -import useRouterLoading from 'lib/hooks/useRouterLoading'; +import useRouterLoading from 'lib/hooks/use-router-loading'; import { ThemeProvider } from 'next-themes'; import dynamic from 'next/dynamic'; import Head from 'next/head'; @@ -10,7 +10,7 @@ import 'styles/rua.css'; import { AppPropsWithLayout } from 'types'; const VercelLoading = dynamic( - () => import('components/RUA/loading/VercelLoading'), + () => import('components/rua/loading/vercel-loading'), { suspense: true, } diff --git a/pages/about.tsx b/pages/about.tsx index a69d6f4..936dda1 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -1,7 +1,7 @@ import TWEEN from '@tweenjs/tween.js'; import clsx from 'clsx'; -import MainLayout from 'layouts/MainLayout'; -import { gltfLoader, manager } from 'lib/gltfLoader'; +import MainLayout from 'layouts/main-layout'; +import { gltfLoader, manager } from 'lib/gltf-loader'; import { getMousePosition } from 'lib/utils'; import { useTheme } from 'next-themes'; import dynamic from 'next/dynamic'; @@ -10,7 +10,7 @@ import { InitFn, THREE, useThree } from 'rua-three'; import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader'; import { NextPageWithLayout } from 'types'; -const Loading = dynamic(() => import('components/RUA/loading/RUALoading'), { +const Loading = dynamic(() => import('components/rua/loading/rua-loading'), { suspense: true, }); diff --git a/pages/blog/[page].tsx b/pages/blog/[page].tsx index 133eb95..b3b6c7c 100644 --- a/pages/blog/[page].tsx +++ b/pages/blog/[page].tsx @@ -1,16 +1,16 @@ -import PostCardLoading from 'components/RUA/loading/PostCardLoading'; -import MainLayout from 'layouts/MainLayout'; +import PostCardLoading from 'components/rua/loading/post-card-loading'; +import MainLayout from 'layouts/main-layout'; import { getPostListPath, postLists, PostPerPage } from 'lib/posts'; import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next'; import dynamic from 'next/dynamic'; import { Fragment, ReactElement, Suspense } from 'react'; import { Post } from 'types'; -const PostCard = dynamic(() => import('components/PostCard'), { +const PostCard = dynamic(() => import('components/post-card'), { suspense: true, }); -const BlogList = dynamic(() => import('layouts/BlogList'), { suspense: true }); -const Pagination = dynamic(() => import('components/RUA/RUAPagination'), { +const BlogList = dynamic(() => import('layouts/blog-list'), { suspense: true }); +const Pagination = dynamic(() => import('components/rua/rua-pagination'), { suspense: true, }); diff --git a/pages/blog/index.tsx b/pages/blog/index.tsx index d17d45b..90a42f5 100644 --- a/pages/blog/index.tsx +++ b/pages/blog/index.tsx @@ -1,16 +1,16 @@ -import PostCardLoading from 'components/RUA/loading/PostCardLoading'; -import MainLayout from 'layouts/MainLayout'; +import PostCardLoading from 'components/rua/loading/post-card-loading'; +import MainLayout from 'layouts/main-layout'; import { postLists, PostPerPage } from 'lib/posts'; import { GetStaticProps, InferGetStaticPropsType } from 'next'; import dynamic from 'next/dynamic'; import { Fragment, ReactElement, Suspense } from 'react'; import { Post } from 'types'; -const PostCard = dynamic(() => import('components/PostCard'), { +const PostCard = dynamic(() => import('components/post-card'), { suspense: true, }); -const BlogList = dynamic(() => import('layouts/BlogList'), { suspense: true }); -const Pagination = dynamic(() => import('components/RUA/RUAPagination'), { +const BlogList = dynamic(() => import('layouts/blog-list'), { suspense: true }); +const Pagination = dynamic(() => import('components/rua/rua-pagination'), { suspense: true, }); diff --git a/pages/g/[id].tsx b/pages/g/[id].tsx index dd38f31..8dcb20e 100644 --- a/pages/g/[id].tsx +++ b/pages/g/[id].tsx @@ -1,7 +1,7 @@ -import LinkAnchor from 'components/mdx/LinkAnchor'; +import LinkAnchor from 'components/mdx/link-anchor'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; -import MainLayout from 'layouts/MainLayout'; +import MainLayout from 'layouts/main-layout'; import { getGists, getSignalGist, SingalGist } from 'lib/fetcher'; import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next'; import dynamic from 'next/dynamic'; @@ -11,7 +11,7 @@ import avatar from 'public/images/img/avatar.svg'; import { ParsedUrlQuery } from 'querystring'; import { Fragment, ReactElement, Suspense } from 'react'; -const GistsCode = dynamic(() => import('components/gists/GistsCode'), { +const GistsCode = dynamic(() => import('components/gists/gists-code'), { suspense: true, }); diff --git a/pages/gists/[p].tsx b/pages/gists/[p].tsx index b4cc062..61bad7c 100644 --- a/pages/gists/[p].tsx +++ b/pages/gists/[p].tsx @@ -1,19 +1,19 @@ import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; -import MainLayout from 'layouts/MainLayout'; +import MainLayout from 'layouts/main-layout'; import { GetGists, getGists, GetUser, getUser } from 'lib/fetcher'; import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next'; import dynamic from 'next/dynamic'; import { ParsedUrlQuery } from 'querystring'; import { ReactElement, Suspense } from 'react'; -const UserInfo = dynamic(() => import('components/gists/UserInfo'), { +const UserInfo = dynamic(() => import('components/gists/user-info'), { suspense: true, }); -const FileContent = dynamic(() => import('components/gists/FileContent'), { +const FileContent = dynamic(() => import('components/gists/file-content'), { suspense: true, }); -const Pagination = dynamic(() => import('components/RUA/RUAPagination'), { +const Pagination = dynamic(() => import('components/rua/rua-pagination'), { suspense: true, }); diff --git a/pages/gists/index.tsx b/pages/gists/index.tsx index a84c2a4..763782f 100644 --- a/pages/gists/index.tsx +++ b/pages/gists/index.tsx @@ -1,18 +1,18 @@ import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; -import MainLayout from 'layouts/MainLayout'; +import MainLayout from 'layouts/main-layout'; import { GetGists, getGists, GetUser, getUser } from 'lib/fetcher'; import { GetStaticProps, InferGetStaticPropsType } from 'next'; import dynamic from 'next/dynamic'; import { ReactElement, Suspense } from 'react'; -const UserInfo = dynamic(() => import('components/gists/UserInfo'), { +const UserInfo = dynamic(() => import('components/gists/user-info'), { suspense: true, }); -const FileContent = dynamic(() => import('components/gists/FileContent'), { +const FileContent = dynamic(() => import('components/gists/file-content'), { suspense: true, }); -const Pagination = dynamic(() => import('components/RUA/RUAPagination'), { +const Pagination = dynamic(() => import('components/rua/rua-pagination'), { suspense: true, }); diff --git a/pages/index.tsx b/pages/index.tsx index f24ee0d..ed07d48 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; -import MainLayout from 'layouts/MainLayout'; -import { gltfLoader, manager } from 'lib/gltfLoader'; +import MainLayout from 'layouts/main-layout'; +import { gltfLoader, manager } from 'lib/gltf-loader'; import { getMousePosition } from 'lib/utils'; import dynamic from 'next/dynamic'; import Head from 'next/head'; @@ -11,7 +11,7 @@ import styles from 'styles/index/index.module.css'; import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader'; import type { NextPageWithLayout } from 'types'; -const Loading = dynamic(() => import('components/RUA/loading/RUALoading'), { +const Loading = dynamic(() => import('components/rua/loading/rua-loading'), { suspense: true, }); diff --git a/pages/p/[slug].tsx b/pages/p/[slug].tsx index 37a2e32..9523669 100644 --- a/pages/p/[slug].tsx +++ b/pages/p/[slug].tsx @@ -1,10 +1,10 @@ import rehypePrism from '@mapbox/rehype-prism'; import components from 'components/mdx/components'; -import PostCommnetLine from 'components/post/PostCommnetLine'; -import PostToc from 'components/post/PostToc'; -import data from 'content/mdxData'; -import MainLayout from 'layouts/MainLayout'; -import useInView from 'lib/hooks/useInView'; +import PostCommnetLine from 'components/post/post-commnet-line'; +import PostToc from 'components/post/post-toc'; +import data from 'content/mdx-data'; +import MainLayout from 'layouts/main-layout'; +import useInView from 'lib/hooks/use-in-view'; import { allPostsPath, readSinglePost } from 'lib/posts'; import { generateToc, SingleToc } from 'lib/utils'; import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next'; @@ -15,7 +15,7 @@ import { ReactElement, Suspense } from 'react'; import rehypeSlug from 'rehype-slug'; import remarkGfm from 'remark-gfm'; -const PostComment = dynamic(() => import('components/post/PostComment'), { +const PostComment = dynamic(() => import('components/post/post-comment'), { suspense: true, }); diff --git a/pages/projects.tsx b/pages/projects.tsx index 49f4057..3cce66f 100644 --- a/pages/projects.tsx +++ b/pages/projects.tsx @@ -12,9 +12,9 @@ import { } from 'react-icons/si'; import { VscGithubInverted } from 'react-icons/vsc'; import { HiPhoto } from 'react-icons/hi2'; -import MainLayout from 'layouts/MainLayout'; +import MainLayout from 'layouts/main-layout'; -const ProjectCard = dynamic(() => import('components/pages/ProjectCard'), { +const ProjectCard = dynamic(() => import('components/pages/project-card'), { suspense: true, }); diff --git a/scripts/build-search.mjs b/scripts/build-search.mjs index ebc5b17..072cfd6 100644 --- a/scripts/build-search.mjs +++ b/scripts/build-search.mjs @@ -31,7 +31,7 @@ async function pushAlgolia(gists) { ); // initialize the index with your index name - const index = client.initIndex('RUA'); + const index = client.initIndex('rua'); // save the objects! const algoliaResponse = await index.replaceAllObjects(records); @@ -61,4 +61,4 @@ function main() { isTest ? test(gists) : pushAlgolia(gists); } -main(); \ No newline at end of file +main();