This is my first time using 11ty, so I had some trouble creating a blog at first, so I followed this LINK to start.
Besides step 1 using VSC, I created all these files and folders within the project through Notepad
Step 1
- You start of by creating a directory in the terminal
mkdir myblog
cd myblog
(myblog is what I called my project).
Step 2
-
Next is creating a
package.jsonfile
npm init -y
Then you install it
npm install --save-dev @11ty/eleventy
Step 3
-
Creating a folder called
_includesand a file within calledlayout.njk.
First Blog
Now you have to create a folder where all your
.mdfiles will be held. I created a folder calledblogand the first markdown filefirstblog.mdNow you can compile the project with
npx @11ty/eleventy --serve
Your terminal should have compiled an index.html into a _site folder.
Final Project
Plug-in
The plug-in is used to make the date more presentable and easier to read.
To do this, create a file
.eleventy.js. Then you putnpm install --save-dev eleventy-plugin-dateand donpx @11ty/eleventy --serve.You'll see a http link containing
localhost. Doctrl + clickto open your page!

Top comments (0)