惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
A
About on SuperTechFans
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
I
InfoQ
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
U
Unit 42
The Cloudflare Blog
Y
Y Combinator Blog

Matthias Ott

Hello Again, World This, Still Not for Everyone The Shape of Friction WeissKlang L1 – Punching Above Its Weight Continvoucly Morged Value Webspace Invaders To Affinity and Beyond The Mystery of Storytelling Amateurs! Echoes of Connection Linear() Is Not (That) Linear View Transitions: The Smooth Parts Adding AVIF and WebP Support to My Craft CMS Site Challenge Acoustic Room Treatment and Building Sound Panels, Part 1: Planning Play On Overshoot The HTML Output Element Listening Closely Compressed Fluid Typography The Lifeblood of the Web What Could Go Wrong? That’s My Rank Making Space CSS :is() :where() the Magic Happens Visual Regression Testing for External URLs With Playwright Jane Goodall’s Famous Last Words European Tech Alternatives 🇪🇺 Independent Type Foundry Advent Calendar – Day 24: NaN Independent Type Foundry Advent Calendar – Day 23: Typotheque
Eleventy Plus Vite
Matthias Ott · 2022-07-10 · via Matthias Ott

What’s the single best thing you can do if you want to learn a new tool or evaluate a new technology? Right, it’s getting your hands dirty.

Only by building something tangible, like a realistic prototype or even a real project, you’ll get immediate answers to the questions that are relevant to you and your specific context. Based on those insights, you can then make an informed decision about whether this tool is the right one for you or not. Also, it is so much fun to build something new, right?

So imagine my excitement (🥳🎈) when I recently decided to start a new side project and finally got to try out Eleventy, Zach Leatherman’s lovely Static Site Generator. And because every good side project begins by starting another side project and also because the The Law of Eleventy™ demands that you create a starter project as the first step of your learning journey, I did exactly this: set up a starter project.

Another thought I had immediately was that I could also try out Vite, Evan You’s blazing-fast build tool. I had heard a lot of praise for it and also listened to a really intriguing episode of Chris’s and Dave’s ShopTalk Show with Evan You. So I had a look at it and, luckily, also found a plugin Zach had published earlier this year that lets you use Vite with Eleventy.

A clear, performant base #

The thing with starter projects is that they grow old very quickly. Of course, when you set everything up, you want to add the latest tools, all those dependencies that are currently state-of-the-art, and also want to try out new things. But this, in turn, means that you now might have to update your project more regularly and also re-evaluate some of the decisions you made. On the other hand, as long as, for example, a build process works, you might not need to change a running system. And there is always the process of learning something new that makes setting up a starter project valuable in itself.

So, I set out to create a starter that should be as simple and concise as possible, not only to make it easier to understand for anyone who wants to get their head around it as well – including or my future self – but also to reduce the need for maintenance. At the same time, I wanted it to have all the features already built in that I would enjoy in such a base project. For example, a really performant base with Critical CSS, a web font loading strategy, or also base styles for responsive typography. And, of course, RSS.

The result of my endeavors is Eleventy Plus Vite, a starter project with the following features:

There were quite a few things to get my head around, besides learning about how to use Eleventy and Vite. For example, I had also not worked with Rollup before, which Vite uses to bundle JavaScript modules. And many of the plugins I now use in the starter were also new to me. But that’s exactly why building something real is so valuable: in order to find solutions for problems that seem complex and unsolvable at first, you are forced to play, explore, and blindly try out things that sometimes work and most often don’t. And step by step, you understand how everything works.

If you want to get started with Eleventy as well, maybe you better don’t use my starter. 😉 Have a look at Eleventy and a few other starter projects yourself. There is also a brilliant introduction by Andy Bell, Learn Eleventy From Scratch. The course is now Open Source and although it might be outdated here and there because it is from 2020, it still explains the basic concepts very well. Stephanie Eckles wrote A Deep Dive Into Eleventy Static Site Generator for Smashing Magazine and she also collected a lot of useful resources on the website 11ty Rocks!. And, besides many more articles you can find on the Web, there is the Eleventy Documentation, to help you get started.

Thanks so much again to all the people who created a starter project or Eleventy site before me, especially Stephanie, Miriam, Max, and Zach. I learned so much from your different approaches (and shamelessly copied a bit of code here and there as well… 😇)!

Oh yes, and I’ll keep you posted on any updates I make to the project, for example, the dark mode toggle I am currently working on.

~

26 Webmentions

26 Likes

ⓘ Webmentions are a way to notify other websites when you link to them, and to receive notifications when others link to you. Learn more about Webmentions.