{"schemaVersion":"1.0","type":"Article","types":["Article"],"slug":"learn-eleventy-part-1-12zhr","url":"https://zyvop.com/learn-eleventy-part-1-12zhr","title":"Learn Eleventy Part 1: Installation","subtitle":"Scaffold the project ","tldr":"UPDATE: September 2026 This series has been updated to more newer version. It was merely authored years ago. In this article, I said that we will be doing a com...","keywords":["Eleventy"],"entities":["James 'Dante' Midzi","Solutions Architect","Eleventy","ZyVOP"],"keyTakeaways":["UPDATE: September 2026 This series has been updated to more newer version.","It was merely authored years ago.","Before we get into that, let's talk a bit more about Eleventy."],"headings":["UPDATE: September 2026","How Eleventy Works","Templates","Requirements","Setup","Configure Project","Running Our Project","Gotcha","Your First Template","Using Variables In Templates","Conclusion","Thank you for reading, let's connect!"],"outboundLinks":["https://github.com/Psypher1/learneleventy/tree/part1-installation","https://www.11ty.dev/docs/","https://github.com/Psypher1/learneleventy","https://twitter.com/Psypher1","https://discord.com/users/Pharaoh#5441/","https://www.linkedin.com/in/jamesmidzi/"],"contentText":"UPDATE: September 2026 This series has been updated to more newer version. It was merely authored years ago. In this article, I said that we will be doing a complete tutorial of Eleventy - from scratch to deployment. Before we get into that, let's talk a bit more about Eleventy. How Eleventy Works Eleventy aims to ship as little javascript as possible. It does this by rendering your source files into html and serving those static files. Templates Templates is the way you create your various pages in Eleventy. It supports over 3 template languages. Some of them notably: html markdown liquid nunjucks What this means is that you have several options to how you choose to author your site. In this tutorial, we will be using markdown and nunjucks for our templates. Requirements At this stage, you'll need only 3 things: Node A text editor Willingness to learn p Make sure you have node installed , then continue with this tutorial Setup Create an empty folder anywhere on your computer and navigate into it mkdir learneleventy cd learneleventyInitialise an empty package.json file with pnpm initInstall eleventy pnpm install @11ty/eleventyConfigure Project By default Eleventy uses files your project root to generate your site - you could place all your files there and it would work. I prefer a more ordered approach - having an src folder. Luckily for us Eleventy allows us to modify the path where it looks for source files In your project root, create a file called eleventy.config.js and place this in it: exprort default function (eleventyConfig) { return { dir: { input: \"src\", data: \"_data\", includes: \"_includes\", layouts: \"_layouts\", }, }; };This is our configuration file for our project. In it we define how we want a our project to behave. For now: We have set our input directory to src Our includes folder to _includes - Eleventy will look for this folder Our layouts folder to _layouts We will talk about the data folder later With that done, we make an src in our root and that's where our files will go. Let's make two more folders in src that we will use later: _layouts and _includes Let's make a index.md file in the root of our src and lets put some dummy content # My Eleventy Site I am a site made with EleventyRunning Our Project To run our site, type this command in your terminal pnpm exec eleventyYour site will be running in development on http://localhost:8080/. You will also notice that a _site folder has been generated, this is where our rendered files will go. We don't want to always have to write this when we run our project, so let's add a script in package.json \"scripts\": { \"dev\": \"exec eleventy --serve\", },Gotcha If we were to change anything in our index.md, those changes would not show unless reloaded the page. Eleventy requires a valid html document structure to facilitate that. Your First Template Let's now implement templates in our Eleventy project. In src/_layouts make a file called base.njk &lt;!DOCTYPE html&gt; &lt;html lang=\"en\"&gt; &lt;head&gt; &lt;meta charset=\"UTF-8\" /&gt; &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" /&gt; &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /&gt; &lt;title&gt;My Eleventy Site&lt;/title&gt; &lt;/head&gt; &lt;body&gt; {{content | safe}} &lt;/body&gt; &lt;/html&gt;As you can see it's just an html document. The thing that's different is {{content | safe}}. This is where any content wrapped by our base will go. The | safe part is a filter that tells Eleventy that the content is safe to render. Then modify index to look like this: --- layout: base --- # My Eleventy Site I am a site built with [Eleventy](https://www.11ty.io/).We added YAML frontmatter and specify the layout that is supposed to wrap this file. Now any changes we make to our source files will automatically update. Also, our page now has a title and doesn't say localhost:8080 NOTE : You can override the template languages in your project if you want to use anything other than markdown and nunjucks. Using Variables In Templates Usually each page on a site has a unique title. We have hardcoded the title. Let's improve that so that the page title is applied dynamically. Modify our base with this &lt;title&gt;My Eleventy Site - {{title}}&lt;/title&gt;Then our index.md YAML with thiis --- layout: base title: Home ---Now when we hover over the tab we see My Eleventy Site - Home Conclusion Without doing a lot, we have built a website. It may not look nice right now, but it is valid webpage. Join me in the next part as we add more to this site. The working repository for this series can be found here: Part 1: Installation While You wait Check out the docs: https://www.11ty.dev/docs/ Join the Discord, a lot of helpful people in there The working repository for this series can be found here: https://github.com/Psypher1/learneleventy Thank you for reading, let's connect! Thank you for visiting this little corner of mine. My email and DMs are always open; if you want to chat or collaborate on something, shoot me a email Where you can get hold of me: Twitter &lt;a hrer=\"https://discord.com/users/Pharaoh#5441/\" target=\"_blank\"&gt;Discord&lt;/a&gt; LinkedIn","contentHash":"sha256:20617bdd426bc75bee02f9d79546302852009da0e53619ac0492c890995de06f","authorName":"James 'Dante' Midzi ","authorUrl":"https://zyvop.com/author/james","authorSameAs":["https://dantedecodes.vercel.app/","https://github.com/Psypher1","https://twitter.com/Psypher1","https://www.linkedin.com/in/jamesmidzi/"],"category":null,"tags":[],"audience":"Software engineers and developers building applications with Eleventy","tone":"Professional, solutions architect perspective","readingTimeMinutes":4,"wordCount":894,"faqs":null,"primaryTopic":"Eleventy","publishedAt":"2022-05-23T00:00:00.000Z","updatedAt":"2026-09-22T08:43:37.161Z","canonicalUrl":"https://zyvop.com/learn-eleventy-part-1-12zhr"}