update json+ld again

This commit is contained in:
2026-06-28 18:50:53 -05:00
parent 6b6161e5d5
commit b1ce3af34d
4 changed files with 221 additions and 52 deletions
+30 -1
View File
@@ -4,6 +4,7 @@ import '~/assets/css/main.css';
const siteUrl = 'https://jaron.sh';
const personId = `${siteUrl}/#person`;
const websiteId = `${siteUrl}/#website`;
const defaultImage = `${siteUrl}/favicon.png`;
const jsonLd = {
'@context': 'https://schema.org',
@@ -12,12 +13,32 @@ const jsonLd = {
'@type': 'Person',
'@id': personId,
name: 'Jaron Pate',
alternateName: 'jaronpate',
url: siteUrl,
email: 'mailto:yo@jp.wtf',
image: {
'@type': 'ImageObject',
'@id': `${siteUrl}/#person-image`,
url: defaultImage,
caption: 'Jaron Pate',
},
jobTitle: 'Software Engineer',
description:
'Developer. Reformed Rust enjoyer, Golang padawan. Building producst in Austin, Texas.',
disambiguatingDescription:
'Developer. Reformed Rust enjoyer, Golang padawan. Building producst in Austin, Texas.',
givenName: 'Jaron',
familyName: 'Pate',
knowsLanguage: 'en-US',
homeLocation: {
'@type': 'Place',
name: 'Austin, TX',
address: {
'@type': 'PostalAddress',
addressLocality: 'Austin',
addressRegion: 'TX',
addressCountry: 'US',
},
},
sameAs: [
'https://github.com/jaronpate',
@@ -28,15 +49,23 @@ const jsonLd = {
'Frontend development',
'Product engineering',
'Web applications',
'Developer tools',
'Golang',
'Rust',
'TypeScript',
],
mainEntityOfPage: { '@id': websiteId },
},
{
'@type': 'WebSite',
'@id': websiteId,
url: siteUrl,
name: 'Jaron Pate',
description: 'A developer in Austin, TX.',
alternateName: 'jaron.sh',
description:
'Developer. Reformed Rust enjoyer, Golang padawan. Building producst in Austin, Texas.',
inLanguage: 'en-US',
about: { '@id': personId },
author: { '@id': personId },
publisher: { '@id': personId },
},
+55 -23
View File
@@ -9,6 +9,7 @@ import { ref } from 'vue';
const siteUrl = 'https://jaron.sh';
const currentUrl = useRequestURL().href;
const personId = `${siteUrl}/#person`;
const websiteId = `${siteUrl}/#website`;
const webpageId = `${siteUrl}/#homepage`;
useSeoMeta({
@@ -113,29 +114,60 @@ useHead({
type: 'application/ld+json',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'ProfilePage',
'@id': webpageId,
url: siteUrl,
name: "Hey, I'm Jaron.",
description:
'Developer. Reformed Rust enjoyer, Golang padawan.',
inLanguage: 'en-US',
isPartOf: { '@id': `${siteUrl}/#website` },
about: { '@id': personId },
mainEntity: { '@id': personId },
mentions: [
...selectedWorks.map((work) => ({
'@type': 'CreativeWork',
name: work.title,
description: work.description,
url: work.link,
})),
...projects.map((project) => ({
'@type': 'CreativeWork',
name: project.title,
description: project.description,
url: project.href,
})),
'@graph': [
{
'@type': 'ProfilePage',
'@id': webpageId,
url: siteUrl,
name: "Hey, I'm Jaron.",
description:
'Developer. Reformed Rust enjoyer, Golang padawan.',
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
about: { '@id': personId },
mainEntity: { '@id': personId },
primaryImageOfPage: {
'@type': 'ImageObject',
url: `${siteUrl}/favicon.png`,
},
hasPart: [
{ '@id': `${webpageId}#selected-work` },
{ '@id': `${webpageId}#projects` },
],
},
{
'@type': 'ItemList',
'@id': `${webpageId}#selected-work`,
name: 'Selected work',
itemListElement: selectedWorks.map((work, index) => ({
'@type': 'ListItem',
position: index + 1,
item: {
'@type': 'CreativeWork',
name: work.title,
description: work.description,
url: work.link,
creator: { '@id': personId },
},
})),
},
{
'@type': 'ItemList',
'@id': `${webpageId}#projects`,
name: 'Projects',
itemListElement: projects.map((project, index) => ({
'@type': 'ListItem',
position: index + 1,
item: {
'@type': 'SoftwareApplication',
name: project.title,
description: project.description,
url: project.href,
author: { '@id': personId },
applicationCategory: 'DeveloperApplication',
},
})),
},
],
}),
},
+69 -15
View File
@@ -2,7 +2,11 @@
const route = useRoute();
const siteUrl = 'https://jaron.sh';
const personId = `${siteUrl}/#person`;
const websiteId = `${siteUrl}/#website`;
const articleUrl = `${siteUrl}${route.path}`;
const webpageId = `${articleUrl}#webpage`;
const articleId = `${articleUrl}#article`;
const blogId = `${siteUrl}/writing#blog`;
const { data: page } = await useAsyncData(route.path, () => {
return queryCollection('writing')
.path(route.path.replace('/writing/', ''))
@@ -28,21 +32,71 @@ useHead({
type: 'application/ld+json',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'BlogPosting',
'@id': `${articleUrl}#article`,
url: articleUrl,
headline: page.value.title,
description: page.value.description,
datePublished: new Date(page.value.date).toISOString(),
dateModified: new Date(page.value.date).toISOString(),
inLanguage: 'en-US',
isPartOf: { '@id': `${siteUrl}/#website` },
mainEntityOfPage: {
'@type': 'WebPage',
'@id': articleUrl,
},
author: { '@id': personId },
publisher: { '@id': personId },
'@graph': [
{
'@type': 'WebPage',
'@id': webpageId,
url: articleUrl,
name: page.value.title,
description: page.value.description,
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
breadcrumb: { '@id': `${articleUrl}#breadcrumb` },
mainEntity: { '@id': articleId },
},
{
'@type': 'Blog',
'@id': blogId,
url: `${siteUrl}/writing`,
name: 'Jaron Pate Writing',
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
publisher: { '@id': personId },
},
{
'@type': 'BlogPosting',
'@id': articleId,
url: articleUrl,
headline: page.value.title,
description: page.value.description,
datePublished: new Date(page.value.date).toISOString(),
dateModified: new Date(page.value.date).toISOString(),
image: {
'@type': 'ImageObject',
'@id': `${articleUrl}#article-image`,
url: `${siteUrl}/favicon.png`,
},
inLanguage: 'en-US',
isPartOf: { '@id': blogId },
mainEntityOfPage: { '@id': webpageId },
author: { '@id': personId },
publisher: { '@id': personId },
},
{
'@type': 'BreadcrumbList',
'@id': `${articleUrl}#breadcrumb`,
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: siteUrl,
},
{
'@type': 'ListItem',
position: 2,
name: 'Writing',
item: `${siteUrl}/writing`,
},
{
'@type': 'ListItem',
position: 3,
name: page.value.title,
item: articleUrl,
},
],
},
],
}),
},
],
+67 -13
View File
@@ -1,11 +1,14 @@
<script setup lang="ts">
// const { data: pages } = await useAsyncData('writing-pages', () =>
// queryCollection('writing').all(),
// );
const pages: any[] = [];
const { data: pages } = await useAsyncData('writing-pages', () =>
queryCollection('writing').order('date', 'DESC').all(),
);
const siteUrl = 'https://jaron.sh';
const writingUrl = `${siteUrl}/writing`;
const personId = `${siteUrl}/#person`;
const websiteId = `${siteUrl}/#website`;
const collectionId = `${writingUrl}#collection`;
const blogId = `${writingUrl}#blog`;
useSeoMeta({
title: 'Writing',
@@ -24,15 +27,66 @@ useHead({
type: 'application/ld+json',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'CollectionPage',
'@id': `${writingUrl}#collection`,
url: writingUrl,
name: 'Writing',
description:
"Thoughts I've had here and there. Maybe you'll find something helpful or interesting here.",
inLanguage: 'en-US',
isPartOf: { '@id': `${siteUrl}/#website` },
author: { '@id': `${siteUrl}/#person` },
'@graph': [
{
'@type': 'CollectionPage',
'@id': collectionId,
url: writingUrl,
name: 'Writing',
description:
"Thoughts I've had here and there. Maybe you'll find something helpful or interesting here.",
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
author: { '@id': personId },
mainEntity: { '@id': blogId },
breadcrumb: { '@id': `${collectionId}#breadcrumb` },
},
{
'@type': 'Blog',
'@id': blogId,
url: writingUrl,
name: 'Jaron Pate Writing',
description:
"Thoughts I've had here and there. Maybe you'll find something helpful or interesting here.",
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
publisher: { '@id': personId },
blogPost: (pages.value ?? []).map((page) => ({
'@id': `${writingUrl}/${page.path}#article`,
})),
},
{
'@type': 'ItemList',
'@id': `${collectionId}#posts`,
name: 'Writing by Jaron Pate',
itemListElement: (pages.value ?? []).map(
(page, index) => ({
'@type': 'ListItem',
position: index + 1,
url: `${writingUrl}/${page.path}`,
name: page.title,
}),
),
},
{
'@type': 'BreadcrumbList',
'@id': `${collectionId}#breadcrumb`,
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
item: siteUrl,
},
{
'@type': 'ListItem',
position: 2,
name: 'Writing',
item: writingUrl,
},
],
},
],
}),
},
],