Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


Login

Start interactive tutorial

← Back to Projects

Create a Blog from Scratch with Next.js and Markdown

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

📝 Instructions

🌱 How to start this project?

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.

📝 Instructions

Step 1: Set Up the Blog Foundation

1npx create-next-app@latest blog

Step 2: Basic Blog Structure

Step 3: Generate Blog Content with AI

Step 4: Render Blog Content

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}

Step 5: Design and Improve the Interface

Step 6: Advanced Features (Optional)

Bonus: Publish Your Blog

Explore different ways to enhance your blog to make it more complete and functional.

Signup and get access to this project for free

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Signup and get access to this project for free

We will use it to give you access to your account.
Already have an account? Login here.

By signing up, you agree to the Terms and conditions and Privacy policy.

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Difficulty

  • intermediate

Average duration

4 hrs

Technologies

Supplementary Material

In order to prepare better for completing this exercises, we suggest the following materials

Lesson

Learn React here: React JS Tutorial

Exercise

Learn React.js Tutorial and Interactive Exercises

Project

Build a Basic E-commerce App with Next.js!