feat: wire Docs and Blog pages to markdown content pipeline

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 13:27:25 +08:00
parent 1ed7fad293
commit 65177f12a7
4 changed files with 96 additions and 25 deletions

View File

@@ -1,20 +1,19 @@
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import SEOHead from '../components/seo/SEOHead';
import { useLanguage } from '../contexts/LanguageContext';
const posts = [
{
slug: 'introducing-texpixel',
title: 'Introducing TexPixel',
titleZh: 'TexPixel 介绍',
description: 'Meet TexPixel — your AI-powered formula recognition tool',
descriptionZh: '认识 TexPixel — 你的 AI 公式识别工具',
date: '2026-03-25',
},
];
import { loadManifest, type ContentMeta } from '../lib/content';
export default function BlogListPage() {
const { language } = useLanguage();
const [posts, setPosts] = useState<ContentMeta[]>([]);
useEffect(() => {
loadManifest('blog').then(manifest => {
setPosts(manifest[language] || []);
});
}, [language]);
return (
<>
<SEOHead title="Blog" description="TexPixel blog — updates, tutorials, and insights" path="/blog" />
@@ -24,8 +23,15 @@ export default function BlogListPage() {
{posts.map((post) => (
<Link key={post.slug} to={`/blog/${post.slug}`} className="block p-6 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors">
<div className="text-xs text-gray-400 mb-2">{post.date}</div>
<h2 className="text-lg font-semibold text-gray-900">{language === 'en' ? post.title : post.titleZh}</h2>
<p className="text-gray-600 mt-1 text-sm">{language === 'en' ? post.description : post.descriptionZh}</p>
<h2 className="text-lg font-semibold text-gray-900">{post.title}</h2>
<p className="text-gray-600 mt-1 text-sm">{post.description}</p>
{post.tags.length > 0 && (
<div className="flex gap-2 mt-3">
{post.tags.map(tag => (
<span key={tag} className="text-xs bg-gray-200 text-gray-600 px-2 py-0.5 rounded">{tag}</span>
))}
</div>
)}
</Link>
))}
</div>