February 17, 2019

Post icons

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.

Template codeTemplate code

Now I can add an Icon” attribute to any post’s metadata for which I want an icon to show in the title.

Post metadataPost metadata

And voilà!

List of postsList of posts

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.


  1. By I thought” I mean stole from Kevin


meta


Previous post
Team Human by Douglas Rushkoff My rating: 3 of 5 stars I like Douglas Rushkoff’s ideas around civilization and human-ness. I agree with him in
Next post
After a week using Gus Mueller’s Retrobatch I’ve purchased a license. I’ve been using it several times a day