feat: add research submodule and page
This commit is contained in:
parent
4a39e535a3
commit
3af3260500
12 changed files with 68 additions and 48 deletions
|
|
@ -27,17 +27,16 @@ const Layout = ({ children }: any) => (
|
|||
title: 'solutions',
|
||||
target: '',
|
||||
},
|
||||
{
|
||||
link: '/validator',
|
||||
title: 'validator',
|
||||
target: '',
|
||||
},
|
||||
'divider',
|
||||
{
|
||||
link: '/research',
|
||||
title: 'research',
|
||||
target: '',
|
||||
},
|
||||
{
|
||||
link: '/validator',
|
||||
title: 'validator',
|
||||
target: '',
|
||||
},
|
||||
]}
|
||||
showMenuButton={true}
|
||||
showMobileTitle={true}
|
||||
|
|
@ -59,22 +58,17 @@ const Layout = ({ children }: any) => (
|
|||
target: '',
|
||||
title: 'solutions',
|
||||
},
|
||||
{
|
||||
link: 'validator',
|
||||
target: '',
|
||||
title: 'validator',
|
||||
},
|
||||
{
|
||||
link: 'research',
|
||||
target: '',
|
||||
title: 'research',
|
||||
},
|
||||
'divider',
|
||||
{
|
||||
link: 'https://chora.blog',
|
||||
target: '_blank',
|
||||
title: 'chora blog',
|
||||
link: 'validator',
|
||||
target: '',
|
||||
title: 'validator',
|
||||
},
|
||||
'divider',
|
||||
{
|
||||
link: 'https://chora.io',
|
||||
target: '_blank',
|
||||
|
|
@ -104,16 +98,16 @@ const Layout = ({ children }: any) => (
|
|||
target: '',
|
||||
title: 'solutions',
|
||||
},
|
||||
{
|
||||
link: '/validator',
|
||||
target: '',
|
||||
title: 'validator',
|
||||
},
|
||||
{
|
||||
link: '/research',
|
||||
target: '',
|
||||
title: 'research',
|
||||
},
|
||||
{
|
||||
link: '/validator',
|
||||
target: '',
|
||||
title: 'validator',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
10
app/page.tsx
10
app/page.tsx
|
|
@ -48,6 +48,16 @@ const HomePage = () => {
|
|||
{'learn more'}
|
||||
<ArrowRight />
|
||||
</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>
|
||||
<p>
|
||||
{'Chora Studio operates Chora Validator on '}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
composes: page from 'chora/styles/page.css';
|
||||
}
|
||||
|
||||
.banner {
|
||||
composes: banner from 'chora/styles/main.css';
|
||||
}
|
||||
|
||||
.content {
|
||||
composes: content-full from 'chora/styles/main.css';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,13 @@ export const metadata: Metadata = {
|
|||
const ProductsPage = () => {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.banner}>
|
||||
<div>
|
||||
<h1 style={{ opacity: '0.75' }}>{'products'}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
<div>
|
||||
<h1>{'products'}</h1>
|
||||
<p>
|
||||
{'Chora Studio is stewarding '}
|
||||
<a href="https://chora.io" target="_blank">
|
||||
|
|
|
|||
|
|
@ -5,30 +5,30 @@ import { getDoc, getDocs } from '@utils'
|
|||
import styles from './page.module.css'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'chora blog | news',
|
||||
title: 'chora studio | research',
|
||||
}
|
||||
|
||||
export const generateStaticParams = () => {
|
||||
return getDocs()
|
||||
}
|
||||
|
||||
const PostPage = async ({ params }: any) => {
|
||||
const post = await getDoc(params.id)
|
||||
const DocumentPage = async ({ params }: any) => {
|
||||
const doc = 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>
|
||||
<h3>{doc.date}</h3>
|
||||
<h1>{doc.title}</h1>
|
||||
<h2>{`by ${doc.author}`}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
<div dangerouslySetInnerHTML={{ __html: post.content }} />
|
||||
<div dangerouslySetInnerHTML={{ __html: doc.content }} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PostPage
|
||||
export default DocumentPage
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ import { getDocs } from '@utils'
|
|||
import styles from './page.module.css'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'chora blog | research',
|
||||
title: 'chora studio | research',
|
||||
}
|
||||
|
||||
async function getPosts() {
|
||||
const allPosts = getDocs().filter((p) => p.tags.includes('research'))
|
||||
async function getResearch() {
|
||||
const allDocs = getDocs().filter((p) => p.tags.includes('research'))
|
||||
|
||||
// sort posts by date
|
||||
return allPosts.sort((a, b) => {
|
||||
// sort docs by date
|
||||
return allDocs.sort((a, b) => {
|
||||
if (a.date < b.date) {
|
||||
return 1
|
||||
} else {
|
||||
|
|
@ -23,7 +23,7 @@ async function getPosts() {
|
|||
}
|
||||
|
||||
const ResearchPage = async () => {
|
||||
const posts = await getPosts()
|
||||
const docs = await getResearch()
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
|
|
@ -33,11 +33,11 @@ const ResearchPage = async () => {
|
|||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
{!posts.length ? (
|
||||
{!docs.length ? (
|
||||
<p>{'coming soon...'}</p>
|
||||
) : (
|
||||
<ul>
|
||||
{posts.map(({ id, date, title, author }) => (
|
||||
{docs.map(({ id, date, title, author }) => (
|
||||
<li key={id}>
|
||||
<Link href={`/research/${id}`}>
|
||||
<h4>{date}</h4>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
composes: page from 'chora/styles/page.css';
|
||||
}
|
||||
|
||||
.banner {
|
||||
composes: banner from 'chora/styles/main.css';
|
||||
}
|
||||
|
||||
.content {
|
||||
composes: content-full from 'chora/styles/main.css';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,13 @@ export const metadata: Metadata = {
|
|||
const SolutionsPage = () => {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.banner}>
|
||||
<div>
|
||||
<h1 style={{ opacity: '0.75' }}>{'solutions'}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
<div>
|
||||
<h1>{'solutions'}</h1>
|
||||
<p>
|
||||
{
|
||||
'Chora Studio provides software research and development as a service with a focus on distributed ledger technology and regenerative finance.'
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
composes: page from 'chora/styles/page.css';
|
||||
}
|
||||
|
||||
.banner {
|
||||
composes: banner from 'chora/styles/main.css';
|
||||
}
|
||||
|
||||
.content {
|
||||
composes: content-full from 'chora/styles/main.css';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,13 @@ const regenLink =
|
|||
const ValidatorPage = () => {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.banner}>
|
||||
<div>
|
||||
<h1 style={{ opacity: '0.75' }}>{'validator'}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
<div>
|
||||
<h1>{'validator'}</h1>
|
||||
<p>
|
||||
{'Chora Studio operates Chora Validator on '}
|
||||
<a href={regenLink} target="_blank">
|
||||
|
|
|
|||
2
research
2
research
|
|
@ -1 +1 @@
|
|||
Subproject commit e554985a3ece9bf7e7f8abc42155be5f7d6aaa76
|
||||
Subproject commit a3055e265f318b77c413c0784a9e997388dbef11
|
||||
|
|
@ -8,14 +8,6 @@ export const getDocs = () => {
|
|||
const fileNames = fs.readdirSync(docsDirectory)
|
||||
return fileNames.map((fileName) => {
|
||||
|
||||
console.log("HERE", fileName)
|
||||
|
||||
if (!fileName || fileName.includes('README.md')) {
|
||||
return {
|
||||
id: 'readme',
|
||||
data: {},
|
||||
}
|
||||
}
|
||||
// set id and full path
|
||||
const id = fileName.replace(/\.md$/, '')
|
||||
const fullPath = path.join(docsDirectory, fileName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue