consolidate title and description vars

This commit is contained in:
2026-08-23 22:29:13 -05:00
parent c0027e98d3
commit ed5aa637ad
5 changed files with 31 additions and 27 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ definePageMeta({
<template>
<NuxtLayout name="main"
title="Hey, I'm Jaron"
description="I build software for a living, but also other things">
:description="DEFAULT_DESCRIPTION">
<article>
<h3>Selected Work</h3>
<template v-for="work in selectedWorks" :key="work.title">
+7 -7
View File
@@ -59,7 +59,9 @@ if (!data.value) {
const page = computed(() => data.value?.project ?? null);
const isFolder = computed(() => data.value?.kind === 'folder');
const projectTitle = page.value?.title ?? folderName.value;
const projectDescription = page.value?.description ?? '';
const projectDescription = page.value
? page.value.description
: `Projects from ${folderName.value}`;
const liveHref = computed(() => page.value?.href ?? '');
const ogImage = projectOgImage(
page.value?.image,
@@ -70,15 +72,15 @@ const ogImage = projectOgImage(
useSeoMeta({
title: projectTitle,
ogTitle: projectTitle,
description: projectDescription || projectTitle,
ogDescription: projectDescription || projectTitle,
description: projectDescription,
ogDescription: projectDescription,
ogUrl: pageUrl,
ogType: isFolder.value ? 'website' : 'article',
ogImage,
ogImageAlt: projectTitle,
twitterCard: 'summary',
twitterTitle: projectTitle,
twitterDescription: projectDescription || projectTitle,
twitterDescription: projectDescription,
twitterImage: ogImage,
});
@@ -170,9 +172,7 @@ definePageMeta({
<NuxtLayout
name="main"
:title="page ? page.title : folderName"
:description="
page ? page.description : `Projects from ${folderName}`
"
:description="projectDescription"
>
<article v-if="page">
<div class="article-body">
+3 -3
View File
@@ -18,7 +18,7 @@ const collectionId = `${projectsUrl}#collection`;
const listId = `${projectsUrl}#list`;
const projectsTitle = 'Projects';
const projectsDescription =
"Things I've made. Some for work, some because I wanted them to exist.";
"Things I've made which you may find of some interest.";
useSeoMeta({
title: projectsTitle,
@@ -111,8 +111,8 @@ definePageMeta({
<template>
<NuxtLayout
name="main"
title="Projects"
description="Things I've made which you may find of some interest."
:title="projectsTitle"
:description="projectsDescription"
>
<article>
<ProjectList :pages="pages ?? []" />
+18 -14
View File
@@ -54,20 +54,33 @@ if (!data.value) {
const page = computed(() => data.value?.article ?? null);
const isFolder = computed(() => data.value?.kind === 'folder');
const articleTitle = page.value?.title ?? folderName.value;
const articleDescription = page.value?.description ?? '';
const formatDate = (date: Date | string) => {
return new Date(date).toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric',
timeZone: 'UTC',
});
};
const articleDescription = page.value
? page.value.description
: `Writing from ${folderName.value}`;
const layoutDescription = page.value
? formatDate(page.value.date)
: articleDescription;
useSeoMeta({
title: articleTitle,
ogTitle: articleTitle,
description: articleDescription || articleTitle,
ogDescription: articleDescription || articleTitle,
description: articleDescription,
ogDescription: articleDescription,
ogUrl: articleUrl,
ogType: isFolder.value ? 'website' : 'article',
ogImage: DEFAULT_IMAGE,
ogImageAlt: articleTitle,
twitterCard: 'summary',
twitterTitle: articleTitle,
twitterDescription: articleDescription || articleTitle,
twitterDescription: articleDescription,
twitterImage: DEFAULT_IMAGE,
articlePublishedTime: page.value
? new Date(page.value.date).toISOString()
@@ -175,15 +188,6 @@ useHead({
: [],
});
const formatDate = (date: Date | string) => {
return new Date(date).toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric',
timeZone: 'UTC',
});
};
definePageMeta({
layout: false,
});
@@ -193,7 +197,7 @@ definePageMeta({
<NuxtLayout
name="main"
:title="page ? page.title : folderName"
:description="page ? formatDate(page.date) : `Writing from ${folderName}`"
:description="layoutDescription"
>
<article v-if="page">
<div class="article-body">
+2 -2
View File
@@ -121,8 +121,8 @@ definePageMeta({
<template>
<NuxtLayout
name="main"
title="Writing"
description="Thoughts I've had here and there. Maybe you'll find something helpful or interesting here."
:title="writingTitle"
:description="writingDescription"
>
<article>
<WritingList :pages="pages ?? []" />