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:
@@ -22,6 +22,7 @@ import {
|
||||
iconThreads,
|
||||
iconUndo
|
||||
} from '../icons';
|
||||
import { applySeo, resolvedSeoHead, resolveSeo, threadSeoConfig } from '../seo';
|
||||
import {
|
||||
api,
|
||||
threadWebSocketUrl,
|
||||
@@ -158,6 +159,9 @@ const currentThreadList = computed(() => {
|
||||
});
|
||||
});
|
||||
const detailModalOpen = computed(() => activeThread.value !== null);
|
||||
const threadSeo = computed(() => (activeThread.value ? resolveSeo(threadSeoConfig(activeThread.value, t)) : null));
|
||||
|
||||
useHead(() => (threadSeo.value ? resolvedSeoHead(threadSeo.value) : {}));
|
||||
|
||||
const messageGroups = computed<MessageGroup[]>(() => {
|
||||
const groups: MessageGroup[] = [];
|
||||
@@ -826,6 +830,12 @@ watch(activeThreadId, async () => {
|
||||
await loadMessages(true);
|
||||
});
|
||||
|
||||
watch(activeThread, (thread) => {
|
||||
if (thread) {
|
||||
applySeo(threadSeoConfig(thread, t));
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
void loadAll();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user