11---
2- import { getCollection } from ' astro:content' ;
3- import type { CollectionEntry } from ' astro:content' ;
2+ import { getCollection } from " astro:content" ;
3+ import type { CollectionEntry } from " astro:content" ;
44
5- import { ContentPost } from ' @/partials/ContentPost' ;
6- import Base from ' @/templates/Base.astro' ;
7- import { AppConfig } from ' @/utils/AppConfig' ;
8- import { readTags } from ' @/utils/Tag ' ;
9- import { getSimilarPosts } from ' @/utils/TextSimilarity ' ;
10- import { getCommitHistories } from ' @/utils/CommitHistories ' ;
11- import { DormitoryIntroduction } from ' @/utils/StaticPages ' ;
5+ import { ContentPost } from " @/partials/ContentPost" ;
6+ import Base from " @/templates/Base.astro" ;
7+ import { AppConfig } from " @/utils/AppConfig" ;
8+ import { getCommitHistories } from " @/utils/CommitHistories " ;
9+ import { DormitoryIntroduction } from " @/utils/StaticPages " ;
10+ import { readTags } from " @/utils/Tag " ;
11+ import { getSimilarPosts } from " @/utils/TextSimilarity " ;
1212
1313export async function getStaticPaths() {
14- const blogEntries = await getCollection (' posts' , ({ data }) => {
15- return data .draft !== true ;
16- });
14+ const blogEntries = await getCollection (
15+ " posts" ,
16+ ({ data }) => data .draft !== true ,
17+ );
1718 return blogEntries .map ((entry ) => ({
1819 params: { slug: entry .slug },
1920 props: { entry },
@@ -26,22 +27,20 @@ const { Content, headings } = await entry.render();
2627const title = ` ${entry .data .title } - ${AppConfig .site_name } ` ;
2728const tags = await readTags ();
2829
29- const entries = await getCollection (' posts' , ({ data }) => {
30- return data .draft !== true ;
31- });
30+ const entries = await getCollection (" posts" , ({ data }) => data .draft !== true );
3231// 国際交流宿舎の紹介用の特別措置
33- entries .push (DormitoryIntroduction as unknown as CollectionEntry <' posts' >);
32+ entries .push (DormitoryIntroduction as unknown as CollectionEntry <" posts" >);
3433
3534const similars = getSimilarPosts (entry , entries );
3635
3736const filePath = ` src/content/posts/${entry .id } ` ;
3837const histories = await getCommitHistories (filePath );
3938
4039const ogpUrl = entry .data .imgSrc
41- ? new URL (entry .data .imgSrc , ' https://korosuke613.dev/' ).toString ()
40+ ? new URL (entry .data .imgSrc , " https://korosuke613.dev/" ).toString ()
4241 : undefined ;
4342
44- const description = entry .data .description || ' ' ;
43+ const description = entry .data .description || " " ;
4544---
4645
4746<Base
@@ -53,7 +52,7 @@ const description = entry.data.description || '';
5352>
5453 <ContentPost
5554 frontmatter ={ entry }
56- contentCategory ={ ' Posts' }
55+ contentCategory ={ " Posts" }
5756 headings ={ headings }
5857 similars ={ similars }
5958 histories ={ histories }
0 commit comments