Adding Open Graph meta tags to jameshfisher.com

My blog posts are auto-posted to Facebook, but they look very plain when posted there. Facebook uses Open Graph tags to determine how to display URLs, and my blog was missing these. My hope is that, starting with this post, my auto-posts will look a little more enticing.

I added these Open Graph tags to every page (generated by Jekyll):

<meta property="og:title" content="{{page.title}}"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="{{site.url}}/assets/jim_128.png"/>
<meta property="og:url" content="https://jameshfisher.com{{ page.url }}"/>
<meta property="og:description" content="{{ page.excerpt | strip_html }}"/>
<meta property="og:site_name" content="jameshfisher.com"/>

Apparently og:image tags only work with absolute URLs, not relative ones. This is a bit annoying in combination with Jekyll link, which generates relative URLs. Here’s hoping that Facebook finds the photo of me for this post’s image.

Tagged #blog.

Similar posts

More by Jim

Want to build a fantastic product using LLMs? I work at Granola where we're building the future IDE for knowledge work. Come and work with us! Read more or get in touch!

This page copyright James Fisher 2017. Content is not associated with my employer. Found an error? Edit this page.