[dyad] Added schema display tab - wrote 3 file(s)

This commit is contained in:
[dyad]
2026-01-20 14:48:47 +01:00
parent fe9f3adc7e
commit be6a3a24ec
3 changed files with 69 additions and 0 deletions

View File

@@ -57,12 +57,15 @@ export async function extractMetaData(url: string, keyword?: string) {
const image = $('meta[property="og:image"]').attr("content") || null;
const faqData: FaqItem[] = [];
const schemaData: any[] = [];
$('script[type="application/ld+json"]').each((i, el) => {
const jsonContent = $(el).html();
if (!jsonContent) return;
try {
const data = JSON.parse(jsonContent);
schemaData.push(data);
const graph = data["@graph"] || [data];
for (const item of graph) {
@@ -171,6 +174,7 @@ export async function extractMetaData(url: string, keyword?: string) {
description,
image,
faq: faqData.length > 0 ? faqData : null,
schema: schemaData.length > 0 ? schemaData : null,
headlines: headlines.length > 0 ? headlines : null,
keyword: trimmedKeyword || null,
keywordCount,