init commit
This commit is contained in:
commit
c0ee8a4a11
54 changed files with 1055 additions and 0 deletions
11
app/artifacts/choreography/[id]/page.module.css
Normal file
11
app/artifacts/choreography/[id]/page.module.css
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.page {
|
||||
composes: page from '../../../../styles/page.css';
|
||||
}
|
||||
|
||||
.banner {
|
||||
composes: banner-document from '../../../../styles/banner.css';
|
||||
}
|
||||
|
||||
.content {
|
||||
composes: content-full from '../../../../styles/content.css';
|
||||
}
|
||||
35
app/artifacts/choreography/[id]/page.tsx
Normal file
35
app/artifacts/choreography/[id]/page.tsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { Metadata } from 'next'
|
||||
|
||||
import { getArtifact, getArtifacts } from '@utils'
|
||||
|
||||
import styles from './page.module.css'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'chora studio | research',
|
||||
}
|
||||
|
||||
export const generateStaticParams = () => {
|
||||
return getArtifacts('choreography')
|
||||
}
|
||||
|
||||
const ArtifactPage = async ({ params }: any) => {
|
||||
const artifact = await getArtifact('choreography', params.id)
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.banner}>
|
||||
<div>
|
||||
<p>{`author: ${artifact.author}`}</p>
|
||||
<p>{`title: ${artifact.title}`}</p>
|
||||
<p>{`description: ${artifact.description}`}</p>
|
||||
<p>{`created: ${artifact.created.toDateString()}`}</p>
|
||||
<p>{`updated: ${artifact.updated.toDateString()}`}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
<div dangerouslySetInnerHTML={{ __html: artifact.content }} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ArtifactPage
|
||||
24
app/artifacts/page.module.css
Normal file
24
app/artifacts/page.module.css
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
.page {
|
||||
composes: page from '../../styles/page.css';
|
||||
}
|
||||
|
||||
.banner {
|
||||
composes: banner from '../../styles/banner.css';
|
||||
}
|
||||
|
||||
.content {
|
||||
composes: content-full from '../../styles/content.css';
|
||||
}
|
||||
|
||||
.content ul {
|
||||
list-style: none inside none;
|
||||
}
|
||||
|
||||
.content li {
|
||||
margin: 2em 0;
|
||||
}
|
||||
|
||||
.content p {
|
||||
color: var(--color-text);
|
||||
font-weight: 300;
|
||||
}
|
||||
65
app/artifacts/page.tsx
Normal file
65
app/artifacts/page.tsx
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
import { Metadata } from 'next'
|
||||
import Link from 'next/link'
|
||||
|
||||
import { getArtifacts } from '@utils'
|
||||
|
||||
import styles from './page.module.css'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'chora | artifacts',
|
||||
}
|
||||
|
||||
async function getResearchArtifacts() {
|
||||
return [
|
||||
{ group: 'choreography', items: getArtifacts('choreography') },
|
||||
]
|
||||
}
|
||||
|
||||
const ResearchPage = async () => {
|
||||
const artifacts = await getResearchArtifacts()
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.banner}>
|
||||
<div>
|
||||
<h1>{'artifacts'}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.content}>
|
||||
<div>
|
||||
{!artifacts.length ? (
|
||||
<p>
|
||||
<i>{'failed to load artifacts'}</i>
|
||||
</p>
|
||||
) : (
|
||||
<div>
|
||||
{artifacts.map(({ group, items }) => (
|
||||
<div key={group} style={{ margin: '1em 0' }}>
|
||||
<h2>{group}</h2>
|
||||
<ul>
|
||||
{items.map(
|
||||
({ id, title, description, created, updated }) => (
|
||||
<li key={id}>
|
||||
<Link href={`/artifacts/` + group + '/' + id}>
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
<p>
|
||||
<i>{`created: ${created.toDateString()}`}</i>
|
||||
{' | '}
|
||||
<i>{`updated: ${updated.toDateString()}`}</i>
|
||||
</p>
|
||||
</Link>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ResearchPage
|
||||
Loading…
Add table
Add a link
Reference in a new issue