Sesam.hu — Engineering Manager & Trail Runner

Sesam.hu

Personal blog by Péter Szilágyi — Engineering Manager and trail runner based in Stockholm.
Writing on leadership, running, and life in the north.

English

Lovable: Day 3

💾 Uploading images

I didn't mention it yesterday, but I actually started Day 2 by writing the post about Day 1, and now, on Day 4, I'm summarizing Day 3.

Because the previous post was supposed to have an image too, I had to find a solution to upload image files to the bucket and add them to the relevant tables in the database. Hence the birth of the first admin page—with access control—that lets me upload images linked to posts. With the correct prompt, Lovable created a nice-looking and, more importantly, fully functional upload form with all the bells and whistles expected.

🗂️ Metadata

At this time my attention was brought to the fact that the social links in the footer are actually only placeholders. So I added a metadata file to collect not only these URLs in one place but also blog-related metadata such as title, description, etc. The agent recommended using the React Helmet library to inject meta tags, so I went with that.

🏗️ Importing more posts

The rest of the day I spent with importing posts in batches of 10 and fixing the issues as they came. I had Lovable make a script that goes through my migration folder and imports the Markdown files one by one. Of course each batch provided new quirks to fix.

As a poor choice on my part the posts I wrote for Jekyll only contained the date of the post in the front matter, not the time, so I had the importer default them to noon. However, the older posts, imported from WordPress, did have proper timestamps as well so the import script needed to handle those as well. Fortunately there are only a handful of posts missing time information.

A little fix needed to be added to the regular expression matching images because it did not handle <figure> tags with attributes.

Some tags had ampersand escaped as &amp;, these were converted back to proper characters.

Another small improvement was to handle posts with no tags, since the script initially passed the empty array [] as a tag if none were present.

Finally the importer had to handle posts where the title itself was in quotes, resulting in the front matter employing double quotes.

In the grand tradition of making my own life harder, some posts had emoji in their title, sometimes even only that. Fortunately, after asking, Lovable handled this in the script very well. I expected it to be more complicated. The only issue came with displaying the emoji, because the agent fell back to its original 'let's put duplicate code in two separate files' approach:

Screenshot of a chat with the Lovable agent
A Lovely chat

The following batches put up new challenges. For one, in some posts I used incorrect Markdown syntax and just added image captions as a line of text after the linked image, an extremely sloppy choice on my part. Also, the posts imported from WordPress retained the WP [caption] syntax, which also needed to be cared of. And finally, video embeds were done via various shortcodes, such as the Advanced Responsive Video Embedder (ARVE) plugin for WordPress.

I decided to untangle this mess by asking for a cleaner script to standardise the Markdown files before importing. This time⏤because I ran out of Cursor credits⏤I went for GPT-5. (The Mac app actually very neatly integrates with Cursor now.) The import process now looks like running the cleaning script on the folder, then running the batch importer, and finally checking the imported posts for issues.

Once I am reasonably satisfied with the stability of the imports, I'll just let the scripts run on the whole archives, all 2000+ posts.

Comments