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,925 changes: 1,901 additions & 24 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@
"lint": "eslint"
},
"dependencies": {
"gray-matter": "^4.0.3",
"next": "16.0.0",
"react": "19.2.0",
"react-dom": "19.2.0"
"react-dom": "19.2.0",
"react-markdown": "^10.1.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@tailwindcss/typography": "^0.5.19",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"autoprefixer": "^10.4.21",
"eslint": "^9",
"eslint-config-next": "16.0.0",
"postcss": "^8.5.6",
"remark": "^15.0.1",
"remark-html": "^16.0.1",
"tailwindcss": "^4.1.16",
"typescript": "^5"
}
Expand Down
52 changes: 52 additions & 0 deletions posts/251029_BornBlog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: "ブログができました。"
date: "2025-10-29"
description: "簡易的なブログができちゃいましたよ。どうしよう"
---
# 🎉 | やったぜ

紆余曲折の結果、なんとかブログ(笑)を完成させました。
多分ほぼ使わない。
まあ、あっても困らんでしょう理論。

---

以下、テスト

# レベル1の見出し

## レベル2の見出し

### レベル3の見出し

#### レベル4の見出し

##### レベル5の見出し

###### レベル6の見出し

> "このテキストは、HTMLのblockquote要素に囲まれます。
> blockquote要素はreflowableです。テキストを好きなように
> 改行することができます。改行したとしても、変換後はひとつの
> blockquote要素として扱われます。"

* 順序無しリストのアイテム
* サブアイテムはタブもしくは4つのスペースでインデントする
* 順序無しリストの別のアイテム

1. 順序付きリストのアイテム
1. サブアイテムはタブもしくは4つのスペースでインデントする
2. 順序付きリストの別のアイテム

これは段落です。文中に `コードテキスト`を含みます。

```text
This is CodeBlock Line 1.
This is CodeBlock Line 2.
This is CodeBlock Line 3.
```

[リンクのテキスト](リンクのアドレス "リンクのタイトル")

*強調*(斜体として表現されることが多い)
**強い強調**(太字として表現されることが多い)
60 changes: 60 additions & 0 deletions src/app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { getAllPosts, getPostBySlug } from "@/lib/posts";
import { remark } from "remark";
import html from "remark-html";
import Link from "next/link";
Comment thread
T-b-t-nchos marked this conversation as resolved.
import { notFound } from 'next/navigation';

type Props = {
params: Promise<{ slug: string }>;
};

export async function generateStaticParams() {
const posts = getAllPosts();
return posts.map((post) => ({ slug: post.slug }));
}

export default async function PostPage({ params }: Props) {
const { slug } = await params;

try {
const post = getPostBySlug(slug);
const processedContent = await remark().use(html).process(post.content);
const contentHtml = processedContent.toString();

return (
<div className="min-h-screen text-neutral-100 py-20 px-6">
<article className="max-w-5xl mx-auto bg-neutral-900/80 border border-neutral-800 backdrop-blur-md rounded-2xl shadow-md overflow-hidden p-10">
<header className="border-b border-neutral-800 pb-6 mb-10">
<p className="text-sm text-green-400 tracking-wide uppercase">
{new Date(post.meta.date).toLocaleDateString("ja-JP", {
year: "numeric",
month: "long",
day: "numeric",
})}
</p>
<h1 className="mt-3 text-3xl font-bold text-white">{post.meta.title}</h1>
{post.meta.description && (
<p className="mt-3 text-neutral-400 text-sm leading-relaxed">
{post.meta.description}
</p>
)}
</header>

<div
className="prose prose-invert lg:prose-xl max-w-none"
dangerouslySetInnerHTML={{ __html: contentHtml }}
/>

<footer className="border-t border-neutral-800 pt-6 mt-10">
<Link href="/blog" className="mt-6 text-sm font-bold text-green-400 tracking-wide uppercase">
→ Back
</Link>
</footer>
</article>
</div>
);
} catch (error) {
console.error(`Failed to load post ${slug}:`, error);
notFound();
}
}
40 changes: 36 additions & 4 deletions src/app/blog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
import Link from "next/link";
import Image from "next/image";
import { getAllPosts } from "@/lib/posts";

export default async function BlogPage() {
const posts = getAllPosts();

export default function BlogPage() {
return (
<div className="items-centerrelative min-h-screen flex items-center justify-center overflow-hidden bg-neutral-950">
<h1>Preparing...</h1>
<div className="text-neutral-100 py-20 px-6">
<div className="max-w-3xl mx-auto">

<ul className="mt-12 space-y-6">
{posts.map((post) => (
<li key={post.slug}>
<Link
href={`/blog/${post.slug}`}
className="block p-4 border border-neutral-800 rounded-xl bg-neutral-900/80 backdrop-blur-md hover:border-green-500/50 hover:text-green-400 transition-all duration-300"
>
<div className="flex justify-between items-center">
<h2 className="text-xl font-semibold">{post.meta.title}</h2>
<span className="text-sm text-green-400">
{new Date(post.meta.date).toLocaleDateString("ja-JP", {
year: "numeric",
month: "short",
day: "numeric",
})}
</span>
</div>
{post.meta.description && (
<p className="mt-2 text-neutral-400 text-sm line-clamp-2">
{post.meta.description}
</p>
)}
</Link>
</li>
))}
</ul>
</div>
</div>
);
}
}
146 changes: 143 additions & 3 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,149 @@ body {
font-family: Arial, Helvetica, sans-serif;
}

@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
.prose {
color: #f7fafc;
}

/* 見出し */
.prose h1 {
font-size: 2rem;
line-height: 2.5rem;
font-weight: 700;
padding: 10px 0;
}

.prose h2 {
font-size: 1.75rem;
line-height: 2.25rem;
font-weight: 700;
padding: 10px 0;
}

.prose h3 {
font-size: 1.5rem;
line-height: 2rem;
font-weight: 700;
padding: 10px 0;
}

.prose h4 {
font-size: 1.25rem;
line-height: 1.75rem;
font-weight: 700;
padding: 8px 0;
}

.prose h5 {
font-size: 1.125rem;
line-height: 1.5rem;
font-weight: 700;
padding: 6px 0;
}

.prose h6 {
font-size: 1rem;
line-height: 1.25rem;
font-weight: 700;
padding: 4px 0;
}

/* 段落 */
.prose p {
font-size: 1rem;
line-height: 1.6rem;
padding-bottom: 10px;
}

/* 水平線 */
.prose hr {
border-color: #4a5568;
margin: 30px 0;
}

/* リスト */
.prose ul {
list-style-type: disc;
padding-left: 1.5rem;
margin-bottom: 1rem;
}

.prose ol {
list-style-type: decimal;
padding-left: 1.5rem;
margin-bottom: 1rem;
}

.prose li {
margin-bottom: 0.5rem;
}

/* リンク */
.prose a {
color: #63b3ed;
text-decoration: underline;
}

.prose a:hover {
color: #4299e1;
}

/* 引用 */
.prose blockquote {
border-left: 4px solid #4a5568;
padding-left: 1rem;
color: #a0aec0;
font-style: italic;
margin: 1rem 0;
}

/* コードインライン */
.prose code {
background-color: #252525;
padding: 2px 6px;
border-radius: 4px;
font-size: 0.95rem;
font-family: "Fira Code", monospace;
}

.prose pre {
background-color: #252525;
padding: 1rem;
border-radius: 8px;
overflow-x: auto;
font-size: 0.95rem;
font-family: "Fira Code", monospace;
line-height: 1.5rem;
white-space: pre-wrap;
}

/* 画像 */
.prose img {
max-width: 100%;
border-radius: 8px;
margin: 1rem 0;
}

/* テーブル */
.prose table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1rem;
}

.prose th,
.prose td {
border: 1px solid #4a5568;
padding: 0.5rem;
text-align: left;
}

.prose th {
background-color: #2d3748;
}
}


@layer utilities {
.fade-in {
Expand Down
4 changes: 3 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function RootLayout({
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
<div className="min-h-screen bg-[url('/bk1.png')] bg-cover bg-center bg-fixed bg-neutral-950">
{children}
</div>
</body>
</html>
);
Expand Down
16 changes: 4 additions & 12 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Image from "next/image";
import Link from "next/link";

async function getOrgData() {
const res = await fetch(`https://api.github.com/orgs/Syobosetsu-Proj`, {
Expand Down Expand Up @@ -32,31 +32,23 @@ export function GithubButton(sublink: string) {

export function BookButton(link: string, text: string) {
return (
<a
<Link
href={link}
rel="noopener noreferrer"
className="mt-10 py-1.5 px-4 inline-flex items-center justify-center gap-2 transition-colors bg-green-800 active:bg-green-950 font-medium border-green-900 text-white rounded-lg hover:bg-green-900 disabled:opacity-50"
>
<img src="/icons/book.svg" alt="GitHub" className="w-5 h-5 filter invert" />

<span>{text}</span>
</a>
</Link>
);
}

export default async function Home() {
const org = await getOrgData();

return (
<div className="relative min-h-screen flex items-center justify-center overflow-hidden bg-neutral-950 fade-in">
<Image
src="/bk1.png"
alt="Space background"
fill
unoptimized
className="object-cover"
/>

<div className="relative min-h-screen flex items-center justify-center overflow-hidden fade-in">
<section className="fade-in">
<div className="relative z-10 container mx-auto px-4 py-16">
<div className="flex w-full flex-col items-center justify-center rounded-lg p-8">
Expand Down
Loading
Loading