Files
folio/app/pages/writing/index.vue
T

128 lines
4.3 KiB
Vue
Raw Normal View History

2026-04-29 23:06:11 -05:00
<script setup lang="ts">
2026-07-30 09:21:34 -05:00
import {
DEFAULT_IMAGE,
SITE_NAME,
SITE_URL,
personId,
websiteId,
} from '~/utils/site';
2026-08-23 09:25:52 -05:00
const { data: pages } = await useAsyncData('writing-pages', async () => {
const all = await queryCollection('writing').order('date', 'DESC').all();
2026-09-10 00:26:59 -05:00
return all.filter((page) => !page.hidden);
2026-08-23 09:25:52 -05:00
});
2026-07-30 09:21:34 -05:00
const writingUrl = `${SITE_URL}/writing`;
2026-06-28 18:50:53 -05:00
const collectionId = `${writingUrl}#collection`;
const blogId = `${writingUrl}#blog`;
2026-07-30 09:21:34 -05:00
const writingTitle = 'Writing';
const writingDescription =
"Thoughts I've had here and there. Maybe you'll find something helpful or interesting here.";
2026-06-22 00:44:50 -05:00
useSeoMeta({
2026-07-30 09:21:34 -05:00
title: writingTitle,
ogTitle: writingTitle,
description: writingDescription,
ogDescription: writingDescription,
ogUrl: writingUrl,
ogType: 'website',
ogImage: DEFAULT_IMAGE,
ogImageAlt: writingTitle,
twitterCard: 'summary',
twitterTitle: writingTitle,
twitterDescription: writingDescription,
twitterImage: DEFAULT_IMAGE,
2026-06-22 00:44:50 -05:00
});
useHead({
2026-07-30 09:21:34 -05:00
link: [{ rel: 'canonical', href: writingUrl }],
2026-06-22 00:44:50 -05:00
script: [
{
key: 'json-ld-writing',
type: 'application/ld+json',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
2026-06-28 18:50:53 -05:00
'@graph': [
{
'@type': 'CollectionPage',
'@id': collectionId,
url: writingUrl,
2026-07-30 09:21:34 -05:00
name: writingTitle,
description: writingDescription,
2026-06-28 18:50:53 -05:00
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
2026-07-30 09:21:34 -05:00
author: {
'@type': 'Person',
'@id': personId,
name: SITE_NAME,
},
2026-06-28 18:50:53 -05:00
mainEntity: { '@id': blogId },
breadcrumb: { '@id': `${collectionId}#breadcrumb` },
},
{
'@type': 'Blog',
'@id': blogId,
url: writingUrl,
name: 'Jaron Pate Writing',
2026-07-30 09:21:34 -05:00
description: writingDescription,
2026-06-28 18:50:53 -05:00
inLanguage: 'en-US',
isPartOf: { '@id': websiteId },
2026-07-30 09:21:34 -05:00
publisher: {
'@type': 'Person',
'@id': personId,
name: SITE_NAME,
},
2026-06-28 18:50:53 -05:00
blogPost: (pages.value ?? []).map((page) => ({
2026-08-22 11:59:33 -05:00
'@id': `${writingUrl}${page.path}#article`,
2026-06-28 18:50:53 -05:00
})),
},
{
'@type': 'ItemList',
'@id': `${collectionId}#posts`,
name: 'Writing by Jaron Pate',
itemListElement: (pages.value ?? []).map(
(page, index) => ({
'@type': 'ListItem',
position: index + 1,
2026-08-22 11:59:33 -05:00
url: `${writingUrl}${page.path}`,
2026-06-28 18:50:53 -05:00
name: page.title,
}),
),
},
{
'@type': 'BreadcrumbList',
'@id': `${collectionId}#breadcrumb`,
itemListElement: [
{
'@type': 'ListItem',
position: 1,
name: 'Home',
2026-07-30 09:21:34 -05:00
item: SITE_URL,
2026-06-28 18:50:53 -05:00
},
{
'@type': 'ListItem',
position: 2,
2026-07-30 09:21:34 -05:00
name: writingTitle,
2026-06-28 18:50:53 -05:00
item: writingUrl,
},
],
},
],
2026-06-22 00:44:50 -05:00
}),
},
],
});
2026-04-29 23:06:11 -05:00
</script>
<template>
2026-08-22 11:59:33 -05:00
<NuxtLayout
name="main"
2026-08-23 22:29:13 -05:00
:title="writingTitle"
:description="writingDescription"
2026-08-22 11:59:33 -05:00
>
<article>
2026-08-22 12:43:00 -05:00
<WritingList :pages="pages ?? []" />
2026-08-22 11:59:33 -05:00
</article>
</NuxtLayout>
2026-04-29 23:06:11 -05:00
</template>