Updated Feed & Script

Automated Feed

I put about 5 hours into updating this site yesterday and this morning. My server now has a cron job that automatically runs a PHP file that generates an XML file. It had to be coded in a way that would remove any HTML and CSS that might break in a feed reader. Using this feed validator, I was able to see any errors and suggested changes. I even had the PHP file make images clickable so they could be opened for better viewing.

I did all this on an alternative feed first to avoid issues in readers, but unfortunately I had it set to pick up the date and time through the modification timestamp of the file. I added a meta tag in every post to fix that. Overall, this has been a pain in the butt, but I think I have it working correctly now.

My feed link hasn’t changed, but for anyone already subscribed, there will most likely be duplicate posts now. I would have avoided that if I could have, but there really was no way that I know of because I had to switch to a consistent guid that the PHP file could generate.

I’ll have to put my unfinished posts in a different path now and move them over to the posts folder when complete so the PHP file won’t put it into the feed. That should have been in my workflow anyway. Automating the feed was a fun and stressful experience, and I hope it’s over.

JavaScript Header and Footer

With a script, I only have to change one file if I update my header or footer navigation. That’s exciting, but what I’m equally excited about is the no-script tag I added on every page. If scripts are disabled, I have it where a single navigation button that links to a navigation page will show in the place of the missing script. I didn’t want to make it where the site would be broken without scripts.

I believe as much of the internet as possible should function with scripts disabled, for a few reasons:

  • Older browsers don’t always support modern JavaScript, or they don’t run it well.
  • It could help reduce e-waste by extending the life of older devices.
  • Disabling scripts is a choice people make to improve security.

Mobile Compatibility

I love hamburger buttons, so I added one to the header for mobile view. All it took was a little bit of CSS. The only way I have to test it is right-click>inspect. There’s a little mobile view button there.

I couldn’t have done some of these updates without ChatGPT. So, if you ever want to hand code a website, it’s a lot easier than it used to be. A lot of people use HTML generators too. I’m the type of person who needs to know how and why things work. Generators would just frustrate me.

That’s all for now.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top