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
32 changes: 19 additions & 13 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ export default defineConfig({
inlineStylesheets: 'always'
},
experimental: {
clientPrerender: true,
fonts: [
{
provider: fontProviders.google({
experimental: { variableAxis: { Inter: { opsz: ['14..32'] } } }
}),
name: 'Inter',
cssVariable: '--astro-font-inter',
weights: ['300 900'],
styles: ['normal'],
subsets: ['latin']
}
]
clientPrerender: true
},
fonts: [
{
provider: fontProviders.google(),
name: 'Inter',
cssVariable: '--astro-font-inter',
formats: ['woff2'],
styles: ['normal'],
subsets: ['latin'],
weights: ['300 900'],
options: {
experimental: {
variableAxis: {
opsz: ['14..32']
}
}
}
}
],
image: {
remotePatterns: [
{
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"test:unit": "vitest"
},
"dependencies": {
"@astrojs/preact": "^4.1.3",
"@astrojs/vercel": "^9.0.4",
"@astrojs/preact": "^5.0.0",
"@astrojs/vercel": "^10.0.0",
"@libsql/client": "^0.17.2",
"@preact/signals": "^2.8.2",
"@vercel/analytics": "^1.6.1",
"@vercel/speed-insights": "^1.3.1",
"astro": "5.17.2",
"astro": "6.0.3",
"astro-seo-schema": "^5.2.0",
"atropos": "^2.0.2",
"drizzle-orm": "^0.45.1",
Expand All @@ -39,8 +39,8 @@
"valibot": "^1.2.0"
},
"devDependencies": {
"@astrojs/check": "^0.9.6",
"@astrojs/sitemap": "^3.7.0",
"@astrojs/check": "^0.9.7",
"@astrojs/sitemap": "^3.7.1",
"@eslint/js": "^9.39.4",
"@playwright/test": "^1.58.2",
"@tailwindcss/forms": "^0.5.11",
Expand Down
732 changes: 222 additions & 510 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/content.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';

const transcripts = defineCollection({
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/transcripts' }),
});

export const collections = {
transcripts
};
5 changes: 0 additions & 5 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
import { defineCollection } from 'astro:content';
const transcripts = defineCollection({});
export const collections = {
transcripts
};
11 changes: 10 additions & 1 deletion src/lib/optimize-episode-image.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
export async function resolveRedirects(url: string): Promise<string> {
const response = await fetch(url, { method: 'GET', redirect: 'manual' });
if (response.status >= 300 && response.status < 400) {
return response.headers.get('location') ?? url;
}
return url;
}

export async function optimizeImage(
image?: string,
options?: { height?: number; width?: number }
) {
if (image) {
try {
const resolvedImage = await resolveRedirects(image);
const { getImage } = await import('astro:assets');
const optimizedImage = await getImage({
src: image,
src: resolvedImage,
format: 'avif',
height: options?.height ?? 160,
width: options?.width ?? 160,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/[episode].astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { getEntry } from 'astro:content';
import { getEntry, render } from 'astro:content';
import { eq } from 'drizzle-orm';

import { createDb } from '../../db';
Expand Down Expand Up @@ -49,7 +49,7 @@ let Transcript;
if (episode.episodeNumber && episode.episodeNumber !== 'Bonus') {
Transcript = await getEntry('transcripts', episode.episodeNumber);
if (Transcript) {
const { Content } = await Transcript.render();
const { Content } = await render(Transcript);
Transcript = Content;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[episode].html.md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const GET: APIRoute = async ({ props }) => {
let transcriptContent = '';
if (episode.episodeNumber && episode.episodeNumber !== 'Bonus') {
const transcript = await getEntry('transcripts', episode.episodeNumber);
if (transcript) {
if (transcript?.body) {
// Clean the transcript by removing timestamps
transcriptContent = cleanTranscript(transcript.body);
}
Expand Down
Loading