Chapter 4

Troubleshooting

Common issues and solutions

Meta tags not appearing

Check that the meta tags are in your layout’s <head>. View the page source (not browser DevTools) to confirm the tags are present in the raw HTML.

Make sure you’re editing the correct layout file. Middleman uses source/layouts/layout.erb by default, but pages can specify a different layout in frontmatter.

Wrong image showing

Social platforms and OpenGraph+ cache images. If you’ve updated your page but see the old image:

  1. Purge the cached image from the OpenGraph+ dashboard
  2. Wait a few minutes for the new image to render
  3. Clear the platform’s cache using their debugger tools (see below)

ERB not rendering

If you see raw <%= ... %> tags in your page source:

  1. Make sure your file has the .erb extension (e.g., layout.erb, not layout.html)
  2. current_page.url is only available during Middleman’s build process - it won’t work in plain HTML files
  3. Run middleman build and check the output in build/ to verify tags render correctly

Social platforms not updating

Social networks cache images aggressively. After purging from OpenGraph+, use each platform’s debugger to force a refresh:

Purging

To force OpenGraph+ to re-render an image:

  1. Go to your OpenGraph+ dashboard
  2. Navigate to the website’s cache page
  3. Enter the URL and purge

Testing

Use the preview tool in your OpenGraph+ dashboard to test how any page on your site renders as a social card. Paste a URL and see the result immediately.