diff --git a/contents/articles/2024/11-26_komaba-festival/index.mdx b/contents/articles/2024/11-26_komaba-festival/index.mdx index ff69e739..858139dc 100644 --- a/contents/articles/2024/11-26_komaba-festival/index.mdx +++ b/contents/articles/2024/11-26_komaba-festival/index.mdx @@ -5,6 +5,7 @@ categories: - events image: ./image1.jpg author: kmanabe +position: top --- ut.code(); は、2024 年 11 月 22 〜 24 日の合計 3 日間駒場祭に企画を出展しました。今回も多くの方にお越しいただきました。3 日間を通して来場してくださった皆様、ありがとうございました! diff --git a/contents/articles/2024/12-21_kick-off-party-report/index.mdx b/contents/articles/2024/12-21_kick-off-party-report/index.mdx index b73dfbbb..19987d17 100644 --- a/contents/articles/2024/12-21_kick-off-party-report/index.mdx +++ b/contents/articles/2024/12-21_kick-off-party-report/index.mdx @@ -5,6 +5,8 @@ categories: - events image: ./image.jpg author: snakamura +fit: contain +bg_color: "#00693E" --- ut.code(); では 2024 年 12 月 21 日にプロジェクト発足会を行いました。 diff --git a/contents/articles/2025/03-24_joint-welcome-session/index.md b/contents/articles/2025/03-24_joint-welcome-session/index.md index 406136c1..0245be53 100644 --- a/contents/articles/2025/03-24_joint-welcome-session/index.md +++ b/contents/articles/2025/03-24_joint-welcome-session/index.md @@ -2,9 +2,11 @@ title: 東大エンジニア系サークル合同新歓を開催します image: ./thumbnail.png categories: -- event + - event author: ykobayashi date: 2025-03-24 +fit: contain +bg_color: "#A5FFD3" --- ## 📌 イベント概要 diff --git a/contents/articles/README.md b/contents/articles/README.md new file mode 100644 index 00000000..d1f7a8a4 --- /dev/null +++ b/contents/articles/README.md @@ -0,0 +1,36 @@ +# 記事ページ + +## frontmatter + +### base + +- title: string + - 記事タイトル。 + +- date: Date + - **記事を書いた**日。 + +- author: string & keyof Member + - 著者。 + +- categories: string[] + - 何なんだろうね。 + +### image 系 + +- image: path + - タイトル画像。記事一覧とトップで使うよ。 + - 縦横比 3:5 に crop されるよ。 + +- fit?: "cover" | "contain" | fill" | "none" = "cover" + - `object-fit` + - Astro のビルド段階で Sharp に渡されるよ。 + - + +- position?: "center" | "left" | "right" | "top" | "bottom" + - `object-position` + - Astro のビルド段階で Sharp に渡されるよ。 + +- bg_color?: string + - ロード中や画像の漏れたところに見せる背景色。 + - 設定しないと DaisyUI の `skeleton` を使うよ。 diff --git a/src/components/ArticleList.astro b/src/components/ArticleList.astro index e9e4256d..61f4f19a 100644 --- a/src/components/ArticleList.astro +++ b/src/components/ArticleList.astro @@ -52,6 +52,15 @@ const articlesWithExcerpts = await Promise.all( { articlesWithExcerpts.map(({ article, text }, i) => { const isFeatured = enlarge && i % 11 === 0; // 11 記事ごとに大きく表示する + const baseW = 400; + const imageWidth = baseW * (isFeatured ? 2 : 1); + const imageHeight = baseW * (3 / 5) * (isFeatured ? 2 : 1); + + console.log(article.data.bg_color); + + article.data.fit ??= "cover"; + article.data.position ??= "center"; + const additionalProps = isFeatured ? { cellClassName: "md:col-span-2 md:row-span-2", @@ -75,12 +84,25 @@ const articlesWithExcerpts = await Promise.all(