Skip to content

Commit a448c69

Browse files
committed
format
1 parent 634a9d1 commit a448c69

File tree

5 files changed

+78
-77
lines changed

5 files changed

+78
-77
lines changed

docs/contents/projects.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@
1414

1515
## frontmatter
1616

17-
| キー | 必須 || 説明 |
18-
| ----------------- | ---- | ------------- | ----------------------------------------------------------------------------------------------------- |
19-
| `app.name` || string | プロジェクト名 |
20-
| `app.description` || string | プロジェクトの短い説明。 |
21-
| `app.url` | | string->url | アプリにアクセスできる URL。 |
22-
| `app.platform` || string[] | ソフトウェアの配布プラットフォーム。`web`, `mobile`, `desktop`, `cli`|
23-
| `app.domain` || string[] | ソフトウェアの種別 (クソ雑ドキュメント)。 `app`, `game`, `tool`, `site`, `learn` (教材), `lib` など。 |
24-
| `order` | | number? | 表示順。指定されなかった場合は `date` 降順でソートされます。 |
25-
| `date` || date | 記事の初回執筆日。ソートのみで利用しています。 |
26-
| `kind` || string | アプリケーションの開発体系。`long-term`, `festival`, `hackathon` の 3 つ。 |
27-
| `status` || string | プロジェクトの現状。詳細は `src/schema.ts` を参照。 |
28-
| `members` | | string[]? | プロジェクトのメンバー。まだメンバーページを作ってなくても問題ないです。 |
29-
| `tags` | | string[]? | 使用されている技術。タグごとのフィルタリング機能等は提供していません。 |
30-
| `thumbnail.src` || string->path | イメージファイルへの markdown からの相対パス。 |
31-
| `thumbnail.fit` | | string? | イメージのクロップ方法。 default = "cover"。 |
32-
| `thumbnail.bg` | | string? | イメージの背景色。ロード中と `crop` = "contain" のときの背景に使われています。 |
17+
| キー | 必須 | | 説明 |
18+
| ----------------- | ---- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19+
| `app.name` || string | プロジェクト名 |
20+
| `app.description` || string | プロジェクトの短い説明。 |
21+
| `app.url` | | string->url | アプリにアクセスできる URL。 |
22+
| `app.platform` || string[] | ソフトウェアの配布プラットフォーム。`web`, `mobile`, `desktop`, `cli` |
23+
| `app.domain` || string[] | ソフトウェアの種別 (クソ雑ドキュメント)。 `app`, `game`, `tool`, `site`, `learn` (教材), `lib` など。 |
24+
| `order` | | number? | 表示順。指定されなかった場合は `date` 降順でソートされます。 |
25+
| `date` || date | 記事の初回執筆日。ソートのみで利用しています。 |
26+
| `kind` || string | アプリケーションの開発体系。`long-term`, `festival`, `hackathon` の 3 つ。 |
27+
| `status` || string | プロジェクトの現状。詳細は `src/schema.ts` を参照。 |
28+
| `members` | | string[]? | プロジェクトのメンバー。まだメンバーページを作ってなくても問題ないです。 |
29+
| `tags` | | string[]? | 使用されている技術。タグごとのフィルタリング機能等は提供していません。 |
30+
| `thumbnail.src` || string->path | イメージファイルへの markdown からの相対パス。 |
31+
| `thumbnail.fit` | | string? | イメージのクロップ方法。 default = "cover"。 |
32+
| `thumbnail.bg` | | string? | イメージの背景色。ロード中と `crop` = "contain" のときの背景に使われています。 |
3333
| `favicon` | | string->path? \| null | 強制的に使わせる Favicon。指定しない場合は、アプリの URL から自動で引っ張ってきます。 `null` を指定した場合は、Faviconは存在しないものとみなしアプリのURLを自動でfetchしません。 |
34-
| `social.github` | | string->url? | プロジェクトの GitHub 上での URL。 |
35-
| `social.website` | | string->url? | プロジェクトのウェブサイトの URL。(`app.url` と別で広報用などの Website がある場合) |
36-
| `social.youtube` | | string->url? | プロジェクトの YouTube 上での URL。 |
37-
| `social.twitter` | | string->url? | プロジェクトのツイッター (現 X) の URL。 |
34+
| `social.github` | | string->url? | プロジェクトの GitHub 上での URL。 |
35+
| `social.website` | | string->url? | プロジェクトのウェブサイトの URL。(`app.url` と別で広報用などの Website がある場合) |
36+
| `social.youtube` | | string->url? | プロジェクトの YouTube 上での URL。 |
37+
| `social.twitter` | | string->url? | プロジェクトのツイッター (現 X) の URL。 |
3838

3939
## body について
4040

src/components/common/ProjectList.astro

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ const { projects, variant = "full" } = props;
2121
class="overflow-clip rounded-xl border border-gray-200 bg-gray-50 hover:brightness-95"
2222
href={`/projects/${project.id}`}
2323
>
24-
{project.data.thumbnail ?
25-
<Picture
26-
loading={i < 6 && variant === "full" ? "eager" : "lazy"}
27-
alt={`${project.data.app.name}のサムネイル`}
28-
src={project.data.thumbnail.src}
29-
width="600"
30-
height={(600 * 3) / 5}
31-
class:list={[
32-
"aspect-5/3 w-full",
33-
project.data.thumbnail.fit !== "contain" && "skeleton",
34-
]}
35-
style={{
36-
"object-fit": project.data.thumbnail.fit,
37-
"object-position": project.data.thumbnail.position,
38-
"background-color": project.data.thumbnail.bg,
39-
}}
40-
/>
41-
:
42-
<div class="aspect-5/3 w-full bg-gray-100" />
43-
}
24+
{project.data.thumbnail ? (
25+
<Picture
26+
loading={i < 6 && variant === "full" ? "eager" : "lazy"}
27+
alt={`${project.data.app.name}のサムネイル`}
28+
src={project.data.thumbnail.src}
29+
width="600"
30+
height={(600 * 3) / 5}
31+
class:list={[
32+
"aspect-5/3 w-full",
33+
project.data.thumbnail.fit !== "contain" && "skeleton",
34+
]}
35+
style={{
36+
"object-fit": project.data.thumbnail.fit,
37+
"object-position": project.data.thumbnail.position,
38+
"background-color": project.data.thumbnail.bg,
39+
}}
40+
/>
41+
) : (
42+
<div class="aspect-5/3 w-full bg-gray-100" />
43+
)}
4444
<div class="p-4">
4545
<h3 class="text-xl font-bold text-gray-800">
4646
{project.data.app.name}

src/lib/fetch-favicon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function fetchFavicon(
1717
const cacheKey = `fetch-favicon:${getDomain(siteBaseURL)}`;
1818

1919
return await cache(cacheKey, z.string().optional(), async () => {
20-
try{
20+
try {
2121
const websiteRes = await fetch(siteBaseURL);
2222
if (!websiteRes.ok) {
2323
return undefined;
@@ -68,7 +68,7 @@ export async function fetchFavicon(
6868
}
6969

7070
return undefined;
71-
}catch{
71+
} catch {
7272
return undefined;
7373
}
7474
});

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

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ const { Content } = await render(project);
2222
2323
let iconSrc: string | undefined;
2424
if (project.data.status !== "dead") {
25-
if(project.data.favicon === null) {
25+
if (project.data.favicon === null) {
2626
iconSrc = undefined;
27-
}else if (project.data.favicon){
27+
} else if (project.data.favicon) {
2828
iconSrc = project.data.favicon.src;
2929
} else {
3030
if (!iconSrc && project.data.app.url) {
3131
iconSrc = await fetchFavicon(project.data.app.url);
3232
}
3333
if (!iconSrc && project.data.social?.website) {
34-
iconSrc = await fetchFavicon(project.data.social.website);
34+
iconSrc = await fetchFavicon(project.data.social.website);
3535
}
3636
}
3737
}
@@ -47,27 +47,29 @@ if (project.data.status !== "dead") {
4747
<div
4848
class="lg:mx-auto lg:flex lg:max-w-screen-lg lg:flex-row-reverse lg:items-center lg:gap-4 lg:px-4 lg:py-12"
4949
>
50-
{project.data.thumbnail ?
51-
<Picture
52-
loading="eager"
53-
formats={["avif", "webp"]}
54-
class:list={[
55-
"aspect-5/3 w-full object-cover lg:w-150 lg:rounded-2xl",
56-
!project.data.thumbnail.bg && "skeleton",
57-
]}
58-
alt="プロジェクト画像"
59-
src={project.data.thumbnail.src}
60-
position={project.data.thumbnail.position}
61-
width="1000"
62-
height="600"
63-
style={{
64-
"object-position": project.data.thumbnail.position,
65-
"object-fit": project.data.thumbnail.fit,
66-
"background-color": project.data.thumbnail.bg || undefined,
67-
}}
68-
/>
69-
:
70-
<div class="aspect-5/3 w-full lg:w-150 lg:rounded-2xl bg-gray-100" />
50+
{
51+
project.data.thumbnail ? (
52+
<Picture
53+
loading="eager"
54+
formats={["avif", "webp"]}
55+
class:list={[
56+
"aspect-5/3 w-full object-cover lg:w-150 lg:rounded-2xl",
57+
!project.data.thumbnail.bg && "skeleton",
58+
]}
59+
alt="プロジェクト画像"
60+
src={project.data.thumbnail.src}
61+
position={project.data.thumbnail.position}
62+
width="1000"
63+
height="600"
64+
style={{
65+
"object-position": project.data.thumbnail.position,
66+
"object-fit": project.data.thumbnail.fit,
67+
"background-color": project.data.thumbnail.bg || undefined,
68+
}}
69+
/>
70+
) : (
71+
<div class="aspect-5/3 w-full bg-gray-100 lg:w-150 lg:rounded-2xl" />
72+
)
7173
}
7274
<div class="container mx-auto mt-8 px-4 lg:mx-0 lg:flex-1">
7375
<p class="flex items-center gap-1 text-gray-600">

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@ const projects = await getProjects(kind.frontmatter);
2727
<h1 class="mb-5 min-h-[2.25em] text-center text-4xl">{kind.title}</h1>
2828
<div role="tablist" class="tabs tabs-lift">
2929
{
30-
kinds
31-
.map((tab) => (
32-
<a>
33-
<a
34-
role="tab"
35-
class:list={["tab", { "tab-active": kind.path === tab.path }]}
36-
href={tab.path ? `/projects/${tab.path}` : "/projects"}
37-
>
38-
{tab.tabTitle}
39-
</a>
30+
kinds.map((tab) => (
31+
<a>
32+
<a
33+
role="tab"
34+
class:list={["tab", { "tab-active": kind.path === tab.path }]}
35+
href={tab.path ? `/projects/${tab.path}` : "/projects"}
36+
>
37+
{tab.tabTitle}
4038
</a>
41-
))
39+
</a>
40+
))
4241
}
4342
</div>
4443
{

0 commit comments

Comments
 (0)