mirror of
https://github.com/jaronpate/folio.git
synced 2026-10-18 17:06:56 +00:00
added json-ld
This commit is contained in:
+50
@@ -6,8 +6,58 @@ TODO:
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import '~/assets/css/main.css';
|
import '~/assets/css/main.css';
|
||||||
|
|
||||||
|
const siteUrl = 'https://jaron.sh';
|
||||||
|
const personId = `${siteUrl}/#person`;
|
||||||
|
const websiteId = `${siteUrl}/#website`;
|
||||||
|
|
||||||
|
const jsonLd = {
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@graph': [
|
||||||
|
{
|
||||||
|
'@type': 'Person',
|
||||||
|
'@id': personId,
|
||||||
|
name: 'Jaron Pate',
|
||||||
|
url: siteUrl,
|
||||||
|
email: 'mailto:yo@jp.wtf',
|
||||||
|
jobTitle: 'Software Engineer',
|
||||||
|
homeLocation: {
|
||||||
|
'@type': 'Place',
|
||||||
|
name: 'Austin, TX',
|
||||||
|
},
|
||||||
|
sameAs: [
|
||||||
|
'https://github.com/jaronpate',
|
||||||
|
'https://www.linkedin.com/in/jaronp/',
|
||||||
|
],
|
||||||
|
knowsAbout: [
|
||||||
|
'Software engineering',
|
||||||
|
'Frontend development',
|
||||||
|
'Product engineering',
|
||||||
|
'Web applications',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'@type': 'WebSite',
|
||||||
|
'@id': websiteId,
|
||||||
|
url: siteUrl,
|
||||||
|
name: 'Jaron Pate',
|
||||||
|
description:
|
||||||
|
'Personal site and portfolio for Jaron Pate, a software engineer in Austin, TX.',
|
||||||
|
inLanguage: 'en-US',
|
||||||
|
author: { '@id': personId },
|
||||||
|
publisher: { '@id': personId },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
link: [{ rel: 'icon', type: 'image/png', href: '/favicon.png' }],
|
link: [{ rel: 'icon', type: 'image/png', href: '/favicon.png' }],
|
||||||
|
script: [
|
||||||
|
{
|
||||||
|
key: 'json-ld-site',
|
||||||
|
type: 'application/ld+json',
|
||||||
|
innerHTML: JSON.stringify(jsonLd),
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
|
|||||||
+58
-1
@@ -6,6 +6,11 @@ let sectionsRevealed = false;
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
const siteUrl = 'https://jaron.sh';
|
||||||
|
const currentUrl = useRequestURL().href;
|
||||||
|
const personId = `${siteUrl}/#person`;
|
||||||
|
const webpageId = `${siteUrl}/#homepage`;
|
||||||
|
|
||||||
useSeoMeta({
|
useSeoMeta({
|
||||||
title: "Hey, I'm Jaron.",
|
title: "Hey, I'm Jaron.",
|
||||||
ogTitle: "Hey, I'm Jaron.",
|
ogTitle: "Hey, I'm Jaron.",
|
||||||
@@ -13,7 +18,7 @@ useSeoMeta({
|
|||||||
'Software Engineer. I build things to solve problems from the ground up.',
|
'Software Engineer. I build things to solve problems from the ground up.',
|
||||||
ogDescription:
|
ogDescription:
|
||||||
'Software Engineer. I build things to solve problems from the ground up.',
|
'Software Engineer. I build things to solve problems from the ground up.',
|
||||||
ogUrl: useRequestURL().href,
|
ogUrl: currentUrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
const titles = [
|
const titles = [
|
||||||
@@ -103,6 +108,58 @@ const projects = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
script: [
|
||||||
|
{
|
||||||
|
key: 'json-ld-homepage',
|
||||||
|
type: 'application/ld+json',
|
||||||
|
innerHTML: JSON.stringify({
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'ProfilePage',
|
||||||
|
'@id': webpageId,
|
||||||
|
url: siteUrl,
|
||||||
|
name: "Hey, I'm Jaron.",
|
||||||
|
description:
|
||||||
|
'Software Engineer. I build things to solve problems from the ground up.',
|
||||||
|
inLanguage: 'en-US',
|
||||||
|
isPartOf: { '@id': `${siteUrl}/#website` },
|
||||||
|
about: { '@id': personId },
|
||||||
|
mainEntity: { '@id': personId },
|
||||||
|
hasPart: [
|
||||||
|
{
|
||||||
|
'@type': 'ItemList',
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'@type': 'ItemList',
|
||||||
|
name: 'Projects',
|
||||||
|
itemListElement: projects.map((project, index) => ({
|
||||||
|
'@type': 'ListItem',
|
||||||
|
position: index + 1,
|
||||||
|
item: {
|
||||||
|
'@type': 'CreativeWork',
|
||||||
|
name: project.title,
|
||||||
|
description: project.description,
|
||||||
|
url: project.href,
|
||||||
|
},
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
const photos = [
|
const photos = [
|
||||||
{
|
{
|
||||||
src: '/photography/athens_red_scooter.jpg',
|
src: '/photography/athens_red_scooter.jpg',
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const siteUrl = 'https://jaron.sh';
|
||||||
|
const personId = `${siteUrl}/#person`;
|
||||||
|
const articleUrl = `${siteUrl}${route.path}`;
|
||||||
const { data: page } = await useAsyncData(route.path, () => {
|
const { data: page } = await useAsyncData(route.path, () => {
|
||||||
return queryCollection('writing')
|
return queryCollection('writing')
|
||||||
.path(route.path.replace('/writing/', ''))
|
.path(route.path.replace('/writing/', ''))
|
||||||
@@ -18,6 +21,33 @@ useSeoMeta({
|
|||||||
ogUrl: useRequestURL().href,
|
ogUrl: useRequestURL().href,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
script: [
|
||||||
|
{
|
||||||
|
key: 'json-ld-article',
|
||||||
|
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 },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: false,
|
layout: false,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,6 +4,40 @@
|
|||||||
// );
|
// );
|
||||||
const pages: any[] = [];
|
const pages: any[] = [];
|
||||||
|
|
||||||
|
const siteUrl = 'https://jaron.sh';
|
||||||
|
const writingUrl = `${siteUrl}/writing`;
|
||||||
|
|
||||||
|
useSeoMeta({
|
||||||
|
title: 'Writing',
|
||||||
|
ogTitle: 'Writing',
|
||||||
|
description:
|
||||||
|
"Thoughts I've had here and there. Maybe you'll find something helpful or interesting here.",
|
||||||
|
ogDescription:
|
||||||
|
"Thoughts I've had here and there. Maybe you'll find something helpful or interesting here.",
|
||||||
|
ogUrl: useRequestURL().href,
|
||||||
|
});
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
script: [
|
||||||
|
{
|
||||||
|
key: 'json-ld-writing',
|
||||||
|
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` },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
const formatDate = (dateString: string) => {
|
const formatDate = (dateString: string) => {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
// ex. May 5, 2026
|
// ex. May 5, 2026
|
||||||
|
|||||||
Reference in New Issue
Block a user