Converting my old food blog from Wordpress to 11ty
Converting my old food blog from Wordpress to 11ty
What I did (documented, so I can retrace my steps later):
npm install
), but you could just run directly using npx wordpress-export-to-markdown
. whateveryourblogname-plus-stuff.xml
to export.xml
to save you some copy-pasting when converting.node index.js --addcontentimages=true
, which makes sure the image paths in your mardown files lead to your local copy of the image, not to the copy of your image on wordpress servers. Other options I chose in the “wizard” that you are being run through, without giving it much thought: I created year and month folders.
npm init -y
npm install @11ty/eleventy --save-dev
Create some basic standard eleventy folders and config files:
src
for the source files such as your markdown blog posts, with subfolders _data
and _includes
(which gets its own subfolder layouts
for any layout templates you’ll make and use) _site
as the output folder where eleventy will place the html files it generates from markdown in src
..eleventy.js
file.src
folder. I made a subfolder posts
for them, as is traditional for blogs.layouts/base.njk
). Tell every md in posts to use your new layout base.njk
by creating a json file in the posts directory, also called posts.json, and adding "layout": "layouts/base.njk"
npx @11ty/eleventy --serve
TODO:
npm install tailwindcss
and npm install @tailwindcss/typography
npm install postcss-cli
src
and put a main.css inside. Don’t forget to link the generated main.css in the base template.