From 593a61e27b1216ba368f64472fb931b7f90549f7 Mon Sep 17 00:00:00 2001 From: Zehua Ren Date: Sun, 20 Jun 2021 16:43:09 +0800 Subject: [PATCH] update --- .env.development | 6 +++ README.md | 3 +- components/footer.tsx | 68 ++++++++++++++++++++++++++++++++++ components/layout.tsx | 5 ++- components/markdown-render.tsx | 5 +-- components/mona-code.tsx | 3 +- components/navigation.tsx | 37 +++++++++--------- components/utterances.tsx | 3 ++ hooks/use-monaco.tsx | 3 +- libs/markdown.ts | 7 ++-- pages/[[...path]].tsx | 48 +++++++++++------------- pages/_app.tsx | 3 +- tsconfig.json | 3 +- 13 files changed, 132 insertions(+), 62 deletions(-) create mode 100644 .env.development create mode 100644 components/footer.tsx diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..779facc --- /dev/null +++ b/.env.development @@ -0,0 +1,6 @@ +NEXT_PUBLIC_REPOSITORY=renzholy/renzholy.github.io +NEXT_PUBLIC_REF=refs/heads/main +NEXT_PUBLIC_INDEX=/readme +NEXT_PUBLIC_TITLE=Found Pan Tiger +NEXT_PUBLIC_HEADER=About,/about +NEXT_PUBLIC_FOOTER=GitHub,https://github.com/renzholy;Twitter,http://twitter.com/rezholy;Jike,https://web.okjike.com/u/d25026f2-18ce-48aa-9ea7-c05a25446368 diff --git a/README.md b/README.md index b1b99c3..8baa58a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ Environments: - GITHUB_TOKEN - NEXT_PUBLIC_TITLE - NEXT_PUBLIC_INDEX -- NEXT_PUBLIC_LINKS +- NEXT_PUBLIC_HEADER +- NEXT_PUBLIC_FOOTER Todos: diff --git a/components/footer.tsx b/components/footer.tsx new file mode 100644 index 0000000..5a63c37 --- /dev/null +++ b/components/footer.tsx @@ -0,0 +1,68 @@ +import { css } from '@linaria/core' +import { useMemo } from 'react' +import Link from 'next/link' + +export default function Footer() { + const footers = useMemo( + () => + process.env.NEXT_PUBLIC_FOOTER?.split(';').map((item) => + item.split(','), + ) || [], + [], + ) + + return ( + + ) +} diff --git a/components/layout.tsx b/components/layout.tsx index 6d2b37f..875a6df 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -1,6 +1,6 @@ import { css } from '@linaria/core' import { ReactNode } from 'react' - +import Footer from './footer' import Navigation from './navigation' export default function Layout(props: { children: ReactNode }) { @@ -14,10 +14,11 @@ export default function Layout(props: { children: ReactNode }) { right: 0; height: 64px; background-color: #24292e; - padding: 0 32px; + padding: 0 20px; `} /> {props.children} + + ) : null} + ) } diff --git a/pages/_app.tsx b/pages/_app.tsx index 86b27dd..83f80ce 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -2,9 +2,8 @@ import React from 'react' import type { AppProps } from 'next/app' +import Layout from 'components/layout' import 'normalize.css' - -import Layout from '../components/layout' import './global.css' function MyApp({ Component, pageProps }: AppProps) { diff --git a/tsconfig.json b/tsconfig.json index c73b54f..da3a0b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ "resolveJsonModule": true, "skipLibCheck": true, "strict": true, - "target": "esnext" + "target": "esnext", + "baseUrl": "." }, "exclude": ["node_modules"], "include": ["**/*.ts", "**/*.tsx", "next.config.js", "workers"]