CONFIG.SYS
  • ALL_POSTS.BAT
  • ABOUT.EXE

50¢ to fix this Blog with Claude - Thu, Apr 10, 2025

Using claude to fix this blog


50¢ to fix this Blog with Claude


I have to admit that I am sometimes a bit frugal. So I was reluctant to invest money in AI tools to fix the following problem with this blog. But surprisingly I found out that Claude was kind enough to only charge me 50 cents to fix it.

The Problem

I’ve been running this blog for some years now using Hugo . And as it is with all software, updates may cause things to no longer work, especially if you’ve deferred updating for a while (as I did). So after updating Hugo to the newest version, the style sheets were no longer applied on all pages.

Since I did not want to spend too much time with the problem (Hugo is just a tool for me), I developed a workaround which would fix the links after the pages had been generated:

find ./docs/categories/ -name 'index.html' -exec sed -i 's|\.\./\.\./retro-blog|\.\./\.\./\.\./retro-blog|g' {} \;
find ./docs/tags/ -name 'index.html' -exec sed -i 's|\.\./\.\./retro-blog|\.\./\.\./\.\./retro-blog|g' {} \;

And to be honest I think this was really an ugly workaround. And the regex wasn’t even my work but was a helpful contribution of the GitHub Copilot.

Testing Claude

As Claude has risen to fame in the last months, I thought I would give it a try as part of me testing its capabilities. So I just started claude in the blogs repository folder and prompted it:

When generating the content with hugo, the generated content's path to the stylesheet is wrong
resulting in the pages not being styled. In order to fix this I have to run the commands: 
find ./docs/categories/ -name 'index.html' -exec sed -i s|\.\./\.\./retro-blog|\.\./\.\./\.\./retro-blog|g' {} \;
find ./docs/tags/ -name 'index.html' -exec sed -i 's|\.\./\.\./retro-blog|\.\./\.\./\.\./retro-blog|g' {} \;

And it started working right away...

The Solution

The solution generated by Claude was actually very simple. Changing from relativeURLs to canonifyURLs in the config.toml file of the blog did the trick:

canonifyURLs = true

The amazing thing here is that the relation between the hugo config file and the generated content isn’t really that obvious. At least not for me as a non-expert. And for the cost:

> /cost 
  ⎿  Total cost:            $0.49
     Total duration (API):  29.8s

These 50 cents were well spent!

Conclusion

This example illustrates the benefits of using AI tools like Claude to solve problems in matters that you are not an expert in.

Back to Home


21st century version | © Thomas Reuhl 2025 | Disclaimer | Built on Hugo

Linkedin GitHub