feat: add research submodule and page

This commit is contained in:
ryanchristo 2024-08-31 11:31:50 -07:00
parent 4a39e535a3
commit 3af3260500
12 changed files with 68 additions and 48 deletions

View file

@ -27,17 +27,16 @@ const Layout = ({ children }: any) => (
title: 'solutions', title: 'solutions',
target: '', target: '',
}, },
{
link: '/validator',
title: 'validator',
target: '',
},
'divider',
{ {
link: '/research', link: '/research',
title: 'research', title: 'research',
target: '', target: '',
}, },
{
link: '/validator',
title: 'validator',
target: '',
},
]} ]}
showMenuButton={true} showMenuButton={true}
showMobileTitle={true} showMobileTitle={true}
@ -59,22 +58,17 @@ const Layout = ({ children }: any) => (
target: '', target: '',
title: 'solutions', title: 'solutions',
}, },
{
link: 'validator',
target: '',
title: 'validator',
},
{ {
link: 'research', link: 'research',
target: '', target: '',
title: 'research', title: 'research',
}, },
'divider',
{ {
link: 'https://chora.blog', link: 'validator',
target: '_blank', target: '',
title: 'chora blog', title: 'validator',
}, },
'divider',
{ {
link: 'https://chora.io', link: 'https://chora.io',
target: '_blank', target: '_blank',
@ -104,16 +98,16 @@ const Layout = ({ children }: any) => (
target: '', target: '',
title: 'solutions', title: 'solutions',
}, },
{
link: '/validator',
target: '',
title: 'validator',
},
{ {
link: '/research', link: '/research',
target: '', target: '',
title: 'research', title: 'research',
}, },
{
link: '/validator',
target: '',
title: 'validator',
},
], ],
}, },
{ {

View file

@ -48,6 +48,16 @@ const HomePage = () => {
{'learn more'} {'learn more'}
<ArrowRight /> <ArrowRight />
</Link> </Link>
<h2>{'research'}</h2>
<p>
{
'Chora Studio is researching distributed systems, governance frameworks, and tools for decentralized monitoring, reporting, and verification.'
}
</p>
<Link href="/research">
{'learn more'}
<ArrowRight />
</Link>
<h2>{'validator'}</h2> <h2>{'validator'}</h2>
<p> <p>
{'Chora Studio operates Chora Validator on '} {'Chora Studio operates Chora Validator on '}

View file

@ -2,6 +2,10 @@
composes: page from 'chora/styles/page.css'; composes: page from 'chora/styles/page.css';
} }
.banner {
composes: banner from 'chora/styles/main.css';
}
.content { .content {
composes: content-full from 'chora/styles/main.css'; composes: content-full from 'chora/styles/main.css';
} }

View file

@ -9,9 +9,13 @@ export const metadata: Metadata = {
const ProductsPage = () => { const ProductsPage = () => {
return ( return (
<div className={styles.page}> <div className={styles.page}>
<div className={styles.banner}>
<div>
<h1 style={{ opacity: '0.75' }}>{'products'}</h1>
</div>
</div>
<div className={styles.content}> <div className={styles.content}>
<div> <div>
<h1>{'products'}</h1>
<p> <p>
{'Chora Studio is stewarding '} {'Chora Studio is stewarding '}
<a href="https://chora.io" target="_blank"> <a href="https://chora.io" target="_blank">

View file

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

View file

@ -6,14 +6,14 @@ import { getDocs } from '@utils'
import styles from './page.module.css' import styles from './page.module.css'
export const metadata: Metadata = { export const metadata: Metadata = {
title: 'chora blog | research', title: 'chora studio | research',
} }
async function getPosts() { async function getResearch() {
const allPosts = getDocs().filter((p) => p.tags.includes('research')) const allDocs = getDocs().filter((p) => p.tags.includes('research'))
// sort posts by date // sort docs by date
return allPosts.sort((a, b) => { return allDocs.sort((a, b) => {
if (a.date < b.date) { if (a.date < b.date) {
return 1 return 1
} else { } else {
@ -23,7 +23,7 @@ async function getPosts() {
} }
const ResearchPage = async () => { const ResearchPage = async () => {
const posts = await getPosts() const docs = await getResearch()
return ( return (
<div className={styles.page}> <div className={styles.page}>
@ -33,11 +33,11 @@ const ResearchPage = async () => {
</div> </div>
</div> </div>
<div className={styles.content}> <div className={styles.content}>
{!posts.length ? ( {!docs.length ? (
<p>{'coming soon...'}</p> <p>{'coming soon...'}</p>
) : ( ) : (
<ul> <ul>
{posts.map(({ id, date, title, author }) => ( {docs.map(({ id, date, title, author }) => (
<li key={id}> <li key={id}>
<Link href={`/research/${id}`}> <Link href={`/research/${id}`}>
<h4>{date}</h4> <h4>{date}</h4>

View file

@ -2,6 +2,10 @@
composes: page from 'chora/styles/page.css'; composes: page from 'chora/styles/page.css';
} }
.banner {
composes: banner from 'chora/styles/main.css';
}
.content { .content {
composes: content-full from 'chora/styles/main.css'; composes: content-full from 'chora/styles/main.css';
} }

View file

@ -9,9 +9,13 @@ export const metadata: Metadata = {
const SolutionsPage = () => { const SolutionsPage = () => {
return ( return (
<div className={styles.page}> <div className={styles.page}>
<div className={styles.banner}>
<div>
<h1 style={{ opacity: '0.75' }}>{'solutions'}</h1>
</div>
</div>
<div className={styles.content}> <div className={styles.content}>
<div> <div>
<h1>{'solutions'}</h1>
<p> <p>
{ {
'Chora Studio provides software research and development as a service with a focus on distributed ledger technology and regenerative finance.' 'Chora Studio provides software research and development as a service with a focus on distributed ledger technology and regenerative finance.'

View file

@ -2,6 +2,10 @@
composes: page from 'chora/styles/page.css'; composes: page from 'chora/styles/page.css';
} }
.banner {
composes: banner from 'chora/styles/main.css';
}
.content { .content {
composes: content-full from 'chora/styles/main.css'; composes: content-full from 'chora/styles/main.css';
} }

View file

@ -12,9 +12,13 @@ const regenLink =
const ValidatorPage = () => { const ValidatorPage = () => {
return ( return (
<div className={styles.page}> <div className={styles.page}>
<div className={styles.banner}>
<div>
<h1 style={{ opacity: '0.75' }}>{'validator'}</h1>
</div>
</div>
<div className={styles.content}> <div className={styles.content}>
<div> <div>
<h1>{'validator'}</h1>
<p> <p>
{'Chora Studio operates Chora Validator on '} {'Chora Studio operates Chora Validator on '}
<a href={regenLink} target="_blank"> <a href={regenLink} target="_blank">

@ -1 +1 @@
Subproject commit e554985a3ece9bf7e7f8abc42155be5f7d6aaa76 Subproject commit a3055e265f318b77c413c0784a9e997388dbef11

View file

@ -8,14 +8,6 @@ export const getDocs = () => {
const fileNames = fs.readdirSync(docsDirectory) const fileNames = fs.readdirSync(docsDirectory)
return fileNames.map((fileName) => { return fileNames.map((fileName) => {
console.log("HERE", fileName)
if (!fileName || fileName.includes('README.md')) {
return {
id: 'readme',
data: {},
}
}
// set id and full path // set id and full path
const id = fileName.replace(/\.md$/, '') const id = fileName.replace(/\.md$/, '')
const fullPath = path.join(docsDirectory, fileName) const fullPath = path.join(docsDirectory, fileName)