Skip to content

Commit 3b0f781

Browse files
author
Matt Welsh
committed
More fixes.
1 parent 2bc610b commit 3b0f781

File tree

11 files changed

+14
-14
lines changed

11 files changed

+14
-14
lines changed

astro/src/components/Search.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { CollectionEntry } from "astro:content";
66
export type SearchItem = {
77
title: string;
88
description: string;
9-
data: CollectionEntry<"blog">["data"];
9+
data: CollectionEntry<"pages">["data"];
1010
slug: string;
1111
};
1212

astro/src/layouts/PostDetails.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ShareLinks from "@components/ShareLinks.astro";
1010
import { SITE } from "@config";
1111
1212
export interface Props {
13-
post: CollectionEntry<"blog">;
13+
post: CollectionEntry<"pages">;
1414
}
1515
1616
const { post } = Astro.props;

astro/src/layouts/TagPosts.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { SITE } from "@config";
1111
export interface Props {
1212
currentPage: number;
1313
totalPages: number;
14-
paginatedPosts: CollectionEntry<"blog">[];
14+
paginatedPosts: CollectionEntry<"pages">[];
1515
tag: string;
1616
tagName: string;
1717
}

astro/src/pages/posts/[slug]/index.png.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { generateOgImageForPost } from "@utils/generateOgImages";
44
import { slugifyStr } from "@utils/slugify";
55

66
export async function getStaticPaths() {
7-
const posts = await getCollection("blog").then(p =>
7+
const posts = await getCollection("pages").then(p =>
88
p.filter(({ data }) => !data.draft && !data.ogImage)
99
);
1010

@@ -15,6 +15,6 @@ export async function getStaticPaths() {
1515
}
1616

1717
export const GET: APIRoute = async ({ props }) =>
18-
new Response(await generateOgImageForPost(props as CollectionEntry<"blog">), {
18+
new Response(await generateOgImageForPost(props as CollectionEntry<"pages">), {
1919
headers: { "Content-Type": "image/png" },
2020
});

astro/src/pages/rss.xml.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import getSortedPosts from "@utils/getSortedPosts";
44
import { SITE } from "@config";
55

66
export async function GET() {
7-
const posts = await getCollection("blog");
7+
const posts = await getCollection("pages");
88
const sortedPosts = getSortedPosts(posts);
99
return rss({
1010
title: SITE.title,

astro/src/pages/search.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SearchBar from "@components/Search";
99
import getSortedPosts from "@utils/getSortedPosts";
1010
1111
// Retrieve all published articles
12-
const posts = await getCollection("blog", ({ data }) => !data.draft);
12+
const posts = await getCollection("pages", ({ data }) => !data.draft);
1313
const sortedPosts = getSortedPosts(posts);
1414
1515
// List of items to search in

astro/src/pages/tags/[tag]/[page].astro

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import getPageNumbers from "@utils/getPageNumbers";
77
import getPagination from "@utils/getPagination";
88
99
export interface Props {
10-
post: CollectionEntry<"blog">;
10+
post: CollectionEntry<"pages">;
1111
tag: string;
1212
tagName: string;
1313
}
1414
1515
export async function getStaticPaths() {
16-
const posts = await getCollection("blog");
16+
const posts = await getCollection("pages");
1717
1818
const tags = getUniqueTags(posts);
1919
@@ -31,7 +31,7 @@ export async function getStaticPaths() {
3131
const { page } = Astro.params;
3232
const { tag, tagName } = Astro.props;
3333
34-
const posts = await getCollection("blog", ({ data }) => !data.draft);
34+
const posts = await getCollection("pages", ({ data }) => !data.draft);
3535
3636
const postsByTag = getPostsByTag(posts, tag);
3737

astro/src/pages/tags/[tag]/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import getPagination from "@utils/getPagination";
66
import getUniqueTags from "@utils/getUniqueTags";
77
88
export async function getStaticPaths() {
9-
const posts = await getCollection("blog");
9+
const posts = await getCollection("pages");
1010
1111
const tags = getUniqueTags(posts);
1212

astro/src/pages/tags/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Tag from "@components/Tag.astro";
88
import getUniqueTags from "@utils/getUniqueTags";
99
import { SITE } from "@config";
1010
11-
const posts = await getCollection("blog");
11+
const posts = await getCollection("pages");
1212
1313
let tags = getUniqueTags(posts);
1414
---

astro/src/utils/generateOgImages.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function svgBufferToPngBuffer(svg: string) {
4848
return pngData.asPng();
4949
}
5050

51-
export async function generateOgImageForPost(post: CollectionEntry<"blog">) {
51+
export async function generateOgImageForPost(post: CollectionEntry<"pages">) {
5252
const svg = await satori(postOgImage(post), options);
5353
return svgBufferToPngBuffer(svg);
5454
}

astro/src/utils/og-templates/post.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SITE } from "@config";
22
import type { CollectionEntry } from "astro:content";
33

4-
export default (post: CollectionEntry<"blog">) => {
4+
export default (post: CollectionEntry<"pages">) => {
55
return (
66
<div
77
style={{

0 commit comments

Comments
 (0)