feat: add research submodule and page

This commit is contained in:
ryanchristo 2024-08-31 10:03:40 -07:00
parent 3d450a389b
commit 4a39e535a3
13 changed files with 217 additions and 10 deletions

View file

@ -0,0 +1,11 @@
.page {
composes: page from 'chora/styles/page.css';
}
.banner {
composes: banner-document from 'chora/styles/main.css';
}
.content {
composes: content-full from 'chora/styles/main.css';
}

View file

@ -0,0 +1,34 @@
import { Metadata } from 'next'
import { getDoc, getDocs } from '@utils'
import styles from './page.module.css'
export const metadata: Metadata = {
title: 'chora blog | news',
}
export const generateStaticParams = () => {
return getDocs()
}
const PostPage = async ({ params }: any) => {
const post = await getDoc(params.id)
return (
<div className={styles.page}>
<div className={styles.banner}>
<div>
<h3>{post.date}</h3>
<h1>{post.title}</h1>
<h2>{`by ${post.author}`}</h2>
</div>
</div>
<div className={styles.content}>
<div dangerouslySetInnerHTML={{ __html: post.content }} />
</div>
</div>
)
}
export default PostPage