How to build a website with Eleventy and deploy it on Netlify

Static sites are getting very popular, and for a good reason: they are performant and you can build one for free.

Eleventy is a new static site generator that you can use to build a website and host it on Netlify.

In this post I’m going to show you how to build a (simple) website with Eleventy and deploy it on Netlify.


I will assume you have:

  • Node.js 12.18.0 installed
  • A little knowledge about JavaScript and its environment (npm, npm scripts)
  • Git installed and a little knowledge about how to setup a git repository, switching branch, etc.
  • A little terminal knowledge
  • A code editor installed. I will use Visual Studio Code, but you can use whatever you like

Commit often

I suggest you to commit often, to keep track of the changes you’re making. Whenever you see this symbol, I’m making a git commit ✅.


To install Eleventy, create a folder eleventy-playground

mkdir eleventy-playground && cd eleventy-playground

Create a package.json file

npm init -y

Then install eleventy

npm install --save-dev @11ty/eleventy

That’s it.

Project setup

Then open the project in your editor

code .

Before going forward, now it’s a good moment to initialize our git repository

git init .

And create a .gitignore file to exclude the node_modules folder ✅

touch .gitignore
# .gitignore file

Creating and deploying your first website with 11ty

Now’s the moment to build and deploy our first (even if super-simple) website.

When solving complex problems I usually try to connect all the dots with the most simple version of the problem. (This is what Nat Pryce and Steve Freeman authors of Growing Object-Oriented Software, Guided by Tests call Walking Skeleton).

So our plan is this:

  1. Create a one-page website with eleventy
  2. Deploy it on Netlify

Once we have the deploy pipeline for this simple website, we will simply evolve it, deploying continuously without having to worry. Let’s start

Create a file in the root folder


Then, add some content to it ✅

# My website

This is my website, built with Eleventy.

Let’s see our masterpiece. Run this command in your terminal

npx @11ty/eleventy --serve

This will compile your website and run a local server for you. By default Eleventy stores all the website files in a folder named _site.

You should see something similar in your terminal:

Just click on the Local link and voilà, here’s your first website built with Eleventy!

It’s not fancy, but it works. I always follow this principle when working:

  1. Make it work
  2. Make it right
  3. Make it fast

Now let’s deploy this website and make it public.

We’ll use Netlify to host all of our websites. Create an account, and just after that you’ll see this dashboard

See the drop zone? That’s where we’re going to drag and drop our website files. Like this


Once finished, Netlify should show you a URL like this with your finished website. Congratulations!

My highlights for “The Elements of User Experience”

Lately for a project I’m involved on (and about which I’ll talk in a later post) I’m studying and reading a lot about User Experience.

I’m not new to the concepts of good UX and I’ve read a lot of articles in the past ten years. What I’ve missed is a comprehensive overview of the subject. A couple of friends suggested me to give this book a try, and I was glad I did.

You can sense from the screenshots and the examples that this is an “old” book, but if it weren’t for these aging assets, it could have been written yesterday.

I’m often surprised when something is so well written and explained and yet during our days we keep reinventing it and trying to get the buy-in for processes that should be straightforward in web development. It’s like civil engineers had to always reinvent the way you build a skyscraper!

But enough of my ranting, here are my highlights from the book.

Continue reading “My highlights for “The Elements of User Experience””

Back from the holidays: hiking around Monte Bianco

When I was younger, I usually went hiking with my dad.

He had one of those hiking guides that lists all the walks in a certain region; I still remember the name: “Il Cammina Campania. Guida WWF”.

I have wonderful memories of those walks: the early wake-up, me sleeping in the car, the 4+ hours of walking, collecting dead branches to create our very walking sticks…

Since then, though, I didn’t hike so much. Just some random walks in nearby parks, or something like that.

So when I and Valeria were planning our holidays I asked her if she’d like spending a week walking around the mountains. And she said yes!

It was great! 

I feel so refreshed and full of energy, that I’m asking myself how I’ve survived without this for all of these years.




My 2017 reading challenge

Some books with a candle

Last year I decided that I wanted to read more. So I set myself a goal to read 53 books in one year. I failed (That’s a recurring theme).

During the challenge, that started the 31st of October 2016, I managed to read ~25 books. Here they are:

  1. Intercom on Product Management Great book
  2. Docker for Developers meh
  3. Liminal Thinking: Create the Change You Want by Changing the Way You Think I need to read this again
  4. 97 Things Every Programmer Should Know: Collective Wisdom from the Experts Lot of insights
  5. Modernizing Legacy Applications in PHP Really well written
  6. Digital Marketing For Dummies I don’t usually read marketing books, but this is good
  7. La luna e i falò A Masterpiece
  8. Alice in Wonderland A classic
  9. Contagious: Why Things Catch On You need to read this!
  10. Warren Buffett Style: Regola n.1 non perdere mai denaro What was I thinking? Awful
  11. Start with Why: How Great Leaders Inspire Everyone to Take Action Maybe I need to re-read this. I didn’t like it
  12. The Time Machine Wow!
  13. The War of the Worlds Slow, but good
  14. Demystifying Public Speaking A good piece on the topic
  15. The Digital Photography Book 1 Sometime you need to move on
  16. Blockchain Basics: A Non-Technical Introduction in 25 Steps To understand what was it all about
  17. The Principles of Successful Freelancing I had the idea to start freelancing
  18. The Adobe Photoshop Lightroom CC Book for Digital Photographers I like retouching photos
  19. The Minimalist Photographer And also travel light
  20. The Best of The Digital Photography Book Series Same as above
  21. Travel and Street Photography: From Snapshots to Great Shots And travel
  22. Beyond Legacy Code A nice read
  23. Growing Object-Oriented Software, Guided by Tests If you’re into testing, you should read this book
  24. A Common-Sense Guide to Data Structures and Algorithms: Level Up Your Core Programming Skills Very basic, but if you need an introduction, it’s perfect
  25. The Little Black Book of Decision Making: Making Complex Decisions with Confidence in a Fast-Moving World I really loved this book: it’s packed with knowledge

So I’ve read less than half my goal but, jokes aside, I don’t consider it a failure. I’ve read more in 2017 than in the previous two years!

Tips to read more

Social media has taken a toll on everyone. I discovered myself more than I like to admit browsing endlessly streams of jokes, links, articles (I’ll just save it and read it later…yeah sure), tweets, photos and so on. But I also discovered that I could just stop. I trained myself to stop being a social media zombie and read instead.

Everyone imagines that to read you have to be sitting on your favorite couch, beside a fireplace, drinking hot chocolate while outside the snow falls covering the ground. How romantic. Yes, there are situations like this and they happen in the movies. We live in the harsh reality, we should be guerrilla readers.

No, that’s not how we read everyday

The trick is: read everywhere, even if a single page or paragraph. In a queue? Read. Waiting for the doctor? Read. Stuck in traffic? Listen to an audiobook. To the dentist? Run! 😀

My friends know that I swear by Safari Books Online: the thing that I like the most is that it enables me to access and download all the books on my smartphone, so that I don’t need to bring with me yet another device (I’m looking at you, Kindle. It was nice, but you know that it never worked between us)

2018 edition

So have I stopped? Of course not. But only stupids don’t learn from their mistakes.

So for this year I’ve decided to start from January to December (so that I can track my results in Goodreads better). And since I don’t think that I’ll be able to read a book a week, I’ve decreased the target to 40 books. That’s a bit more than last year.

So, are you up to a challenge? Connect with me on Goodreads

Impersonal feedback

Happily, over the years I’ve learned that it *is* possible to take critical feedback (and, more broadly, failure) less personally. Of course I still feel disappointed when I fail, or when someone I respect tells me that what I’m doing feels off-track or isn’t going well. We all want to succeed and we all want the people we like to think well of us. But disappointment is different than self-doubt. It’s the difference between thinking: I could have done better and I’m incompetent so I’m not cut out for this. The former is about judging your performance on a particular task, and the latter is about judging your character. If you can stop doing the second thing, then critical feedback will not feel so personal.