Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contents/articles/README.md → contents/doc/article.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# 記事ページ

## frontmatter
Expand Down
4 changes: 3 additions & 1 deletion contents/members/README.md → contents/doc/members.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# メンバーページ

[`[member].astro`](/src/pages/members/[member].astro) によってレンダリングされるメンバー詳細ページです。
Expand All @@ -10,10 +11,11 @@
| ---------------- | ---- | ------------------------------------------------------------------------------------------------------------- |
| `nameJa` | ✅ | 名前。 |
| `nameEn` | ✅ | 英語名。 |
| `joinYear` | ✅ | ut.code(); に入会した年。ソートに使用しています。 |
| `joinYear` | ✅ | ut.code(); に入会した年。ソートに使用しています。 |
| `description` | ✅ | 今の自分を表す一言。 |
| `faceImage` | ✅ | 顔写真。縦横比は 1:1。顔を中央に配置し、顔の横幅がおよそ写真の横幅の 1/2 になるようにトリミングしてください。 |
| `upperBodyImage` | ✅ | バストショット。縦横比は 1:1。 |
| `github` | | GitHub の**アカウント名** |
| `twitter` | | X (旧 Twitter) の **ID**。 |
| `website` | | 個人のウェブサイトの URL。 |

33 changes: 33 additions & 0 deletions contents/doc/projects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# プロジェクトページ

`src/pages/projects/[...id].astro` によってレンダリングされるプロジェクト詳細ページです。

プロジェクトには 3 種類あります。

- 長期プロジェクト
- 学園祭プロジェクト
- ハッカソン

歴史的な経緯で長期プロジェクトは `contents/projects` 直下にありますが、学園祭プロジェクトとハッカソンは `contents/projects/{festival,hackathon}`にいれるようにしています。

## frontmatter

| キー | 必須 | 説明 |
| ------------- | ---- | ------------------------------------------------------------------------------ |
| `title` | ✅ | プロジェクト名 |
| `order` | | 表示順。指定されなかった場合は `date` 降順でソートされます。 |
| `date` | ✅ | プロジェクトの開始日。現状ソートのみで利用しています。 |
| `image` | ✅ | イメージ画像に関するデータ。 |
| `image.src` | ✅ | イメージファイルへの markdown からの相対パス。 |
| `image.fit` | | イメージのクロップ方法。 default = "cover"。 |
| `image.bg` | | イメージの背景色。ロード中と `crop` = "contain" のときの背景に使われています。 |
| `description` | ✅ | 短い説明。 |
| `tags` | | 使用されている技術など。現状タグごとのフィルタリング機能等は提供していません。 |
| `github` | | プロジェクトの GitHub 上での URL。 |
| `youtube` | | プロジェクトの YouTube 上での URL。 |
| `website` | | プロジェクトのウェブサイトの URL。 |

## body について

長期プロジェクトの body は各長期プロジェクトのページに使用されています。
それ以外は必要ありません。
25 changes: 25 additions & 0 deletions contents/project-kinds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export const kinds = [
{
frontmatter: "long-term",
path: undefined,
title: "長期プロジェクト",
description:
"ut.code(); で長期間にわたって開発を行っているプロジェクトです",
tabTitle: "長期プロジェクト",
},
{
frontmatter: "festival",
path: "festival",
title: "学園祭プロジェクト",
description:
"ut.code(); が毎年参加している、学園祭に展示するプロジェクトです",
tabTitle: "学園祭",
},
{
frontmatter: "hackathon",
path: "hackathon",
title: "ハッカソンプロジェクト",
description: "ut.code(); で短期間で開発したハッカソンのプロジェクトです",
tabTitle: "ハッカソン",
},
] as const;
20 changes: 0 additions & 20 deletions contents/projects/README.md

This file was deleted.

11 changes: 11 additions & 0 deletions contents/projects/hackathon/2023-08-17/call-paper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Call Paper
date: 2023-08-17
kind: hackathon
status: finished
image:
src: ./call-paper.png
description: 論文の引用関係を可視化できるアプリ
github: https://github.com/ut-code/call-paper
website: https://call-paper.pages.dev
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions contents/projects/hackathon/2023-08-17/denigma.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Denigma
date: 2023-08-17
kind: hackathon
status: dead
image:
src: ./denigma.png
description: "暗号解読ゲーム。シーザー暗号やRSA暗号など、基本的な暗号に触れてみよう!"
github: https://github.com/ut-code/denigma
website: https://utcode-denigma.onrender.com/
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions contents/projects/hackathon/2023-08-17/music-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: music-app
date: 2023-08-17
kind: hackathon
status: finished
image:
src: ./music-app.png
description: その日の気分にあった作業用BGMを生成してくれるアプリ
github: https://github.com/ut-code/music-app
website: https://ut-code.github.io/music-app
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions contents/projects/hackathon/2023-08-17/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: todoアプリ
date: 2023-08-17
kind: hackathon
status: finished
image:
src: ./todo.png
description: ToDoを管理できる Web アプリ
github: https://github.com/ut-code/todo-2023-hackathon
---
Binary file added contents/projects/hackathon/2023-08-17/todo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions contents/projects/hackathon/2024-06-08/bowling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: 壁よけボウリング
kind: hackathon
status: finished
date: 2024-06-08
description: 障害物を避けてピンを倒そう! どこか懐かしくてどこか新感覚のボウリングゲームをお楽しみあれ!
image:
src: ./bowling.png
website: https://ut-code.github.io/bowling-app/
github: https://github.com/ut-code/bowling-app
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions contents/projects/hackathon/2024-06-08/shift-syncer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: ShiftSyncer
kind: hackathon
status: finished
date: 2024-06-08
description: 複数人から登録されたシフトの希望を基に、最適なシフトを作成するアプリです。シフトの希望を出す際に、シフトに入れるか否かだけではなく、積極的に入りたいのか、それとも人が居なかったら入っても良い程度なのかといった事情も勘案できるようになっています。
image:
src: ./shift-syncer.png
github: https://github.com/ut-code/ShiftSyncer
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions contents/projects/hackathon/2024-06-08/typing-script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: TypingScript
kind: hackathon
status: finished
date: 2024-06-08
description: ソースコードに特化したタイピング練習サイトです。
image:
src: ./typing-script.png
website: https://ut-code.github.io/TypingScript
github: https://github.com/ut-code/TypingScript
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions contents/projects/hackathon/hackathon-template.md_
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Title
date: hackathon-start-date
kind: hackathon
status: finished
image:
src: ./thumbnail.png
description: "簡単なタワーディフェンスゲームです。自機も移動して攻撃すると言う特徴があります。"
github: https://github.com/ut-code/your-project
website: https://your-project.pages.dev
---
18 changes: 18 additions & 0 deletions contents/projects/hackathon/tower-battle/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Tower Battle
date: 2025-02-24
kind: hackathon
status: stable
image:
src: ./thumbnail.png
description: "簡単なタワーディフェンスゲームです。自機も移動して攻撃すると言う特徴があります。"
members:
- ykobayashi
tags:
- TypeScript
- Svelte
- DaisyUI
- Cloudflare
github: https://github.com/aster-void/tower-battle
website: https://tower-d5g.pages.dev
---
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/JoinUsCTA.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const props = Astro.props;
<div class="container mx-auto px-4 lg:max-w-screen-lg">
<h2 class="text-2xl leading-normal"><slot /></h2>
<p class="mt-4 text-gray-800">
初めは誰もが未経験です。まずはお気軽にお声掛けください!
始めは誰もが未経験です。まずはお気軽にお声掛けください!
</p>
<ActionButton class="mt-6" to="/join"> ut.code(); に参加する </ActionButton>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ const members = defineCollection({
schema: CreateMemberSchema,
});
const projects = defineCollection({
loader: glob({ base: "./contents/projects", pattern: "*/index.{md,mdx}" }),
loader: glob({ base: "./contents/projects", pattern: "**/*.{md,mdx}" }),
schema: CreateProjectSchema,
});

export const collections = { articles, members, projects };
export const collections = {
articles,
members,
projects,
};
14 changes: 5 additions & 9 deletions src/pages/articles/[...id].astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
import { Picture } from "astro:assets";
import { getCollection, getEntry, render } from "astro:content";
import { render } from "astro:content";
import JoinUsCTA from "+/components/JoinUsCTA.astro";
import GlobalLayout from "+/layouts/GlobalLayout.astro";
import { Focus } from "+/schema";
import { getArticles, getMember } from "+/query.ts";
import { Focus } from "+/schema.ts";
import { format } from "date-fns";

export async function getStaticPaths() {
const articles = await getCollection("articles");
const articles = await getArticles();
return articles.map((article) => ({
params: { id: article.id },
props: { article },
Expand All @@ -16,12 +17,7 @@ export async function getStaticPaths() {

const { article } = Astro.props;
const { Content } = await render(article);
const author =
article.data.author && (await getEntry("members", article.data.author.id));
if (article.data.author && !author)
throw new Error(
`Author not found for article ${article.id}, searched for author ${article.data.author.id}`,
);
const author = article.data.author && (await getMember(article.data.author.id));
---

<GlobalLayout
Expand Down
6 changes: 2 additions & 4 deletions src/pages/articles/[...page].astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
import { getCollection } from "astro:content";
import ArticleList from "+/components/ArticleList.astro";
import GlobalLayout from "+/layouts/GlobalLayout.astro";
import { getArticles } from "+/query";
import { Focus } from "+/schema";
import type { GetStaticPaths } from "astro";

export const getStaticPaths = (async ({ paginate }) => {
const articles = (await getCollection("articles")).sort(
(a, b) => b.data.date.getTime() - a.data.date.getTime(),
);
const articles = await getArticles();
return paginate(articles, { pageSize: 18 });
}) satisfies GetStaticPaths;

Expand Down
15 changes: 3 additions & 12 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import { Picture } from "astro:assets";
import { getCollection } from "astro:content";
import { Icon } from "astro-icon/components";

import GlobalLayout from "+/layouts/GlobalLayout.astro";
Expand All @@ -9,25 +8,17 @@ import ActionButton from "+/components/ActionButton.astro";
import ArticleList from "+/components/ArticleList.astro";
import ProjectList from "+/components/ProjectList.astro";
import SectionHeader from "+/components/per-page/SectionHeader.astro";
import { getArticles, getProjects } from "+/query.ts";
import { Focus } from "+/schema.ts";

import LogoGMOMedia from "+/images/donators/gmo-media.png";
import Hero from "+/images/headers/index.jpg";
import LabCafe from "+/images/lab-cafe.jpg";

const projects = (await getCollection("projects")).sort((a, b) => {
const a_order = a.data.order ?? Number.POSITIVE_INFINITY;
const b_order = b.data.order ?? Number.POSITIVE_INFINITY;
if (a_order !== b_order) {
return a_order - b_order;
}
return b.data.date.getTime() - a.data.date.getTime();
});
const projects = await getProjects("long-term");
projects.splice(6);

const articles = (await getCollection("articles")).sort(
(a, b) => b.data.date.getTime() - a.data.date.getTime(),
);
const articles = await getArticles();
articles.splice(3);
---

Expand Down
8 changes: 3 additions & 5 deletions src/pages/members.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
import { Picture } from "astro:assets";
import { getCollection } from "astro:content";
import JoinUsCTA from "+/components/JoinUsCTA.astro";
import Header from "+/images/headers/members.jpg";
import GlobalLayout from "+/layouts/GlobalLayout.astro";
import { Focus } from "+/schema";
import { getMembers } from "+/query.ts";
import { Focus } from "+/schema.ts";

const members = (await getCollection("members")).sort(
(a, b) => b.data.joinYear - a.data.joinYear,
);
const members = await getMembers();
---

<GlobalLayout
Expand Down
16 changes: 7 additions & 9 deletions src/pages/members/[member].astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
import { Picture } from "astro:assets";
import { getCollection, render } from "astro:content";
import { render } from "astro:content";
import ArticleList from "+/components/ArticleList.astro";
import JoinUsCTA from "+/components/JoinUsCTA.astro";
import GlobalLayout from "+/layouts/GlobalLayout.astro";
import { getArticles, getMembers } from "+/query";
import { Focus } from "+/schema";
import { Icon } from "astro-icon/components";

export async function getStaticPaths() {
const members = await getCollection("members");
const members = await getMembers();
return members.map((member) => ({
params: { member: member.id },
props: { member },
Expand All @@ -18,11 +19,9 @@ export async function getStaticPaths() {
const { member } = Astro.props;
const { Content } = await render(member);

const articles = await getCollection(
"articles",
(article) => article.data.author?.id === member.id,
);
articles.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
const articles = await getArticles({
where: (article) => article.data.author?.id === member.id,
});
---

<GlobalLayout
Expand All @@ -33,7 +32,6 @@ articles.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
>
<main class="w-full">
<div
class=""
style={`background-color: ${member.data["theme-light"] ?? "#DCFCE7"};`}
>
<div
Expand All @@ -56,7 +54,7 @@ articles.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
rel="noreferrer"
aria-label="GitHubを見る"
>
<Icon name="feather:github" class="" />
<Icon name="feather:github" />
</a>
)
}
Expand Down
Loading