How do I add meta tag image

Hello everyone, I’m trying to add a meta image to my page, but I’m not getting it right. The page is hosted at Cloudfare Pages.

My last experience with meta images was using Github Pages, which I just needed to give an absolute path to the image in the page itself – something like github.io/blabla/my-image.jpg – but trying to do the same with Cloudfare Pages didn’t work.

Could anyone explain me how it works with Cloudfare Pages? Isn’t it possible to refer the image in the project folder itself or I need to host it in an external source?

Hey,

You can do it the same, can you please share the code you’re trying to use?

you mean the repo link? If it’s what you’re asking for, here it is:

Hey,

So the URL you’re currently using results in a 404. Looks like your images folder is going into assets. To view your desktop-preview.jpg file you can access it at /desktop-preview.jpg (https://fm--3-column-card.pages.dev/desktop-preview.jpg)

If you run your build command yarn build locally you can see all the files being uploaded (and where they are) in the dist directory.

4 Likes

oof, I though the build process would automatically throw images in the asset folder based on previous experience… Which I clearly mistook.

Thank you very much for the help!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.