Eleventy High Performance Blog screenshot

Eleventy High Performance Blog

Author Avatar Theme by Google
Updated: 18 Jan 2024
4063 Stars

A high performance blog template for the 11ty static site generator.

Overview

The Eleventy High Performance Blog is a starter repository for building a blog using the Eleventy static site generator. It incorporates a wide range of performance best practices to ensure fast and efficient loading times. The theme is based on the eleventy-base-blog, which serves as a foundation for this template. The goal of the theme is to achieve a perfect score in applicable lighthouse audits, including accessibility, and to minimize requests and optimize image loading.

Features

  • Performance outcomes: The theme aims to achieve a perfect score in applicable lighthouse audits, with a focus on accessibility. It also strives for a single HTTP request to the First Contentful Paint, optimized Largest Contentful Paint, and zero Cumulative Layout Shift and First Input Delay.
  • Image optimizations: The theme generates multiple sizes of each image and uses them in srcset. It also creates blurry placeholders for images without using HTML elements or JavaScript. Images are transcoded to AVIF and webp formats and lazy loaded using the native loading=lazy attribute. The theme also utilizes async decoding and lazy layout for images and placeholders.
  • Immutable URLs: The theme uses immutable URLs for CSS, JS, images, and fonts. It sets immutable caching headers for these resources and automatically configures it when deploying on Vercel. The theme also makes use of tree-shaking and dead-code elimination to eliminate unused CSS on a per-page basis.
  • Fonts: The theme serves fonts from the same origin and makes them display:optional to prevent blocking the page onload.
  • Analytics: The theme supports locally serving Google Analytics’s JS and proxying its hit requests to a Vercel Edge Function. It also supports sending Core Web Vitals metrics to Google Analytics as events and provides support for noscript hit requests. Analytics requests are designed not to block the page onload.

Installation

To install the Eleventy High Performance Blog theme, follow these steps:

  1. Generate a new repository from this repository template by clicking the “Use this template” button. Alternatively, clone the repo and push it to your preferred git repository.
  2. Clone the new repository to your local machine.
  3. Navigate to the directory of the cloned repository.
  4. Install the necessary dependencies.
  5. Build, serve, watch, and test the theme.
  6. Build and test the customizations.

To customize the theme, search for “Update me” across files in your code editor to find all the site-specific elements that need to be updated. Make sure to update the favicons in ‘img/favicon/’ as well. You are free to make any additional customizations as desired.

Summary

The Eleventy High Performance Blog theme is a powerful template for building a blog using the Eleventy static site generator. It incorporates a wide range of performance best practices to ensure optimal loading times and user experience. With features like image optimizations, immutable URLs, lazy loading, and support for analytics, the theme provides a solid foundation for creating high-performance blogs. The installation process is straightforward, and customization options are available for tailoring the theme to specific needs. Overall, this theme is a valuable tool for developers looking to create fast and efficient blogs.