diff --git a/src/pages/blog/[...slug].tsx b/src/pages/blog/[...slug].tsx index c1db889..92b88d9 100644 --- a/src/pages/blog/[...slug].tsx +++ b/src/pages/blog/[...slug].tsx @@ -15,31 +15,33 @@ const Post = (props: { post: string, slug: string, matter: any }) => { // console.log(props.matter) - let Index = ( -
- - {props.matter} - - -
- , - img: ({ ...props }) => {props.alt}, - p: ({ children, ...props }) => { - const ParaComponent = children[0]?.type?.name === 'img' ? 'div' : 'p' - return {children} - }, - } - }} - /> -
- -
+ return ( + +
+ + {props.matter.title} | lio's blog + + +
+ , + img: ({ ...props }) => {props.alt}, + p: ({ children, ...props }) => { + const ParaComponent = children[0]?.type?.name === 'img' ? 'div' : 'p' + return {children} + }, + } + }} + /> +
+ +
+
); - return + }; export default Post @@ -50,7 +52,7 @@ export async function getStaticProps(context: any) { .process(await read(`${listFiles('./src/blog').find(file => file.includes(context.params.slug))}`)) return { props: { - post: (post.value as string).replace(/(---)\n*([a-zA-Z0-9\/\[\]\"_:,\-\s*]*)*/mi, ""), + post: (post.value as string).replace(/^(---)\n*([a-zA-Z0-9\/\#[\]\"_:,\-\s*]*)(---)$/mi, ""), matter: matter(post.value).data, slug: context.params.slug } diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index 48efc90..8600e4a 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -9,10 +9,10 @@ import PostList from "@/components/PostList"; import Head from "next/head" const IndexPage = (props: { posts: [{ title: string, date: string, link: string }] }) => { - let Index = ( + return (
- blog + lio's blog
@@ -22,8 +22,7 @@ const IndexPage = (props: { posts: [{ title: string, date: string, link: string {/* */}
- ); - return + ) }; export default IndexPage diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 5b81c61..f90ad10 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -13,29 +13,32 @@ function randomHello() { const IndexPage = () => { - let Index = ( -
- - lio - - -
-

- - {randomHello()} -

-

- my name's lio. i'm a 21y/o software dev student and ui designer from germany. -

- {/*

+ return ( + + +

+ + lio + + +
+

+ + {randomHello()} +

+

+ my name's lio. i'm a 21y/o software dev student and ui designer from germany. +

+ {/*

you might know me from Projects like

*/} -
- - {/* */} -
+
+ + {/* */} +
+
); - return + }; export default IndexPage \ No newline at end of file