mirror of
https://github.com/dzeiocom/markblog.git
synced 2025-04-22 19:02:16 +00:00
Removed category index as I will recreate it
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
a99febbd7c
commit
fae35f8dc2
@ -1,51 +0,0 @@
|
|||||||
import { NextPage, NextPageContext } from "next"
|
|
||||||
import Link from 'next/link'
|
|
||||||
import Post from "../../components/Post"
|
|
||||||
// import posts from '../../posts/pages.json'
|
|
||||||
// import firstline from 'firstline'
|
|
||||||
// import 'fs'
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
files: fileInformations[]
|
|
||||||
}
|
|
||||||
|
|
||||||
interface fileInformations {
|
|
||||||
title: string
|
|
||||||
slug: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const PortfolioIndex: NextPage<Props> = (props: Props) => {
|
|
||||||
|
|
||||||
const el: JSX.Element[] = []
|
|
||||||
for (const post of props.files) {
|
|
||||||
el.push(
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ul>
|
|
||||||
{props.files.map(post => (
|
|
||||||
<li key={post.slug}>
|
|
||||||
<Link href="/[category]/[slug]" as={`/${post.slug}`}>
|
|
||||||
<a>{post.title}</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
PortfolioIndex.getInitialProps = async (context: NextPageContext) => {
|
|
||||||
const arr: fileInformations[] = []
|
|
||||||
for (const post of await Post.fetchAll()) {
|
|
||||||
if (!post.isStarted) await post.fetch()
|
|
||||||
arr.push({
|
|
||||||
slug: post.slug.replace(".md", ""),
|
|
||||||
title: post.title
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return {files: arr}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default PortfolioIndex
|
|
Loading…
x
Reference in New Issue
Block a user