redo the NoJS stuff
This commit is contained in:
parent
c652fd1575
commit
ba9c217156
3 changed files with 53 additions and 49 deletions
|
@ -15,10 +15,11 @@ const Post = (props: { post: string, slug: string, matter: any }) => {
|
|||
|
||||
// console.log(props.matter)
|
||||
|
||||
let Index = (
|
||||
return (
|
||||
<RenderWithoutJS>
|
||||
<main id={index.layout}>
|
||||
<Head>
|
||||
<title>{props.matter}</title>
|
||||
<title>{props.matter.title} | lio's blog</title>
|
||||
</Head>
|
||||
<Sidebar />
|
||||
<section id={index.main}>
|
||||
|
@ -38,8 +39,9 @@ const Post = (props: { post: string, slug: string, matter: any }) => {
|
|||
</section>
|
||||
<Lanyard />
|
||||
</main>
|
||||
</RenderWithoutJS>
|
||||
);
|
||||
return <RenderWithoutJS children={Index} />
|
||||
|
||||
};
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -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 (<RenderWithoutJS>
|
||||
<main id={index.layout}>
|
||||
<Head>
|
||||
<title>blog</title>
|
||||
<title>lio's blog</title>
|
||||
</Head>
|
||||
<Sidebar />
|
||||
<section id={index.blogMain}>
|
||||
|
@ -22,8 +22,7 @@ const IndexPage = (props: { posts: [{ title: string, date: string, link: string
|
|||
<Lanyard />
|
||||
{/* <Copyright /> */}
|
||||
</main>
|
||||
);
|
||||
return <RenderWithoutJS children={Index} />
|
||||
</RenderWithoutJS>)
|
||||
};
|
||||
|
||||
export default IndexPage
|
||||
|
|
|
@ -13,7 +13,9 @@ function randomHello() {
|
|||
|
||||
|
||||
const IndexPage = () => {
|
||||
let Index = (
|
||||
return (
|
||||
<RenderWithoutJS>
|
||||
|
||||
<main id={index.layout}>
|
||||
<Head>
|
||||
<title>lio</title>
|
||||
|
@ -34,8 +36,9 @@ const IndexPage = () => {
|
|||
<Lanyard />
|
||||
{/* <Copyright /> */}
|
||||
</main>
|
||||
</RenderWithoutJS>
|
||||
);
|
||||
return <RenderWithoutJS children={Index} />
|
||||
|
||||
};
|
||||
|
||||
export default IndexPage
|
Loading…
Add table
Reference in a new issue