Book Image

Eleventy by Example

By : Bryan Robinson
Book Image

Eleventy by Example

By: Bryan Robinson

Overview of this book

11ty is the dark horse of the Jamstack world, offering unparalleled flexibility and performance that gives it an edge against other static site generators such as Jekyll and Hugo. With it, developers can leverage the complete Node ecosystem and create blazing-fast, static-first websites that can be deployed from a content delivery network or a simple server. This book will teach you how to set up, customize, and make the most of 11ty in no time. Eleventy by Example helps you uncover everything you need to create your first 11ty website before diving into making more complex sites and extending 11ty’s base functionality with custom short codes, plugins, and content types. Over the course of 5 interactive projects, you’ll learn how to build basic websites, blogs, media sites, and static sites that will respond to user input without the need for a server. With these, you’ll learn basic 11ty skills such as templates, collections, and data use, along with advanced skills such as plugin creation, image manipulation, working with a headless CMS, and the use of the powerful 11ty Serverless plugin. By the end of this book, you’ll be well-equipped to leverage the capabilities of 11ty by implementing best practices and reusable techniques that can be applied across multiple projects, reducing the website launch time.
Table of Contents (13 chapters)

What this book covers

Chapter 1, Setting Up Your Website, what is 11ty? This chapter dives into the world of SSGs to explore why 11ty exists and gets you started on your path to creating static-first websites with simple templates and configuration.

Chapter 2, Adding Data to Your Website, in this chapter, we take the project created in Chapter 1 and extend it by employing multiple techniques to import data into our HTML. We will learn all about the 11ty Data Cascade and how to add static and dynamic data.

Chapter 3, Deploying to a Static Site Host, a site isn’t a website until it’s been deployed to a server. In this chapter, we’ll take a look at the requirements for getting your 11ty website deployed to a static site host.

Chapter 4, Building a Blog with Collections, now that you’ve deployed your first 11ty website, let’s create a new project. In this chapter, we’ll dive into the world of 11ty collections to create a basic blog with custom templates, pagination, and dynamic category pages.

Chapter 5, Creating Custom Shortcodes to Add Mixed Media to Markdown, a blog isn’t just text. Sometimes you want more interactive elements. In this chapter, we’ll extend the basic functionality of 11ty to add custom shortcodes to import YouTube videos, CodePen displays, and custom blockquotes with semantic HTML.

Chapter 6, Building a Photography Site with the 11ty Image Plugin, images can provide an amazing amount of interest to your website. In this chapter, we dive into the 11ty Image plugin to discover how our static site can have optimized images for both a user’s browser and for our image’s use case.

Chapter 7, Building a Podcast Website with 11ty Plugins and Custom Outputs, not everything a website needs is HTML. In this chapter, we’ll take a look at the unique needs for a podcast website and output both an HTML website and a standards-compliant podcast RSS feed to launch your very own podcast.

Chapter 8, Creating a Static-Site Search with 11ty Serverless and Algolia, when you reach a certain level of content, search is an inevitability. Without a server, creating a search functionality is often relegated to frontend code. With 11ty Serverless, we can have solid, progressively enhanced search experiences without needing to create a split in our code base.

Chapter 9, Integrating 11ty with a Headless CMS, markdown is great for many content use cases, but sometimes you just need a content management system (CMS). In this chapter, we see how 11ty can work with the headless CMS Hygraph to provide a great editor experience alongside a great developer experience.

Chapter 10, Creating Custom 11ty Plugins, throughout this book, we’ve customized 11ty in many ways. Needing to do that customization between projects can require a lot of copying and pasting. In this chapter, we’ll optimize our flow by creating three custom 11ty plugins that give us great power for each of our projects.