This project does not have a 4Geeks starter repository. Instead, follow the official Next.js documentation to create a basic repository.
We recommend starting the project using Codespaces (recommended) or Gitpod. Alternatively, you can work locally if you have Node.js installed.
⚠ Make sure to install the necessary dependencies when starting your project with
npm install
.
1npx create-next-app@latest blog
Example to read Markdown files (you should have a function similar to this):
1import fs from 'fs'; 2import path from 'path'; 3import matter from 'gray-matter'; 4 5export async function getStaticProps() { 6 const filePath = path.join(process.cwd(), 'posts', 'example.md'); 7 const fileContent = fs.readFileSync(filePath, 'utf8'); 8 const { data, content } = matter(fileContent); 9 10 return { 11 props: { 12 data, 13 content, 14 }, 15 }; 16}
Explore different ways to enhance your blog to make it more complete and functional.
In order to prepare better for completing this exercises, we suggest the following materials