1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 14:08:29 -04:00

attempted json-ld fixes...

This commit is contained in:
Jake Jarvis 2025-03-31 11:47:17 -04:00
parent 6c32a5ef36
commit a7b50f1b55
Signed by: jake
SSH Key Fingerprint: SHA256:nCkvAjYA6XaSPUqc4TfbBQTpzr8Xj7ritg/sGInCdkc
6 changed files with 26 additions and 13 deletions

View File

@ -26,8 +26,9 @@ const Page = () => {
"@type": "VideoObject", "@type": "VideoObject",
name: metadata.title as string, name: metadata.title as string,
description: metadata.description as string, description: metadata.description as string,
thumbnailUrl: `${BASE_URL}${thumbnail.src}`,
contentUrl: `${BASE_URL}${webm}`, contentUrl: `${BASE_URL}${webm}`,
thumbnailUrl: `${BASE_URL}${thumbnail.src}`,
embedUrl: `${BASE_URL}/birthday`,
uploadDate: "1996-02-06T00:00:00Z", uploadDate: "1996-02-06T00:00:00Z",
duration: "PT6M10S", duration: "PT6M10S",
}} }}

View File

@ -28,8 +28,9 @@ const Page = () => {
"@type": "VideoObject", "@type": "VideoObject",
name: metadata.title as string, name: metadata.title as string,
description: metadata.description as string, description: metadata.description as string,
thumbnailUrl: `${BASE_URL}${thumbnail.src}`,
contentUrl: `${BASE_URL}${webm}`, contentUrl: `${BASE_URL}${webm}`,
thumbnailUrl: `${BASE_URL}${thumbnail.src}`,
embedUrl: `${BASE_URL}/hillary`,
uploadDate: "2016-07-25T00:00:00Z", uploadDate: "2016-07-25T00:00:00Z",
duration: "PT1M51S", duration: "PT1M51S",
}} }}

View File

@ -27,6 +27,7 @@ const RootLayout = ({ children }: Readonly<{ children: React.ReactNode }>) => {
<html lang={config.siteLocale} suppressHydrationWarning> <html lang={config.siteLocale} suppressHydrationWarning>
<head> <head>
<ThemeScript /> <ThemeScript />
<JsonLd<Person> <JsonLd<Person>
item={{ item={{
"@context": "https://schema.org", "@context": "https://schema.org",
@ -34,18 +35,22 @@ const RootLayout = ({ children }: Readonly<{ children: React.ReactNode }>) => {
"@id": `${BASE_URL}/#person`, "@id": `${BASE_URL}/#person`,
name: config.authorName, name: config.authorName,
url: BASE_URL, url: BASE_URL,
image: `${BASE_URL}${ogImage.src}`, image: {
"@type": "ImageObject",
contentUrl: `${BASE_URL}${ogImage.src}`,
width: `${ogImage.width}`,
height: `${ogImage.height}`,
},
sameAs: [ sameAs: [
BASE_URL, BASE_URL,
`https://${config.authorSocial?.mastodon}`,
`https://github.com/${config.authorSocial?.github}`, `https://github.com/${config.authorSocial?.github}`,
`https://keybase.io/${config.authorSocial?.keybase}`, `https://bsky.app/profile/${config.authorSocial?.bluesky}`,
`https://twitter.com/${config.authorSocial?.twitter}`, `https://twitter.com/${config.authorSocial?.twitter}`,
`https://medium.com/@${config.authorSocial?.medium}`, `https://medium.com/@${config.authorSocial?.medium}`,
`https://www.linkedin.com/in/${config.authorSocial?.linkedin}/`, `https://www.linkedin.com/in/${config.authorSocial?.linkedin}/`,
`https://www.facebook.com/${config.authorSocial?.facebook}`, `https://www.facebook.com/${config.authorSocial?.facebook}`,
`https://www.instagram.com/${config.authorSocial?.instagram}/`, `https://www.instagram.com/${config.authorSocial?.instagram}/`,
`https://${config.authorSocial?.mastodon}`,
`https://bsky.app/profile/${config.authorSocial?.bluesky}`,
], ],
}} }}
/> />

View File

@ -28,8 +28,9 @@ const Page = () => {
"@type": "VideoObject", "@type": "VideoObject",
name: metadata.title as string, name: metadata.title as string,
description: metadata.description as string, description: metadata.description as string,
thumbnailUrl: `${BASE_URL}${thumbnail.src}`,
contentUrl: `${BASE_URL}${webm}`, contentUrl: `${BASE_URL}${webm}`,
thumbnailUrl: `${BASE_URL}${thumbnail.src}`,
embedUrl: `${BASE_URL}/leo`,
uploadDate: "2007-05-10T00:00:00Z", uploadDate: "2007-05-10T00:00:00Z",
duration: "PT1M48S", duration: "PT1M48S",
}} }}

View File

@ -10,8 +10,9 @@ import { getSlugs, getFrontMatter } from "../../../lib/helpers/posts";
import { addMetadata } from "../../../lib/helpers/metadata"; import { addMetadata } from "../../../lib/helpers/metadata";
import * as config from "../../../lib/config"; import * as config from "../../../lib/config";
import { BASE_URL, POSTS_DIR } from "../../../lib/config/constants"; import { BASE_URL, POSTS_DIR } from "../../../lib/config/constants";
import { size as ogImageSize } from "./opengraph-image";
import type { Metadata } from "next"; import type { Metadata } from "next";
import type { Article } from "schema-dts"; import type { BlogPosting } from "schema-dts";
import styles from "./page.module.css"; import styles from "./page.module.css";
@ -62,15 +63,20 @@ const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
return ( return (
<> <>
<JsonLd<Article> <JsonLd<BlogPosting>
item={{ item={{
"@context": "https://schema.org", "@context": "https://schema.org",
"@type": "Article", "@type": "BlogPosting",
headline: frontmatter!.title, headline: frontmatter!.title,
description: frontmatter!.description, description: frontmatter!.description,
url: frontmatter!.permalink, url: frontmatter!.permalink,
image: [`${BASE_URL}/${POSTS_DIR}/${frontmatter!.slug}/opengraph-image`], image: {
keywords: frontmatter!.tags, "@type": "ImageObject",
contentUrl: `${BASE_URL}/${POSTS_DIR}/${frontmatter!.slug}/opengraph-image`,
width: `${ogImageSize.width}`,
height: `${ogImageSize.height}`,
},
keywords: frontmatter!.tags?.join(", "),
datePublished: frontmatter!.date, datePublished: frontmatter!.date,
dateModified: frontmatter!.date, dateModified: frontmatter!.date,
inLanguage: config.siteLocale, inLanguage: config.siteLocale,

View File

@ -18,7 +18,6 @@ export const authorSocial = {
github: "jakejarvis", github: "jakejarvis",
twitter: "jakejarvis", twitter: "jakejarvis",
facebook: "jakejarvis", facebook: "jakejarvis",
keybase: "jakejarvis",
medium: "jakejarvis", medium: "jakejarvis",
linkedin: "jakejarvis", linkedin: "jakejarvis",
instagram: "jakejarvis", instagram: "jakejarvis",