Markup and Static Site Generators

Learn about markup and static site generators.

We'll cover the following

Markup

The “M” in Jamstack stands for “markup,” or to put it simply, it represents the static content that’s present on any web page. Markup is one of the three core components of a Jamstack application. Markup is the term used to describe the structure and style of the content served to the user on a web page.

Let’s get started and make our first static application.

This little HTML page is the simplest Jamstack application we can make. How can we call it a Jamstack application, though? All this page uses is markup, which is a part of Jamstack and is being served directly without a web server, making it a Jamstack application. This is what we refer to as a static application. There are two main reasons we can call it a Jamstack application:

  • It uses markup, which is a part of Jamstack and is being served directly without a web server.

  • It utilizes the fundamental principle of a Jamstack application; it displays static or prebuilt content in a browser instead of performing tasks on the browser.

Static site generators

A static site generator is a tool that builds a complete, static HTML website using data and templates provided to it. Essentially, they automate the process of making individual pages and also keep those pages ready to serve as they are pre-rendered.

Static sites use templates, which are like blueprints for web pages. They’re reusable and developers prefer to use them to avoid writing the same formatting multiple times.

Next.js

In this course, the front-end technology we’ll be using is Next.js. Next.js is a React framework for web development that enables server-side rendering for React applications and the ability to generate static websites.

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
}

module.exports = nextConfig
Hello, World application in Next.js

The Next.js code above looks very similar to a React component. That’s because it is a React component. Next.js adds useful features for React applications like easier routing and static site generation.

The only new file here is the next.config.js file. This file is home to all the configuration settings that Next.js requires—for example, if the application wants to use React strict mode.