how to start your own 11ty blog
In my opinion, running your own blog and domain name is extremely cool.
This blog section runs on something called 11ty. To set it up, this is my own version of 11ty.org's Get Started documentation. (I am going to come back to this later and make it more detailed, but in the meantime here's a very good tutorial)
- First up, you need:
- Visual Studio Code. If you're one of those who think Micro$$$oft is the devil, you can use VSCodium instead. (I use Vscode because I have accepted my fate.)
- Install Node.js v18 or higher. You may already have this installed. Open up a Terminal window and check if you have Node.js by typing
node --version
-
Create a folder where you want your blog to be.
-
Open up the folder on Vscode.
-
Go to the Terminal tab in Vscode.
-
In the Terminal tab, get npm started:
npm init -y
- Install 11ty. This will add all sorts of files and folders.
npm install @11ty/eleventy
-
Change the file
package.jsonin your / root folder. -
Create the file
eleventy.jsin your / root folder with the following code in it:
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/css");
dir: { input: "src", includes: "_includes", output: "public" }, };
};
- Create these folders in your / root folder:
/src/
/src/_includes
/src/css
- All done! Type this in the Terminal tab to run 11ty:
npm start
-
The Terminal tab will tell you where you can view your new (empty) 11ty site, likely at
http://localhost:8080. -
End the process by typing Ctrl+C to kill terminal. (
Terminate batch job Y/N?) Pressyto continue, of course.
That's the skeleton process. I should flesh this out more and include a starter layout, but I've really only done one layout ever and you're currently looking at it.