Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
pull_request:
branches:
- main
schedule:
# Run at 6 AM UTC every Monday
- cron: '0 6 * * 1'

jobs:
analyze:
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"gomodule",
"GSAP",
"hocho",
"htmlcsstoimage",
"Hudi",
"interrobang",
"izakaya",
Expand Down Expand Up @@ -121,6 +122,7 @@
"Veeam",
"vercel",
"virt",
"vite",
"vmax",
"vtbot",
"WHATWG",
Expand Down
21 changes: 21 additions & 0 deletions _TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,27 @@ Allows any Mastodon instance to discover your Mastodon profile directly from you
</body>
```

## Refactor social neworks in Authors collection to Contact collection format

The contact data collection uses an array of social networks, with keys:

```
{
network: z.string(),
name: z.string(),
url: z.string().url(),
order: z.number(),
}
```

The authors collection is using named entries under a "social" property, like "twitter", "github", etc. This task is to refactor that to use an array like contact data collection. We also need to add a color for the social network icon, or some other approach to setting the color of it while enabling theming.

We should also make sure the avatar key in the authors collection is being output as a responsive image tag.

## Add Google Maps screenshot (or maps embed) to Contact Page

src/assets/images/map.webp

## Display a system font until font files load (Lighthouse improvements)

Display a system font until font files load to improve FCP (First Contentful Paint) with `font-display: swap`. Need to make sure that web font doesn't render larger or smaller than the system font fallback to avoid CLS (Cumulative Layout Shift) issues.
Expand Down
Binary file removed public/assets/images/placeholder-article.jpg
Binary file not shown.
Binary file removed src/assets/images/typescript-panel.avif
Binary file not shown.
26 changes: 21 additions & 5 deletions src/components/Carousel/client/__fixtures__/collection.fixture.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
import type { ImageMetadata } from 'astro'

const createCover = (src: string, format: ImageMetadata['format'] = 'jpeg'): ImageMetadata => ({
src,
width: 1200,
height: 675,
format,
})

const sampleCollection = [
{
id: 'article-one',
data: {
title: 'Article One',
description: 'First test entry',
publishDate: '2024-01-01',
publishDate: new Date('2024-01-01'),
featured: true,
icon: '/icons/one.svg',
cover: createCover('/_astro/article-one.jpg'),
coverAlt: 'Cover image for Article One',
},
},
{
id: 'article-two',
data: {
title: 'Article Two',
description: 'Second test entry',
publishDate: '2024-02-01',
publishDate: new Date('2024-02-01'),
featured: true,
cover: createCover('/_astro/article-two.jpg'),
coverAlt: 'Cover image for Article Two',
},
},
{
id: 'article-three',
data: {
title: 'Article Three',
description: 'Third test entry',
publishDate: '2024-03-01',
publishDate: new Date('2024-03-01'),
featured: false,
cover: createCover('/_astro/article-three.jpg'),
coverAlt: 'Cover image for Article Three',
},
},
{
id: 'article-four',
data: {
title: 'Article Four',
description: 'Fourth test entry',
publishDate: '2024-04-01',
publishDate: new Date('2024-04-01'),
featured: false,
cover: createCover('/_astro/article-four.jpg'),
coverAlt: 'Cover image for Article Four',
},
},
]
Expand Down
3 changes: 2 additions & 1 deletion src/components/Carousel/client/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ describe('Carousel component (server output)', () => {
const cardWithIcon = root.querySelector('[data-carousel-slide] img')

expect(cardWithIcon).toBeTruthy()
expect(cardWithIcon?.getAttribute('src')).toBe('/icons/one.svg')
expect(cardWithIcon?.getAttribute('src')).toMatch(/^\/_image\?href=/)
expect(cardWithIcon?.getAttribute('alt')).toBe('Cover image for Article One')
})
})

Expand Down
24 changes: 18 additions & 6 deletions src/components/Carousel/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
// Generic Carousel component for displaying content - both featured and suggested
/**
* Generic Carousel component for displaying content - both featured and suggested
*/
import { Picture } from 'astro:assets'
import { getCollection } from 'astro:content'

import {
type CollectionSlug,
type CarouselVariant,
Expand Down Expand Up @@ -52,11 +56,19 @@ const items = prepareItems(allItems, variant, currentSlug, limit)
href={`/${type}/${item.id}`}
class="block h-full bg-bg rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden border border-border hover:border-primary transform hover:-translate-y-2"
>
{'icon' in item.data && item.data.icon && (
<div class="p-6 pb-4">
<div class="w-12 h-12 bg-bg-offset rounded-lg flex items-center justify-center group-hover:bg-primary group-hover:bg-opacity-20 transition-colors">
<img src={item.data.icon} alt="" loading="lazy" class="w-6 h-6" />
</div>
{item.data.cover && (
<div class="relative aspect-video overflow-hidden">
<Picture
src={item.data.cover}
alt={item.data.coverAlt}
widths={[320, 640, 960, 1280]}
sizes="(min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw"
formats={['avif', 'webp', 'jpeg']}
layout="constrained"
fit="cover"
position="center"
class="absolute inset-0 h-full w-full"
/>
</div>
)}
<div class="p-6 pt-2">
Expand Down
Loading
Loading