However, I had over one hundred older posts with no Powerpress metadata and no file sizes so I wrote a Ruby script to recurse through all the posts. If the post was a podcast but enclosureUrl was missing it parsed it out of the body of the post. If the size was missing it got that from the file (since I have them all locally in a Dropbox folder). While I was at it, if the itunesDuration was missing from the frontmatter I used mp3info to get that while I was there.
I was a bit surprised once I got the script working. I thought it wasn't operating correctly because it ran so quickly but sure enough, I had over 600 changed Markdown files and the fields enclosureUrl, enclosureSize and enclosureType (hardcoded to 'audio/mpeg' in the script), and itunesDuration were populated in all.
At this point, I had all the necessary bits working. The entire history of my blog and podcast rendered properly. I had a podcast feed that was in fact properly handled by my podcatcher Podcast Addict on Android. I was able to have one page for podcasts and another for blogs.
I added pagination to both of the above, as I have many many posts to scroll through. The out-of-the-box pagination in Eleventy Duo wasn't to my liking so I hacked in the pagination from this gist. This has the nice aspect that when you are on page 25 of 50 pages, it shows "1 ... 23 24 25 26 27 ... 50". I liked that better than having a list of 50 numbers which was the default.
I also wanted a tag cloud. I started with Ginger's tag cloud plugin. This creates a data structure of tags with their counts but doesn't have the actual component. I adapted this nice CSS/JavaScript tag cloud to use the data from the above and it worked great. You can see it on this site, where I have a "Recent Tags" cloud for the last 50 posts and an "All Tags" cloud for every post in the history of this blog.
One problem I had with the "All Tags" cloud is that the logic above is linear. It takes the tag with the top count and that is the biggest. I have six size buckets (more made the biggest font too big). Since the most used tag had over 120 posts then the lowest bucket was everything from 1 to 20 uses, which was basically almost every tag on the whole site. I added a filter to go through and add another field for the square root of the count. For the "All Tags" it used the square root to calculate the sizes then the actual count for the display. This made it more cloudy and I was quite happy with the result.
As I went to make it live, I didn't want to break all the links that others might have to this site and that crawlers have already indexed. The URL scheme is already very close to Wordpress. The only difference is Eleventy has "/posts/" prefixing the date and slug based URL. I considered changing Eleventy config to render in the root directory but I actually like this organization better. Instead I added a redirect rule to my .htaccess to send anything looking for the WordPress style URL to the new one.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(20.*) /posts/$1 [R=301,L]
</IfModule>
Anything looking for an URL starting with a date will now look for that same URL but prefixed with "/posts/". I know from looking at the access logs this is working fine. I did similar stuff with the various RSS feeds of Wordpress to my statically rendered XML files. All of this is working perfectly.
There is still much more to be done. I consider this good enough to make my live public site but much of what I had is missing. My top priorities are:
It will take a little time to readjust from the Wordpress frame I have been in for so long. I did things the way I did because it was easy in Wordpress. The bad news is some things are no longer easy but the good news is I can do things what makes sense for me rather than what is most convient for the tool.
I very much like having the 22 year history of the blog and 19 year history of the podcast in a set of human readable text files that can be easily manipulated by VS Code or any other editor. Cleaning up tags in bulk in Wordpress is a drag. Cleaning them up now is doing a "Find and Replace in Files" and takes a few seconds. I also like that I can cut and paste the Markdown from my Obsidian notes directly into blog posts and they work without modification.
I really love that the whole of the blog, all of the content and all the code that renders it is committed to a private repository in Github. Worst case if my server were corrupted tomorrow I could set up a new one and have this site back on it in minutes. Dealing with the Wordpress backups and data dumps was not fun, and I paid something like $100/year for a plugin to handle that. Now I have better for absolutely free.
This is being written the morning after I made the new Eleventy version of the site live. I was allowing for an hour of site downtime to do it but in reality it took about 5 minutes to switch over. So far so good. I'm sure there is more to learn and many more tweaks to the logic and layout but I'm happy with where things are. Mahalo!