[dyad] Added H1 tag extraction - wrote 3 file(s)

This commit is contained in:
[dyad]
2026-01-20 13:44:56 +01:00
parent 677d7fdb53
commit cade4009dc
3 changed files with 67 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ export async function extractMetaData(url: string) {
$('meta[name="description"]').attr("content") ||
"No description found";
const image = $('meta[property="og:image"]').attr("content") || null;
const h1 = $('h1').first().text().trim() || "No H1 found";
const faqData: FaqItem[] = [];
$('script[type="application/ld+json"]').each((i, el) => {
@@ -78,6 +79,7 @@ export async function extractMetaData(url: string) {
title,
description,
image,
h1,
faq: faqData.length > 0 ? faqData : null,
},
};