diff --git a/components/gists/GistsCode.tsx b/components/gists/GistsCode.tsx
index 7d6359b..41d9683 100644
--- a/components/gists/GistsCode.tsx
+++ b/components/gists/GistsCode.tsx
@@ -6,8 +6,10 @@ import rehypePrism from '@mapbox/rehype-prism';
import remarkGfm from 'remark-gfm';
import { createElement, Fragment, useEffect, useState } from 'react';
import rehypeReact from 'rehype-react';
-import useInView from 'lib/hooks/useInView';
import classNames from 'classnames';
+import useInView from 'lib/hooks/useInView';
+import loadingImage from 'public/images/img/mona-loading-default.gif';
+import Image from 'next/image';
interface Props {
gist: Gist;
@@ -30,7 +32,7 @@ const GistsCode = ({ gist, f }: Props) => {
const raw = await res.text();
setRawCode(`\`\`\`${format ?? ''}\n${raw}`);
}
- }, [format, url, inView]);
+ }, [format, inView, url]);
const code = unified()
.use(remarkParse)
@@ -45,20 +47,27 @@ const GistsCode = ({ gist, f }: Props) => {
return (
<>
-
+
{gist.owner.login} / {file[f].filename}
Update at: {gist.updated_at}
{gist.description}
- {code}
+ {rawCode ? (
+
{code}
+ ) : (
+
+
+
+ rua rua rua...
+
+ )}
>
);
diff --git a/components/mdx/Image.tsx b/components/mdx/Image.tsx
index e455fa2..fcf68c4 100644
--- a/components/mdx/Image.tsx
+++ b/components/mdx/Image.tsx
@@ -6,7 +6,7 @@ const Image = ({ alt, ...rest }: Props) => {
return (
<>
-
+
{alt && {alt}}
>
diff --git a/pages/g/[id].tsx b/pages/g/[id].tsx
new file mode 100644
index 0000000..cfc1410
--- /dev/null
+++ b/pages/g/[id].tsx
@@ -0,0 +1,23 @@
+import { GetStaticProps } from 'next';
+import dynamic from 'next/dynamic';
+import { ReactElement } from 'react';
+import { NextPageWithLayout } from 'types';
+
+const MainLayout = dynamic(() => import('layouts/MainLayout'));
+
+const Gist: NextPageWithLayout = () => {
+ return <>>;
+};
+
+export const getStaticProps:GetStaticProps = async ({params}) => {
+ return {
+ props: {},
+ revalidate: 60,
+ };
+};
+
+Gist.getLayout = function getLayout(page: ReactElement) {
+ return
{page};
+};
+
+export default Gist;
diff --git a/pages/gists.tsx b/pages/gists.tsx
index 4c6d91c..b158508 100644
--- a/pages/gists.tsx
+++ b/pages/gists.tsx
@@ -1,4 +1,3 @@
-import MainLayout from 'layouts/MainLayout';
import { InferGetStaticPropsType } from 'next';
import { ReactElement } from 'react';
import { Gist, GithubUser } from 'types';
@@ -7,6 +6,7 @@ import classNames from 'classnames';
import dynamic from 'next/dynamic';
import avatar from 'public/images/img/avatar.svg';
+const MainLayout = dynamic(() => import('layouts/MainLayout'));
const GistsCode = dynamic(() => import('components/gists/GistsCode'));
const Gists = ({
@@ -17,7 +17,13 @@ const Gists = ({
<>
-
+
{children};
最近迁移了自己的小服务器,也顺便把本机的环境重新设置了一下,其中环节还是有点复杂的小细节的。所以打算整理下思路,方便以后再设置同样环境。
-
+
## 对于服务器
diff --git a/public/images/img/mona-loading-default.gif b/public/images/img/mona-loading-default.gif
new file mode 100644
index 0000000..e022aab
Binary files /dev/null and b/public/images/img/mona-loading-default.gif differ
diff --git a/public/images/img/mona-loading-dimmed.gif b/public/images/img/mona-loading-dimmed.gif
new file mode 100644
index 0000000..f509c67
Binary files /dev/null and b/public/images/img/mona-loading-dimmed.gif differ