Skip to content

niallam22/next-SSG-blog

Repository files navigation

Niall's SSG blog

This is a Next.js blog using SSG (static-site-generation) to improve SEO and user experience.

Navigating the blog

About this project:

This blog is made with Next.js 13. Blog posts are statically generated from markdown files at build time this supports improved loading speed and improved SEO because the pages don't need to be rendered server side. Blog posts and their corrosponding routes are dynamicall generated which means new posts can be easily created without needing to configure new routes and pages each time.

Tech used:

Typescript, React, Next.js 13, Tailwind CSS

How it's made:

  1. The home route contains dynamic routes that link to blog posts. Since the routes are dynamic new blog posts can be added by creating new markdown files in the blog post directory and be automatically rendered.
  2. getStaticParams is used to pre-fetch the blog posts so that the routes can be rendered SSG at build time rather than at request (server-side-rendering (SSR)). This improves speed and SEO.
  3. Post params are used to dynamically generate page meta data related to the articles to support SEO.
  4. The site is responsive and mobile friendly and has been styled with Tailwind.

Optimisations

  • Implement page validation with incremental-static-regeneration (ISR) to revalidate the page at set increments or when updates are made

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.