Eleventy on GitHub Pages (Part 3)
Previously, I made an Eleventy based GitHub project with GitHub automation to run Eleventy when checking in changes and hooked up a custom subdomain to the GitHub pages thinking I would start a new domain for the new blog. But I changed my mind again and now have my old URI pointing to the new blog:
- I made a PowerShell script to take my old blog's atom XML and turn them into post MD files for Eleventy. It was more difficult than I thought because my atom was not valid XML (eek). Rather than write code to fix it, it was easier to just edit the XML by hand to fix.
- I also customized my Eleventy URIs for blog posts to match my old blog's URIs. I added post.11tydata.js files that setup the URI using custom JS functions. I define the functions in eleventy.config.js via
eleventyConfig.addFilter
. - That covered most of the static blog content. For the rest I made a new subdomain to point to the old server and added a custom 404 page that can help redirect to the old server. GitHub Pages custom 404 are supported by putting a 404.html in the root path.
- I followed GitHub's directions for hooking up a top level domain name which was just to make A and AAAA records pointing to the GitHub IP addresses. It took a bit to populate but then worked great.
- I forgot to update the CNAME file. Doing a push reset my domain for my github pages back to the previous name which no longer points to anything and broke the site. I fixed the content in the CNAME file to address the issue.
I'm going to call this transition complete! Its so much easier to work with Eleventy to add posts and not have to worry about server upgrades breaking things. For the new web content I've finished making a sticky scroll animated header but still have thoughts for the future like a share button, and Mastodon based comments.
- Previous: CSS Scroll Animated Sticky Header