1 hour ago · Tech · hide · 0 comments

The problem Yesterday my Knuth check post spent some time on the Hacker News front page. The submitter left off the trailing slash, and no images were displayed. It took me a bit of time to fix the problem, and in the end I did two different things: The solution First, I tried doing a redirect from slashless to trailing slash using bunny.net’s Edge rules, but couldn’t get it to work. How do you express “has no trailing slash” when all you seem to have are wildcards? I abandoned that idea for the moment. Second, I fixed my Hugo markdown image render hook, so that the img tag always uses a full path in its src attribute. I achieved this using the page bundle resource instead of the pure .Destination. At first I wanted to completely remove the hook, because I don’t really need it anymore, but that alone did not help, which surprised me. Hugo is a beast, and it doesn’t help that you find comments on the community forum that you should really put all your images into assets/, not the page…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.