Migrating Blog From Wordpress To Eleventy

This weekend I migrated my blog from WordPress to Eleventy. The process is so simple it is incredible how easy it has become to spin up new sites. Thanks to Eleventy, Netlify, and all the open source theme developers out there who make that possible!

At a high level, here are some of the steps I took.

node index.js --addcontentimages=true

I had to do some edits to fix broken image links in the markdowns but that wasn't unmanageable for me. There are only a few posts to deal with at this point. Good time to migrate. I do wonder how this experience could turn out for those who have thousands of posts.

const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");

module.exports = (config) => {
config.addPlugin(syntaxHighlight);
}

Also added the reference in the base.njk file.

  <link href="https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css" rel="stylesheet">
<script
async
src="https://utteranc.es/client.js"
repo="valarnet/valarnet-blog"
issue-term="title"
theme="github-light"
crossorigin="anonymous"
></script>

An annoying message I continued seeing when committing and pushing changes to my remote blog repo is a falling out of sync between local main branch and origin/main

On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)

It's just a simple blog and I do not need to branch it out so far. I just work on the main. I have leaned on a simple four step process to make that annoying message disappear without losing my changes.

git add .
git commit -m "Made some formatting changes"
git push
Validate the changes have propagated to remote repo (**important step not to lose the changes**)
git fetch

My branch and origin/main stay synced and the git status reflects that. Make sure to validate the push has made your changes propagate to origin/main before doing a git fetch. Otherwise, git fetch can overwrite the local main branch.

There are some additional things I want to modify over the next few days as I find the time. Some of which are simple tweaks such as same file markdown location linking, the looks and colors in main.css, integrate Netlify analytics, mobile site rendering customizations, minimize post title font size rem, etc.

Huge appreciation to the Eleventy and Open Source community who make tons of hours of their work available to use freely! :clap:



Tags: random

← Back home