feat(threads): add SEO metadata, sitemap, and structured data

Include /threads in sitemap and set canonical paths
Generate DiscussionForumPosting structured data for thread details
Add dynamic SEO updates for thread navigation and server-side rendering
This commit is contained in:
2026-05-07 13:46:08 +08:00
parent 520d988589
commit 4a7309027a
8 changed files with 92 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { resolvedSeoHead, resolveSeo, type SeoConfig } from '../src/seo';
import { resolvedSeoHead, resolveSeo, threadSeoConfig, type SeoConfig } from '../src/seo';
import { api } from '../src/services/api';
export default defineNuxtPlugin(async () => {
@@ -68,6 +68,11 @@ async function detailSeo(
image: recipe.item.image?.url
};
}
if (routeName === 'thread-detail') {
const thread = await api.thread(routeId);
return threadSeoConfig(thread, t);
}
} catch {
return null;
}