Skip to content

Commit 823bd3b

Browse files
committed
add description for hackathon
1 parent bccaf5d commit 823bd3b

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

src/pages/projects/[...id].astro

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { getProjects } from "+/query";
88
import { Focus } from "+/schema.ts";
99
import type { GetStaticPaths } from "astro";
1010
import { Icon } from "astro-icon/components";
11+
import { format } from "date-fns";
1112
1213
export const getStaticPaths = (async () => {
1314
const projects = await getProjects("all");
@@ -86,23 +87,54 @@ const { Content } = await render(project);
8687
}
8788
</div>
8889
{
89-
project.data.website && (
90+
project.data.website && project.data.status !== "dead" && (
9091
<ActionButton to={project.data.website} class="my-6">
9192
<Icon name="feather:globe" class="mr-2 inline-block h-6 w-6" />
92-
<span>{project.data.title}</span>
93+
{project.data.title}
9394
</ActionButton>
9495
)
9596
}
9697
</div>
9798
</div>
9899
<div class="container mx-auto mt-6 px-4 lg:max-w-screen-lg">
99100
<div class="prose max-w-none rounded-lg bg-gray-100 p-4">
100-
{project.data.description}
101+
{
102+
project.data.kind === "hackathon"
103+
? `${format(project.data.date, "yyyy年M月d日")}
104+
に行われたハッカソンで作成されたプロジェクトです。`
105+
: project.data.description
106+
}
107+
</div>
108+
<div class="prose mt-8 max-w-none">
109+
{
110+
project.data.kind === "hackathon" ? (
111+
project.data.description
112+
) : (
113+
<Content />
114+
)
115+
}
101116
</div>
102-
<div class="prose mt-8 max-w-none"><Content /></div>
103117
</div>
104118
</main>
105-
<JoinUsCTA class="mt-8">
106-
ut.code(); で{project.data.title}を開発しませんか?
107-
</JoinUsCTA>
119+
{
120+
project.data.kind === "long-term" && (
121+
<JoinUsCTA class="mt-8">
122+
ut.code(); で{project.data.title}を開発しませんか?
123+
</JoinUsCTA>
124+
)
125+
}
126+
{
127+
project.data.kind === "hackathon" && (
128+
<JoinUsCTA class="mt-8">
129+
ut.code(); では、定期的にハッカソンイベントを行っています。
130+
</JoinUsCTA>
131+
)
132+
}
133+
{
134+
project.data.kind === "festival" && (
135+
<JoinUsCTA class="mt-8">
136+
ut.code(); は、毎年五月祭・駒場祭に参加しています。
137+
</JoinUsCTA>
138+
)
139+
}
108140
</GlobalLayout>

src/pages/projects/[...kind].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const projects = await getProjects(kind.frontmatter);
4343
{
4444
projects.length === 0 ? (
4545
<p class="mt-30 text-center text-gray-500">
46-
プロジェクトはまだありません
46+
プロジェクトはまだ反映されていません。
4747
</p>
4848
) : (
4949
<ProjectList {projects} class="mt-16" variant="full" />

0 commit comments

Comments
 (0)