I have a blog built with Django on the server and Sveltekit on the frontend.
When I share a link to a blog post to Twitter, the link preview renders properly with the blog's image and title.
But when I share on Facebook or Whatsapp, it does not render. It was working before and I didn't touch the codebase, but I just noticed it does not work on Facebook and Whatsapp anymore. So it seems to have just broken.
this is my app.html -
In my blog's detail page I have this -
{post ? `${data.title} | RxJourney` : 'RxJourney'}
this is my +page.js -
export async function load({ fetch, params }) {
const { slug } = params;
try {
const response = await fetch(`https://mydomainserver/home/posts/${slug}/`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
credentials: 'include',
});
if (!response.ok) {
throw new Error('Failed to fetch post');
}
const post = await response.json();
return { post };
} catch (error) {
console.error('Error fetching post:', error);
return { post: null };
}
}
What exactly am I doing wrong?