File tree Expand file tree Collapse file tree 5 files changed +15
-2
lines changed
contents/articles/2025/03-24_joint-welcome-session Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ title : 合同新歓を開催します
3+ image : ./thumbnail.png
4+ description : 東大エンジニア系サークル合同新歓を開催します
5+ categories :
6+ - event
7+ author : ykobayashi
8+ date : 2025-03-24
9+ ---
10+
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const url = Astro.url.href;
2121/>
2222<meta property =" og:site_name" content =" ut.code();" />
2323<meta property =" og:title" content ={ title } />
24+ { description && <meta property = " og:description" content = { description } />}
2425<meta property =" og:image" content ={ image .src } />
2526<meta property =" og:url" content ={ url } />
2627<meta property =" og:locale" content =" ja_JP" />
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export async function getStaticPaths() {
1717const { article } = Astro .props ;
1818const { Content } = await render (article );
1919const author =
20- article .data .author && (await getEntry (" members" , article .data .author ? .id ));
20+ article .data .author && (await getEntry (" members" , article .data .author .id ));
2121if (article .data .author && ! author )
2222 throw new Error (
2323 ` Author not found for article ${article .id }, searched for author ${article .data .author .id } ` ,
@@ -26,7 +26,8 @@ if (article.data.author && !author)
2626
2727<GlobalLayout
2828 title ={ article .data .title }
29- description =" ut.code(); のウェブサイトに書かれた記事のひとつです。"
29+ description ={ article .data .description ||
30+ " ut.code(); のウェブサイトに書かれた記事のひとつです。" }
3031 focus ={ Focus .articles }
3132 image ={ article .data .image }
3233>
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const CreateArticleSchema = ({ image }: { image: ImageFunction }) =>
1212 . date ( )
1313 . transform ( ( date ) => new TZDate ( date ) . withTimeZone ( "Asia/Tokyo" ) ) ,
1414 title : z . string ( ) . nullable ( ) ,
15+ description : z . string ( ) . optional ( ) , // og:description に使われます
1516 image : image ( ) ,
1617 categories : z . array ( z . string ( ) ) . optional ( ) ,
1718 author : reference ( "members" ) . optional ( ) ,
You can’t perform that action at this time.
0 commit comments