using frontmatter as data in 11ty

I need some help setting a featured image frontmatter parameter. I’ve been trying for hours to get this working and can’t seem to figure it out.

---
title: My post
date: 2020-02-23
published: true
thumb: '/assets/img/img.jpg'
tags:
- Tag 1
- Tag2
---

This is my markdown code. What I’m trying to do on my posts page is show the featured image, but when the code renders the src of the image shows as (unknown). I have been looking through some of the repos for the 11ty starter blogs and a few of them have a lot of custom frontmatter, but I can’t see in any of their files where this is being configured.

I have tried using eleventyComputed which didn’t seem to work. I have also tried using a posts.11tydata.js file in my posts folder which also didn’t do anything. I suspect this might be something easy, but I’ve spent hours looking at it and I’m completely lost at this point.

module.exports = {
layout: 'post',
title: 'Untitled',
eleventyComputed: {
permalink: (data) => `${data.page.fileSlug}/index.html`,
thumb: (data) => {
  if (data.thumb) {
    if (data.thumb.search(/^https?:///) !== -1) {
      return data.thumb;
    }
    return `/assets/img/${data.thumb}`;
  } else {
    return false;
  }
}

}
};

Any help is appreciated!