You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
657 B

4 years ago
import Link from "next/link";
const BlogList = ({ posts }) => {
const blogElements = posts
.sort((a, b) => a.frontmatter.date < b.frontmatter.date)
.map((post) => (
<div>
<Link href={"/posts/" + post.slug}>
<a>{post.frontmatter.title}</a>
</Link>
<style jsx>
{`
a {
margin-top: 1em;
}
`}
</style>
</div>
));
return (
<div>
{blogElements}
<style jsx>
{`
div {
width: 100%;
height: 100vh;
}
`}
</style>
</div>
);
};
export default BlogList;