nomadro/src/modules/social/lib/blog/jsonld.ts
Eric 5271aabc98 Ship social selfie face-check, avatar UX by device, blog/admin, and notify polish.
Add InsightFace/OpenCV challenge upload, PC vs mobile capture branching, and fix avatar persistence into roster/profile pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 14:38:20 +08:00

54 lines
1.5 KiB
TypeScript

import type { BlogPost } from "./types";
const SITE = "https://nomadro.com";
export function blogPostingJsonLd(post: BlogPost) {
return {
"@context": "https://schema.org",
"@type": "BlogPosting",
headline: post.title,
description: post.description,
datePublished: post.date,
dateModified: post.updated || post.date,
inLanguage: post.locale === "zh" ? "zh-CN" : "en-US",
wordCount: post.wordCount,
author: {
"@type": "Organization",
name: post.author || "Nomadro",
url: SITE,
},
publisher: {
"@type": "Organization",
name: "Nomadro",
url: SITE,
logo: {
"@type": "ImageObject",
url: `${SITE}/icon-512.png`,
},
},
mainEntityOfPage: {
"@type": "WebPage",
"@id": `${SITE}/social/blog/${post.slug}`,
},
image: post.cover ? [post.cover.startsWith("http") ? post.cover : `${SITE}${post.cover}`] : undefined,
};
}
export function blogListJsonLd(posts: Array<{ title: string; slug: string; date: string }>) {
return {
"@context": "https://schema.org",
"@type": "Blog",
name: "Nomadro Nomad Blog",
description:
"Field notes for digital nomads: cities, cafés, remote work, and meeting people on the road.",
url: `${SITE}/social/blog`,
publisher: { "@type": "Organization", name: "Nomadro", url: SITE },
blogPost: posts.map((p) => ({
"@type": "BlogPosting",
headline: p.title,
datePublished: p.date,
url: `${SITE}/social/blog/${p.slug}`,
})),
};
}