Given my weird new blog layout, I thought1 it would be helpful to include a small emoji next to the title for those posts having titles.
What I didn’t want was to include the emoji as part of a post’s Title field. That feels like embedding metadata where it doesn’t belong and it also messes with permalinks.
This site uses Blot, so all I had to do was include a new
field in the template.
Now I can add an “Icon” attribute to any post’s metadata for which I want an icon to show in the title.
Notice I didn’t use “Type” or “Category” as the icon trigger. This way, I can choose any arbitrary icon regardless of the post type. This adds a little maintenance overhead but I like the flexibility.