@@ -20,7 +20,6 @@ const { project } = Astro.props;
2020const { Content } = await render (project );
2121---
2222
23- <!-- - TODO: truncate project.body -->
2423<GlobalLayout
2524 title ={ project .data .title }
2625 description ={ project .data .description }
@@ -36,7 +35,7 @@ const { Content } = await render(project);
3635 formats ={ [" avif" , " webp" ]}
3736 width =" 1200"
3837 height =" 600"
39- class =" w-full lg:rounded-2xl"
38+ class =" w-full lg:w-150 lg: rounded-2xl"
4039 alt =" プロジェクト画像"
4140 src ={ project .data .image }
4241 />
@@ -59,39 +58,35 @@ const { Content } = await render(project);
5958 </ul >
6059 )
6160 }
62- {
63- /* 表示する icon が無いときは、親要素の高さの分間隔が広くなりすぎるので、親要素ごと表示しないようにする。 */
64- }
65- {
66- (project .data .github || project .data .youtube ) && (
67- <>
68- <div class = " mt-6 flex gap-4 text-4xl" >
69- { project .data .github && (
61+ <div class =" flex gap-4 text-4xl" >
62+ {
63+ [
64+ {
65+ href: project .data .github ,
66+ icon: " feather:github" ,
67+ label: " GitHub" ,
68+ },
69+ {
70+ href: project .data .youtube ,
71+ icon: " feather:youtube" ,
72+ label: " YouTube" ,
73+ },
74+ ].map (
75+ (link ) =>
76+ link .href && (
7077 <a
71- href = { project . data . github }
78+ href = { link . href }
7279 target = " _blank"
73- class = " -m-1 rounded-xl p-1 hover:bg-gray-100"
80+ class = " -m-1 mt-6 rounded-xl p-1 hover:bg-gray-100"
7481 rel = " noreferrer"
75- aria-label = " GitHubを見る "
82+ aria-label = { ` ${ link . label }を見る ` }
7683 >
77- <Icon name = " feather:github " />
84+ <Icon name = { link . icon } class = " h-9 w-9 " />
7885 </a >
79- )}
80- </div >
81- { project .data .youtube && (
82- <a
83- href = { project .data .youtube }
84- target = " _blank"
85- class = " -m-1 rounded-xl p-1 hover:bg-gray-100"
86- rel = " noreferrer"
87- aria-label = " YouTubeを見る"
88- >
89- <Icon name = " feather:youtube" />
90- </a >
91- )}
92- </>
93- )
94- }
86+ ),
87+ )
88+ }
89+ </div >
9590 {
9691 project .data .website && (
9792 <ActionButton to = { project .data .website } class = " my-6" >
0 commit comments