If you’ve ever felt overwhelmed by the sheer complexity of modern web frameworks, you aren’t alone. I spent years jumping between React-based static site generators only to realize that for 90% of projects, I just needed HTML and CSS that didn’t take ten seconds to build. That’s why I switched to Eleventy. In this eleventy tutorial for beginners, I’ll show you how to move away from the ‘JavaScript fatigue’ and build a site that is fast, secure, and incredibly easy to maintain.

Core Concepts: What Exactly is Eleventy?

Eleventy (or 11ty) is a Static Site Generator (SSG). Unlike a traditional CMS like WordPress, which builds pages on the fly using a database, 11ty transforms your raw content files into static HTML files during a ‘build’ step. This is the foundation of why you should use a static site generator: speed, security, and effortless hosting.

The magic of 11ty lies in its ‘zero-config’ philosophy. It doesn’t force a specific templating language on you. Whether you prefer Markdown, Nunjucks, Liquid, or just plain HTML, 11ty handles it. In my experience, this flexibility is what makes it superior to more rigid options; you aren’t locked into a specific ecosystem.

Diagram showing the Eleventy build process from raw Markdown to static HTML
Diagram showing the Eleventy build process from raw Markdown to static HTML

Getting Started with Eleventy

Before we dive into the code, make sure you have Node.js installed on your machine. I recommend using the LTS version to avoid weird dependency bugs.

1. Installation

Open your terminal and create a new project folder. We’ll install the Eleventy CLI globally so we can use the npx @11ty/eleventy command anywhere.

mkdir my-11ty-site
cd my-11ty-site
npm init -y
npm install @11ty/eleventy --save-dev

2. Your First Page

Create a file named index.md in your root directory. Add some simple Markdown content:

# Welcome to my 11ty Site
This is my first page built with the eleventy tutorial for beginners guide!

Now, run the development server:

npx @11ty/eleventy --serve

Visit http://localhost:8080, and you’ll see your rendered HTML. No complex build pipelines, no hydration errors—just pure HTML.

Building Your First Project: Layouts and Data

Writing every page in raw Markdown is tedious. We need layouts so our header and footer remain consistent across the site. This is where 11ty’s power really shines. As shown in the architecture diagram below, layouts wrap your content to create a complete page.

Creating a Layout

Create a folder called _includes and inside it, create a file named main.njk (using Nunjucks, a powerful templating engine):

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>{{ title }}</title>
</head>
<body>
  <header><nav><a href="/">Home</a></nav></header>
  <main>
    {{ content | safe }}
  </main>
</body>
</html>

Applying the Layout

Go back to your index.md and add ‘Front Matter’ at the top. Front matter is the YAML block that tells 11ty which layout to use and what data to pass to it:

---
layout: main.njk
title: Home Page
---
# Welcome to my 11ty Site
Now I have a beautiful header and footer!

Common Mistakes When Starting with 11ty

Having used 11ty for several production sites, I’ve noticed a few recurring pitfalls for beginners:

Learning Path: From Beginner to Pro

Once you’ve mastered the basics in this eleventy tutorial for beginners, I suggest following this progression:

  1. Collections: Learn how to group posts (e.g., ‘blog’ vs ‘projects’) to create automated archive pages.
  2. Data Files: Use _data JSON files to manage site-wide variables like your social media handles or site title.
  3. Shortcodes: Create reusable snippets for things like YouTube embeds or custom buttons.
  4. Deployment: Once your site is ready, look into deploying to GitHub Pages or Netlify for free, high-performance hosting.

Essential Tools for Your 11ty Workflow

Tool Purpose Why I Use It
VS Code Editor Best-in-class Markdown and Nunjucks extensions.
Prettier Formatting Keeps my HTML and YAML clean.
Netlify Hosting Instant deploys from Git with great CDN performance.

If you’re comparing static site generators for a more complex documentation project, you might want to check out my guide on Hugo vs Jekyll for documentation to see where 11ty fits in the landscape.

Ready to speed up your workflow? Start by building a simple personal portfolio today. The less JavaScript you ship to your users, the better your SEO and UX will be.