File tree 11 files changed +14
-14
lines changed
11 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import type { CollectionEntry } from "astro:content";
6
6
export type SearchItem = {
7
7
title : string ;
8
8
description : string ;
9
- data : CollectionEntry < "blog " > [ "data" ] ;
9
+ data : CollectionEntry < "pages " > [ "data" ] ;
10
10
slug : string ;
11
11
} ;
12
12
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import ShareLinks from "@components/ShareLinks.astro";
10
10
import { SITE } from " @config" ;
11
11
12
12
export interface Props {
13
- post: CollectionEntry <" blog " >;
13
+ post: CollectionEntry <" pages " >;
14
14
}
15
15
16
16
const { post } = Astro .props ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { SITE } from "@config";
11
11
export interface Props {
12
12
currentPage: number ;
13
13
totalPages: number ;
14
- paginatedPosts: CollectionEntry <" blog " >[];
14
+ paginatedPosts: CollectionEntry <" pages " >[];
15
15
tag: string ;
16
16
tagName: string ;
17
17
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { generateOgImageForPost } from "@utils/generateOgImages";
4
4
import { slugifyStr } from "@utils/slugify" ;
5
5
6
6
export async function getStaticPaths ( ) {
7
- const posts = await getCollection ( "blog " ) . then ( p =>
7
+ const posts = await getCollection ( "pages " ) . then ( p =>
8
8
p . filter ( ( { data } ) => ! data . draft && ! data . ogImage )
9
9
) ;
10
10
@@ -15,6 +15,6 @@ export async function getStaticPaths() {
15
15
}
16
16
17
17
export const GET : APIRoute = async ( { props } ) =>
18
- new Response ( await generateOgImageForPost ( props as CollectionEntry < "blog " > ) , {
18
+ new Response ( await generateOgImageForPost ( props as CollectionEntry < "pages " > ) , {
19
19
headers : { "Content-Type" : "image/png" } ,
20
20
} ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import getSortedPosts from "@utils/getSortedPosts";
4
4
import { SITE } from "@config" ;
5
5
6
6
export async function GET ( ) {
7
- const posts = await getCollection ( "blog " ) ;
7
+ const posts = await getCollection ( "pages " ) ;
8
8
const sortedPosts = getSortedPosts ( posts ) ;
9
9
return rss ( {
10
10
title : SITE . title ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import SearchBar from "@components/Search";
9
9
import getSortedPosts from " @utils/getSortedPosts" ;
10
10
11
11
// Retrieve all published articles
12
- const posts = await getCollection (" blog " , ({ data }) => ! data .draft );
12
+ const posts = await getCollection (" pages " , ({ data }) => ! data .draft );
13
13
const sortedPosts = getSortedPosts (posts );
14
14
15
15
// List of items to search in
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ import getPageNumbers from "@utils/getPageNumbers";
7
7
import getPagination from " @utils/getPagination" ;
8
8
9
9
export interface Props {
10
- post: CollectionEntry <" blog " >;
10
+ post: CollectionEntry <" pages " >;
11
11
tag: string ;
12
12
tagName: string ;
13
13
}
14
14
15
15
export async function getStaticPaths() {
16
- const posts = await getCollection (" blog " );
16
+ const posts = await getCollection (" pages " );
17
17
18
18
const tags = getUniqueTags (posts );
19
19
@@ -31,7 +31,7 @@ export async function getStaticPaths() {
31
31
const { page } = Astro .params ;
32
32
const { tag, tagName } = Astro .props ;
33
33
34
- const posts = await getCollection (" blog " , ({ data }) => ! data .draft );
34
+ const posts = await getCollection (" pages " , ({ data }) => ! data .draft );
35
35
36
36
const postsByTag = getPostsByTag (posts , tag );
37
37
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import getPagination from "@utils/getPagination";
6
6
import getUniqueTags from " @utils/getUniqueTags" ;
7
7
8
8
export async function getStaticPaths() {
9
- const posts = await getCollection (" blog " );
9
+ const posts = await getCollection (" pages " );
10
10
11
11
const tags = getUniqueTags (posts );
12
12
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Tag from "@components/Tag.astro";
8
8
import getUniqueTags from " @utils/getUniqueTags" ;
9
9
import { SITE } from " @config" ;
10
10
11
- const posts = await getCollection (" blog " );
11
+ const posts = await getCollection (" pages " );
12
12
13
13
let tags = getUniqueTags (posts );
14
14
---
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ function svgBufferToPngBuffer(svg: string) {
48
48
return pngData . asPng ( ) ;
49
49
}
50
50
51
- export async function generateOgImageForPost ( post : CollectionEntry < "blog " > ) {
51
+ export async function generateOgImageForPost ( post : CollectionEntry < "pages " > ) {
52
52
const svg = await satori ( postOgImage ( post ) , options ) ;
53
53
return svgBufferToPngBuffer ( svg ) ;
54
54
}
Original file line number Diff line number Diff line change 1
1
import { SITE } from "@config" ;
2
2
import type { CollectionEntry } from "astro:content" ;
3
3
4
- export default ( post : CollectionEntry < "blog " > ) => {
4
+ export default ( post : CollectionEntry < "pages " > ) => {
5
5
return (
6
6
< div
7
7
style = { {
You can’t perform that action at this time.
0 commit comments