Skip to content

Commit 8c121f3

Browse files
committed
complete /members
1 parent 763651e commit 8c121f3

File tree

16 files changed

+337
-100
lines changed

16 files changed

+337
-100
lines changed

.helix/languages.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
[language-servers]
2+
astro-ls = { command = "astro-ls", args = ["--stdio"] }
3+
14
[[language]]
25
name = "astro"
36
formatter = { command = "bun", args = ["prettier", "--parser", "astro"] }
7+
language-servers = ["astro-ls"]
48
[[language]]
59
name = "typescript"
610
formatter = { command = "bun", args = ["prettier", "--parser", "typescript"] }

.vscode/extensions.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint",
4-
"apollographql.vscode-apollo",
53
"astro-build.astro-vscode"
64
]
75
}

_src/pages/join.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
import React from "react";
23
import { StaticImage } from "gatsby-plugin-image";
34
import GlobalFooter from "../components/GlobalFooter";
@@ -103,3 +104,5 @@ export default function JoinPage() {
103104
export function Head() {
104105
return <CommonHead title="ut.code(); に参加する" />;
105106
}
107+
=======
108+
>>>>>>> 9135235 (complete /members)

contents/projects/dull-meshi/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ slug: dull-meshi
44
image: ./dull-meshi.jpg
55
date: 2023-04-05
66
description: 質問に答えていくだけで献立を提案してくれるアプリ
7-
tags: [TypeScript, React]
7+
tags: [TypeScript, React]
88
github: https://github.com/ut-code/menu
99
---
10+
11+
質問に答えていくだけで献立を提案してくれるアプリです。

contents/projects/learn-braille/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ ut.code();が作成した体験型点字学習サイトです。
2626

2727
## 漢点字を書く
2828

29-
漢字から漢点字への翻訳を実際に画面上で点を打つ練習を通して学べます。
29+
漢字から漢点字への翻訳を実際に画面上で点を打つ練習を通して学べます。
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
layout: "../../../layouts/project.astro"
23
title: PostPut
34
slug: postput
45
image: ./image.png
@@ -13,14 +14,15 @@ Slackの代替として使えるようにすることを目指しています。
1314

1415
## 主な機能
1516

16-
* slackのチャンネル機能の代わりとして、タグでメッセージを振り分けることができます
17-
* 1つのメッセージに複数のタグをつける(=複数のチャンネルに送信する)ことができます
18-
* すでに送ったメッセージのタグをつけ直すことができます (間違ったチャンネルに話題を送ってしまっても訂正できる)
19-
* タグを検索し、選んだタグのついたメッセージのみ表示できます
20-
* ユーザーごとに頻繁に見るタグをサイドバーに登録しておくことができます(=チャンネルにスターをつける機能)
21-
* ユーザーごとに後で確認したいメッセージを保存しておくことができます(=ブックマーク機能)
17+
- slackのチャンネル機能の代わりとして、タグでメッセージを振り分けることができます
18+
- 1つのメッセージに複数のタグをつける(=複数のチャンネルに送信する)ことができます
19+
- すでに送ったメッセージのタグをつけ直すことができます (間違ったチャンネルに話題を送ってしまっても訂正できる)
20+
- タグを検索し、選んだタグのついたメッセージのみ表示できます
21+
- ユーザーごとに頻繁に見るタグをサイドバーに登録しておくことができます(=チャンネルにスターをつける機能)
22+
- ユーザーごとに後で確認したいメッセージを保存しておくことができます(=ブックマーク機能)
2223

2324
## PostPutを試してみる
2425

2526
現在はまだ開発途中ですが、[こちら](https://postput-test-server.onrender.com/)にアクセスすると使ってみることができます。
26-
* (最初にログイン画面が表示されますが、一度も使われていないユーザー名であれば任意のパスワードでログイン(サインアップ)できるようになっています。)
27+
28+
- (最初にログイン画面が表示されますが、一度も使われていないユーザー名であれば任意のパスワードでログイン(サインアップ)できるようになっています。)

src/components/ArticleList.astro

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Image } from "astro:assets";
66
77
interface Props {
88
variant?: "normal" | "compact";
9-
articles: (Article & { body: string })[];
9+
articles: { data: Article; body?: string }[];
1010
class?: string;
1111
}
1212
const props = Astro.props;
@@ -53,17 +53,17 @@ const { variant = "normal", articles } = props;
5353
? {
5454
cellClassName: "md:col-span-2 md:row-span-2",
5555
imageClassName: "h-[350px] md:h-[450px]",
56-
excerpt: article.body.slice(0, 120),
56+
excerpt: article.body?.slice(0, 120),
5757
}
5858
: {
5959
cellClassName: "",
6060
imageClassName: "h-[200px]",
61-
excerpt: article.body.slice(0, 120),
61+
excerpt: article.body?.slice(0, 120),
6262
};
6363
return (
6464
<li class="contents">
6565
<a
66-
href={`/articles/${article.slug}`}
66+
href={`/articles/${article.data.slug}`}
6767
class:list={[
6868
"block hover:opacity-80",
6969
additionalProps.cellClassName,
@@ -75,27 +75,19 @@ const { variant = "normal", articles } = props;
7575
additionalProps.imageClassName,
7676
]}
7777
>
78-
{article.image ? (
79-
<Image
80-
alt="カバー画像"
81-
height={48 * 4 * 4}
82-
width={48 * 4 * 4}
83-
src={article.image}
84-
class="w-full h-full object-cover"
85-
/>
86-
) : (
87-
<img
88-
alt="画像なし"
89-
src={noImage.src}
90-
class="w-full h-full object-cover"
91-
/>
92-
)}
78+
<Image
79+
alt="カバー画像"
80+
height={48 * 4 * 4}
81+
width={48 * 4 * 4}
82+
src={article.data.image}
83+
class="w-full h-full object-cover"
84+
/>
9385
</div>
9486
<div class="mt-4">
9587
<time class="block text-gray-500 text-sm">
96-
{format(article.date, "yyyy/MM/dd HH:mm")}
88+
{format(article.data.date, "yyyy/MM/dd HH:mm")}
9789
</time>
98-
<h3 class="text-lg font-bold">{article.title}</h3>
90+
<h3 class="text-lg font-bold">{article.data.title}</h3>
9991
<p class="prose max-w-none mt-2">{additionalProps.excerpt}</p>
10092
</div>
10193
</a>
@@ -104,5 +96,3 @@ const { variant = "normal", articles } = props;
10496
})
10597
}
10698
</ul>
107-
); }
108-

src/components/Header.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Icon } from "astro-icon/components";
33
import Logo from "./Logo.astro";
44
import { Focus } from "../schema.ts";
5+
import { ClientRouter } from "astro:transitions";
56
67
const links = [
78
{ title: "プロジェクト", to: "/projects", focus: Focus.projects },
@@ -17,6 +18,7 @@ interface Props {
1718
const { focus } = Astro.props;
1819
---
1920

21+
<ClientRouter />
2022
<header class="sticky">
2123
{
2224
/* <div class="flex gap-4 justify-center items-center px-1 py-3 md:py-1 bg-green-400">
@@ -47,8 +49,8 @@ const { focus } = Astro.props;
4749
<a
4850
href={link.to}
4951
class:list={[
50-
"flex items-center h-full px-6 hover:bg-gray-100 navigation-bar",
51-
focus === link.focus && "bg-amber-50",
52+
"flex items-center h-full px-6 navigation-bar",
53+
focus === link.focus && "text-amber-500",
5254
]}
5355
>
5456
{link.title}

src/content.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { glob } from "astro/loaders";
66
import {
77
CreateArticleSchema,
88
CreateProjectSchema,
9-
MemberSchema,
9+
CreateMemberSchema,
1010
} from "./schema.ts";
1111

1212
const articles = defineCollection({
@@ -16,7 +16,7 @@ const articles = defineCollection({
1616

1717
const members = defineCollection({
1818
loader: glob({ base: "./contents/members", pattern: "*/index.{md,mdx}" }),
19-
schema: MemberSchema,
19+
schema: CreateMemberSchema,
2020
});
2121
const projects = defineCollection({
2222
loader: glob({ base: "./contents/projects", pattern: "*/index.{md,mdx}" }),

src/pages/articles.astro

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
import GlobalLayout from "../layouts/GlobalLayout.astro";
3+
import ArticleList from "../components/ArticleList.astro";
4+
import { Focus } from "../schema";
5+
import { getCollection } from "astro:content";
6+
7+
`
8+
query ArticlesPage {
9+
allMdx(
10+
filter: {
11+
internal: { contentFilePath: { glob: "**/contents/articles/**" } }
12+
}
13+
sort: { frontmatter: { date: DESC } }
14+
) {
15+
nodes {
16+
...ArticleListArticle
17+
}
18+
}
19+
}
20+
`;
21+
22+
const articles = (await getCollection("articles")).sort(
23+
(a, b) => b.data.date.getTime() - a.data.date.getTime(),
24+
);
25+
---
26+
27+
<GlobalLayout
28+
title="すべての記事"
29+
description="ut.code(); からの最新情報"
30+
focus={Focus.articles}
31+
>
32+
<main class="container mx-auto px-4 py-24">
33+
<h1 class="text-4xl text-center">すべての記事</h1>
34+
<ArticleList class="mt-16" {articles} />
35+
</main>
36+
</GlobalLayout>

0 commit comments

Comments
 (0)