More AI
This commit is contained in:
parent
f3fc893675
commit
bb5b4c4cf3
43 changed files with 585 additions and 524 deletions
|
|
@ -5,9 +5,11 @@ import Page from '../../layouts/Page.astro';
|
|||
import {
|
||||
absoluteUrl,
|
||||
articlePath,
|
||||
buildBreadcrumbJsonLd,
|
||||
buildBreadcrumbTrail,
|
||||
getAllTags,
|
||||
getPublishedPosts,
|
||||
optimizeOgImage,
|
||||
site,
|
||||
yearOf,
|
||||
} from '../../lib/site';
|
||||
|
|
@ -16,6 +18,11 @@ const posts = await getPublishedPosts();
|
|||
const years = [...new Set(posts.map((post) => yearOf(post.data.date)))];
|
||||
const tags = getAllTags(posts);
|
||||
|
||||
const postOgImages = await Promise.all(
|
||||
posts.map((post) => optimizeOgImage(post.data.thumbnail.src))
|
||||
);
|
||||
|
||||
const personId = absoluteUrl('/about/#person');
|
||||
const blogJsonLd = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'Blog',
|
||||
|
|
@ -23,26 +30,20 @@ const blogJsonLd = {
|
|||
url: absoluteUrl('/articles/'),
|
||||
description:
|
||||
'Technical articles and notes about projects, systems, AI deployment, graphics, simulations, and tools.',
|
||||
blogPost: posts.map((post) => ({
|
||||
publisher: { '@id': personId },
|
||||
blogPost: posts.map((post, index) => ({
|
||||
'@type': 'BlogPosting',
|
||||
headline: post.data.title,
|
||||
description: post.data.description,
|
||||
datePublished: post.data.date.toISOString(),
|
||||
url: absoluteUrl(articlePath(post)),
|
||||
author: { '@id': personId },
|
||||
image: absoluteUrl(postOgImages[index].src),
|
||||
keywords: post.data.tags.join(', '),
|
||||
})),
|
||||
};
|
||||
|
||||
const breadcrumbTrail = buildBreadcrumbTrail({ articles: true });
|
||||
const breadcrumbJsonLd = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'BreadcrumbList',
|
||||
itemListElement: breadcrumbTrail.map((crumb, index) => ({
|
||||
'@type': 'ListItem',
|
||||
position: index + 1,
|
||||
name: crumb.name,
|
||||
item: absoluteUrl(crumb.href),
|
||||
})),
|
||||
};
|
||||
const breadcrumbJsonLd = buildBreadcrumbJsonLd(buildBreadcrumbTrail({ articles: true }));
|
||||
|
||||
const jsonLd = [blogJsonLd, breadcrumbJsonLd];
|
||||
---
|
||||
|
|
@ -54,7 +55,7 @@ const jsonLd = [blogJsonLd, breadcrumbJsonLd];
|
|||
>
|
||||
<nav id="tags" class="tag-filter" aria-label="Browse by tag">
|
||||
<span>Browse by tag</span>
|
||||
<TagList tags={tags} labelled={false} />
|
||||
<TagList tags={tags} />
|
||||
</nav>
|
||||
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue