feat: トップページの最新記事を自動生成に切り替え
Deploy Docusaurus Site / deploy (push) Successful in 29s

This commit is contained in:
2026-02-28 02:16:29 +00:00
parent 7a509d5dc5
commit 8fe2e55d81
4 changed files with 161 additions and 35 deletions
+15 -35
View File
@@ -2,6 +2,7 @@ import React from 'react';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import styles from './index.module.css';
import recentPosts from '../data/recent-posts.json';
function HomepageHeader() {
return (
@@ -25,39 +26,14 @@ function HomepageHeader() {
}
function RecentTech() {
const posts = [
{
title: "ローカルGitea × Webhook連携でAI自動コードレビュー",
date: "2026-02-26",
tag: "Gitea",
url: "/tech/gitea-webhook-ai-review",
},
{
title: "DGX SparkにAnythingLLMでローカルLLMエージェント構築",
date: "2026-02-20",
tag: "DGX Spark",
url: "/tech/dgx-spark-anythingllm",
},
{
title: 'DGX Spark デュアル構成ガイド',
date: '2026-02-19',
tag: 'DGX Spark',
url: '/tech/dgx-spark-dual',
},
{
title: 'DGX SparkでMiniMax-M2.5-REAP-172Bを動かす',
date: '2026-02-18',
tag: 'DGX Spark',
url: '/tech/dgx-spark-minimax',
},
];
const posts = recentPosts.tech;
return (
<section className={styles.section}>
<h2 className={styles.sectionTitle}>// Tech</h2>
<p className={styles.sectionDesc}></p>
<div className={styles.posts}>
{posts.map((post, idx) => (
{posts.length > 0 ? posts.map((post, idx) => (
<Link key={idx} to={post.url} className={styles.postCard}>
<h3 className={styles.postTitle}>{post.title}</h3>
<div className={styles.postMeta}>
@@ -65,7 +41,7 @@ function RecentTech() {
<span className={styles.postTag}>{post.tag}</span>
</div>
</Link>
))}
)) : <p></p>}
</div>
<Link to="/tech" className={styles.moreLink}>
@@ -75,18 +51,22 @@ function RecentTech() {
}
function RecentBlog() {
const posts = recentPosts.blog;
return (
<section className={styles.section}>
<h2 className={styles.sectionTitle}>// Blog</h2>
<p className={styles.sectionDesc}></p>
<div className={styles.posts}>
<Link to="/blog/2026-02-19-headline" className={styles.postCard}>
<h3 className={styles.postTitle}>02/19 AIヘッドライン</h3>
<div className={styles.postMeta}>
<span className={styles.postDate}>2026-02-19</span>
<span className={styles.postTag}>AI</span>
</div>
</Link>
{posts.length > 0 ? posts.map((post, idx) => (
<Link key={idx} to={post.url} className={styles.postCard}>
<h3 className={styles.postTitle}>{post.title}</h3>
<div className={styles.postMeta}>
<span className={styles.postDate}>{post.date}</span>
<span className={styles.postTag}>{post.tag}</span>
</div>
</Link>
)) : <p></p>}
</div>
<Link to="/blog" className={styles.moreLink}>