Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
3b71fdd
Merge pull request #1 from flawlessv/feature/ai-embedding
flawlessv Dec 12, 2025
8ed6a91
Merge pull request #2 from flawlessv/feature/ai-embedding
flawlessv Dec 25, 2025
5836c40
chore: remove outdated README content for Next.js full-stack developm…
Dec 25, 2025
36b27ba
Merge branch 'main' of github.com:flawlessv/Spring-Lament-Blog
Dec 25, 2025
93dfbef
chore: remove outdated AI integration documentation to streamline pro…
Dec 26, 2025
68b9fdf
docs: update CLAUDE.md and add README.md for Spring Broken AI Blog, e…
Dec 26, 2025
3311ef6
feat: implement FullScreenLoading component with shimmer animation an…
Dec 26, 2025
5f6f208
feat: add seasonal background and flower click effects to enhance vis…
Dec 26, 2025
5aa0012
merge: 合并 feature/ai-embedding 分支的代码到 main
Dec 26, 2025
bab2e96
docs: 更新 CLAUDE.md 和 README.md
Dec 26, 2025
86045e3
chore: 删除调试的脚本
Dec 26, 2025
1448aef
refactor: rename project to "spring-broken-ai-blog" and update depend…
Dec 26, 2025
23d8681
feat: enhance database commands in package.json to use dotenv for env…
Dec 29, 2025
fca2c28
feat: add automatic indexing feature and status check for published a…
Dec 29, 2025
8ce91be
feat: extend PublishDialog component to support AI recommendations fo…
Dec 29, 2025
c72677c
refactor: dynamically import AI and vector store modules to avoid cli…
Dec 29, 2025
bbbe3b4
feat: enhance loading components with new SimpleLoading and Beautiful…
Dec 29, 2025
007dd7d
fix: update deployment script to reference the correct application na…
Dec 29, 2025
bca5845
feat: implement data fetching for profile and categories in CategoryPage
Dec 29, 2025
03241b1
refactor: update PostList component to improve link structure and sty…
Dec 29, 2025
04862d5
feat: add AI service startup script to deployment workflow, including…
Dec 29, 2025
9ce6ca4
refactor: remove unused AdminInit and PostEditor components, and dele…
Dec 30, 2025
d539564
refactor: remove color and icon fields from category and tag schemas,…
Dec 30, 2025
35038d5
refactor: remove outdated documentation files and add new AI integrat…
Dec 30, 2025
f5ba324
refactor: remove unused error handling and API utility files to strea…
Dec 30, 2025
584e712
feat: add About page and profile content component, showcasing person…
Jan 4, 2026
db77979
refactor: update AboutContent component layout and styling, enhance p…
Jan 4, 2026
f24f3f0
feat: introduce image management system for blog, including image upl…
Jan 5, 2026
2e59f02
refactor: remove unused image assets and cover image upload functiona…
Jan 5, 2026
1d67915
docs: expand AI completion design documentation with detailed explana…
Jan 5, 2026
28cd606
docs: enhance documentation on React's useLayoutEffect, detailing its…
Jan 6, 2026
1366955
docs: expand AI completion documentation with detailed sections on im…
Jan 6, 2026
575e535
docs: update AI completion documentation to clarify functional requir…
Jan 6, 2026
52e602a
docs: add comprehensive documentation for AI completion feature in Ma…
Jan 8, 2026
0572155
docs: refine AI completion documentation to focus on the implementati…
Jan 8, 2026
ee23473
docs: enhance RAG流式输出实现 documentation with detailed sections on user …
Jan 8, 2026
f48631d
docs: remove outdated AI completion documentation, streamlining resou…
Jan 8, 2026
03a4e64
feat: add framer-motion library to enhance animation capabilities in …
Jan 9, 2026
3325c32
docs: update README and documentation structure to include new AI ser…
Jan 9, 2026
d281356
feat: update profile form to handle user data more effectively, impro…
Jan 9, 2026
d73c99a
fix: improve error handling in PostList component and refine data fet…
Jan 9, 2026
651e645
chore: remove unused image assets from the public/images directory to…
Jan 9, 2026
fb4ece3
feat: implement a comprehensive image management system for blog post…
Jan 9, 2026
f753db8
feat: add database backup file, create initial blog posts with catego…
Jan 9, 2026
658149d
fix: correct text formatting in loading components and update loading…
Jan 9, 2026
96a68b5
feat: add new cover images for blog posts and enhance layout componen…
Jan 9, 2026
1dd91ba
feat: integrate theme provider into layout components, enhance theme …
Jan 9, 2026
f4fa966
refactor: update AboutContent and AdminProfileCard components with im…
Jan 9, 2026
6a2592d
style: update various components with improved color schemes and styl…
Jan 9, 2026
34835af
chore: remove unused components including PublishDialog, Table, Tabs,…
Jan 9, 2026
40ac1fe
fix: update DELETE and PATCH handlers to await imageId from params pr…
Jan 9, 2026
76a8bb0
feat: add new cover image for post 12312 and update ThemeToggle compo…
Jan 9, 2026
339a7b3
refactor: enhance PublishDialog and related components with improved …
Jan 9, 2026
9948fb5
refactor: remove CoverImageField from PublishDialog and adjust layout…
Jan 9, 2026
dad7a0c
refactor: simplify ProfileForm and AdminProfileCard components by rem…
Jan 9, 2026
e2196ae
refactor: adjust layout in Home and PublicLayout components for impro…
Jan 9, 2026
1db574a
refactor: update GET handler in post route to await params promise fo…
Jan 9, 2026
f051bc7
refactor: add session check before updating user data in ProfileForm …
Jan 9, 2026
33b767e
style(文章详情): 重构详情页结构&样式以保持与首页一致
Jan 10, 2026
8865e15
feat: integrate DeleteConfirmDialog and AdminLoading components acros…
Jan 10, 2026
34bc0b5
feat: add AI and ChromaDB configuration options to ecosystem.config.j…
Jan 10, 2026
023731e
chore: remove outdated README and AI Agent documentation to streamlin…
Jan 10, 2026
9370137
chore: remove outdated AI and frontend documentation to declutter pro…
Jan 10, 2026
17cb954
chore: update avatar image format and replace outdated user informati…
Jan 10, 2026
97ae6bb
feat: add comprehensive AI knowledge base and prompt engineering docu…
Jan 10, 2026
13fa9ee
fix: update image links in AI documentation to use local paths for be…
Jan 10, 2026
03742b2
feat: add new images for vibe coding section to enhance visual content
Jan 10, 2026
cebf9b6
fix: update image paths in AI documentation to use local resources fo…
Jan 10, 2026
1bc327d
feat: implement scroll detection and update header styling in PublicL…
Jan 10, 2026
9fbb08c
feat: add new images and enhance About page layout with improved cont…
Jan 10, 2026
9e414db
feat: enhance SeasonalBackground component with theme-based rendering…
Jan 10, 2026
f1b37a5
feat: add multiple new images to the broken images directory for enha…
Jan 10, 2026
ad8484b
feat: add comprehensive guide for building an AI-powered blog with Ne…
Jan 10, 2026
e7a0046
feat: update README.md to enhance project overview, add detailed feat…
Jan 10, 2026
2101b74
fix: update image references in AI documentation for accuracy and cla…
Jan 10, 2026
11cdf8a
feat: enhance AI blog documentation with additional project details, …
Jan 10, 2026
9253e03
feat: update seed script to use slugs for category and tag upserts, e…
Jan 10, 2026
1869af6
chore: remove unused category entry from seed script to streamline da…
Jan 10, 2026
30d97e7
chore: remove Tailwind CSS entry from seed script to clean up categor…
Jan 10, 2026
7b85334
feat: add environment variable loading and validation in clear and se…
Jan 12, 2026
34c7e90
feat: add troubleshooting guide for image display issues in productio…
Jan 12, 2026
aa64bfa
feat: add detailed documentation for React-based image export solutio…
Jan 12, 2026
0fac03f
feat: enhance AI Tab completion documentation with detailed project b…
Jan 12, 2026
8567b2e
fix: correct cover image filename in AI Prompt documentation for cons…
Jan 13, 2026
3834411
feat: implement optimized image components for improved loading perfo…
Jan 13, 2026
4cd5503
feat: add support for virtual images in post content and enhance imag…
Jan 13, 2026
208df49
feat: optimize image handling by updating formats, enhancing caching …
Jan 14, 2026
4391556
feat: enable package import optimization for lucide-react in next.con…
Jan 14, 2026
a8c1725
feat: update image handling to support remote cover images, refine up…
Jan 14, 2026
fc0c758
feat: update maximum file size for content images to 2MB across API, …
Jan 14, 2026
90f317d
fix: update cover image URLs in AI documentation to ensure correct di…
Jan 14, 2026
a7091d2
refactor: simplify PublicLayout by removing sidebar prop, update imag…
Jan 14, 2026
7257b55
feat: add sidebar support to PublicLayout for mobile view, integratin…
Jan 14, 2026
6a15169
fix: disable typed routes in production to prevent BUILD_ID issues an…
Jan 15, 2026
d28377e
fix: disable worker threads in next.config.js to prevent build interr…
Jan 15, 2026
b0bcd4b
refactor: update next.config.js to conditionally enable typed routes …
Jan 15, 2026
91a3f15
fix: update cover image URLs in AI documentation to new sources for i…
Jan 15, 2026
c88ae1f
feat: implement cover image editing functionality in ImageManager and…
Jan 15, 2026
acd6d5b
fix: update image paths in AI documentation to correct locations for …
Jan 16, 2026
3af5318
chore: remove outdated My.md and article-template.md files to streaml…
Jan 17, 2026
ae466c7
feat: add new AI and performance documentation templates focusing on …
Jan 17, 2026
76fa711
feat: add new documentation files for React and JavaScript topics, in…
Jan 17, 2026
849af1f
feat: update JavaScript深入系列 documentation with new metadata, improved…
Jan 17, 2026
b9de4ae
chore: remove outdated JavaScript深入系列 documentation files on paramete…
Jan 17, 2026
102adb3
feat: add comprehensive documentation on JavaScript scope, covering l…
Jan 17, 2026
53cf17a
feat: introduce a comprehensive guide on JavaScript execution context…
Jan 17, 2026
47eb65b
feat: add an extensive guide on JavaScript module systems, detailing …
Jan 17, 2026
75c375d
feat: add an in-depth guide on virtual lists, exploring core principl…
Jan 17, 2026
a975512
feat: add comprehensive guides on AI-Native software engineering and …
Jan 17, 2026
ae3ba73
feat: add a detailed guide on the JavaScript event loop, comparing im…
Jan 17, 2026
ab334d3
feat: implement essay post view component and enhance post routing to…
Jan 17, 2026
45259a1
feat: update documentation for various JavaScript and essay topics, a…
Jan 17, 2026
efecaa8
feat: add wallpaper-fetcher skill to batch download and compress scen…
Jan 17, 2026
b33e1aa
feat: introduce cover-image-fixer skill to automatically add cover im…
Jan 17, 2026
058ae48
feat: increase batch size in wallpaper-fetcher skill from 10 to 20, e…
Jan 17, 2026
f648d35
feat: add article-formatter skill to automatically generate frontmatt…
Jan 17, 2026
dfa7a6b
feat: enhance post management by allowing updates to existing article…
Jan 17, 2026
6b645b4
feat: enhance middleware and admin dashboard with improved authentica…
Jan 17, 2026
5d46465
feat: update cover images across various AI, React, and essay templat…
Jan 18, 2026
7879038
refactor: remove tags from React documentation files to streamline co…
Jan 18, 2026
6ec97ba
feat: implement infinite scrolling in post list component to enhance …
Jan 18, 2026
b028213
feat: refactor home page to utilize search parameters for category fi…
Jan 18, 2026
d1a1102
feat: refactor home page to include suspense loading for content and …
Jan 19, 2026
164d7c4
feat: update VibeCoding guide with comprehensive strategies for AI-as…
Jan 19, 2026
b2a650e
feat: add new AI templates for context engineering and Claude Code Sk…
Jan 19, 2026
b652d6c
fix: correct published dates in AI templates for consistency and accu…
Jan 19, 2026
14a6613
chore: remove tags from VibeCoding AI template to streamline content …
Jan 19, 2026
9cad9e1
refactor: adjust padding and margin in PostPage and PublicLayout comp…
Jan 19, 2026
136be26
feat: enhance post import functionality with improved error handling …
Jan 19, 2026
c47e8b8
feat: add slugs to JavaScript documentation templates for improved SE…
Jan 19, 2026
64e8cf2
feat: update publication status and dates for various essay and JavaS…
Jan 19, 2026
ee39f73
feat: update JavaScript documentation template to set publication sta…
Jan 19, 2026
e0d3d0f
feat: update publication dates and descriptions in JavaScript documen…
Jan 19, 2026
d424ea5
feat: update publication dates for JavaScript documentation templates…
Jan 19, 2026
a944e9f
feat: enhance JavaScript documentation template with comprehensive co…
Jan 20, 2026
7ff1da2
feat: consolidate JavaScript module documentation by deleting outdate…
Jan 20, 2026
a7594c2
feat: update React documentation by adding links to relevant articles…
Jan 20, 2026
949ba1c
feat: expand React documentation with detailed explanations of diff s…
Jan 20, 2026
9453f7a
feat: add comprehensive article on React Fiber architecture, detailin…
Jan 20, 2026
8fef37c
feat: enhance React documentation with a comprehensive guide on the D…
Jan 20, 2026
7d1cc73
feat: update React and JavaScript documentation categories to '前端' fo…
Jan 20, 2026
e2172c9
feat: refine JavaScript documentation on execution context, enhancing…
Jan 21, 2026
39fe609
feat: expand JavaScript documentation with a detailed section on CMD …
Jan 22, 2026
82aa633
feat: expand React documentation with a detailed section on virtual D…
Jan 22, 2026
3076d92
feat: enhance React documentation with a detailed comparison of the D…
Jan 22, 2026
c7fd3ca
feat: enhance React documentation by adding a detailed explanation of…
Jan 22, 2026
f4237e2
feat: add comprehensive article on the event loop in JavaScript, deta…
Jan 23, 2026
637b7a2
refactor: simplify OptimizedContentImage component by removing Inters…
Jan 23, 2026
9e170f6
feat: add new essay template reflecting on the challenges and introsp…
Jan 23, 2026
7bf39b7
feat: add comprehensive AI review template covering stream data handl…
Jan 24, 2026
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
51 changes: 51 additions & 0 deletions .claude/skills/article-formatter/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: article-formatter
description: 为指定的 Markdown 文章添加完整的 frontmatter 头信息,包括 title、slug、category、readingTime 等字段。当用户需要格式化文章、添加文章头信息时使用此 Skill。
---

# Markdown 文章格式化器

为 Markdown 文章添加标准的 frontmatter 头信息。

## 功能

- **自动生成标题** - 从内容提取或使用文件名
- **生成 slug** - 自动转换为 URL 友好格式
- **识别分类** - 根据文件所在目录
- **计算阅读时间** - 根据字数自动计算
- **添加封面图** - 可选参数

## 使用方法

```bash
# 格式化文章(不含封面图)
python3 .claude/skills/article-formatter/format.py "docs/templates/essay/article.md"

# 格式化文章(含封面图)
python3 .claude/skills/article-formatter/format.py "docs/templates/essay/article.md" "https://example.com/cover.jpg"
```

## 生成的 Frontmatter

```yaml
---
title: 文章标题
slug: article-slug
published: true
featured: false
category: 分类
publishedAt: 2026-01-18
readingTime: 10
coverImage: https://example.com/cover.jpg # 可选
---
```

## 分类映射

| 目录 | 分类 |
| ------ | ---------- |
| AI/ | ai |
| js/ | javascript |
| React/ | react |
| essay/ | essay |
| 其他 | 目录名小写 |
104 changes: 104 additions & 0 deletions .claude/skills/article-formatter/format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env python3
"""
Markdown 文章格式化器 - 为单篇文章添加 frontmatter
"""

import sys
from pathlib import Path
import re
from datetime import datetime

def generate_slug(text):
"""生成 slug"""
# 移除中文字符,只保留英文、数字
text = re.sub(r'[\u4e00-\u9fff]+', '-', text)
text = text.lower()
text = re.sub(r'[^\w\s-]', '', text)
text = re.sub(r'\s+', '-', text)
text = re.sub(r'-+', '-', text)
text = text.strip('-')
return text if text else 'article'

def extract_title(content):
"""提取标题"""
# 尝试从第一个 # 标题提取
match = re.search(r'^#\s+(.+)$', content, re.MULTILINE)
if match:
return match.group(1).strip()
# 使用第一行
first_line = content.split('\n')[0].strip()
return first_line[:50] if first_line else "未命名文章"

def calculate_reading_time(content):
"""计算阅读时间"""
# 移除 frontmatter
if content.startswith('---'):
end = content.find('---', 3)
if end != -1:
content = content[end+3:]

chinese = len(re.findall(r'[\u4e00-\u9fff]', content))
english = len(re.findall(r'[a-zA-Z]+', content))
return max(1, round((chinese + english) / 400))

def get_category(file_path):
"""从路径获取分类"""
parent = file_path.parent.name
mapping = {'AI': 'ai', 'js': 'javascript', 'React': 'react', 'essay': 'essay'}
return mapping.get(parent, parent.lower())

def add_frontmatter(file_path, cover_image=None):
"""添加 frontmatter"""
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()

# 检查是否已有
if content.startswith('---'):
print(" ⚠️ 已有 frontmatter,跳过")
return False

title = extract_title(content)
slug = generate_slug(title)
category = get_category(file_path)
reading_time = calculate_reading_time(content)
published_at = datetime.fromtimestamp(file_path.stat().st_mtime).strftime('%Y-%m-%d')

# 构建 frontmatter
fm = f"""---
title: {title}
slug: {slug}
published: true
featured: false
category: {category}
publishedAt: {published_at}
readingTime: {reading_time}"""

if cover_image:
fm += f"\ncoverImage: {cover_image}"

fm += "\n---\n\n"

with open(file_path, 'w', encoding='utf-8') as f:
f.write(fm + content)

return True

def main():
if len(sys.argv) < 2:
print("用法: python3 format.py <文章路径> [封面图链接]")
sys.exit(1)

file_path = Path(sys.argv[1])
cover_image = sys.argv[2] if len(sys.argv) > 2 else None

if not file_path.exists():
print(f"❌ 文件不存在: {file_path}")
sys.exit(1)

print(f"📝 {file_path}")

if add_frontmatter(file_path, cover_image):
print(" ✅ 格式化完成")

if __name__ == "__main__":
main()
68 changes: 68 additions & 0 deletions .claude/skills/cover-image-fixer/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: cover-image-fixer
description: 自动检索 docs/templates 目录中没有 coverImage 的 Markdown 文章,并添加封面图链接。当用户需要批量添加封面图、检查缺失封面图时自动使用此 Skill。
---

# 封面图修复器

自动检索并添加文章封面图。

## 功能

- **扫描检测** - 扫描 docs/templates 目录下所有 Markdown 文件
- **识别缺失** - 找出 frontmatter 中没有 coverImage 的文章
- **批量添加** - 为缺失封面图的文章添加链接
- **备份保护** - 修改前自动备份原文件

## 使用方法

```bash
python3 .claude/skills/cover-image-fixer/fix-covers.py "https://your-cover-image-url.com"
```

## 工作流程

```
1. 扫描 docs/templates/**/*.md
2. 解析每个文件的 frontmatter
3. 检查是否包含 coverImage 字段
4. 为缺失的文章添加封面图链接
5. 保存并报告修改结果
```

## Frontmatter 格式

```yaml
---
title: 文章标题
slug: article-slug
date: 2025-01-15
category: 分类
coverImage: https://example.com/cover.jpg ← 需要添加这个
---
```

## 依赖

```bash
pip3 install pyyaml
```

## 示例

```bash
# 添加封面图
python3 .claude/skills/cover-image-fixer/fix-covers.py "https://s41.ax1x.com/2026/01/17/pZyCDTH.jpg"

# 输出示例:
# 📋 扫描 docs/templates 目录...
# 📊 发现 3 篇文章缺少封面图
#
# [1/3] docs/templates/essay/article1.md
# ✅ 已添加封面图
#
# [2/3] docs/templates/js/article2.md
# ✅ 已添加封面图
#
# ✅ 完成! 成功为 3 篇文章添加封面图
```
107 changes: 107 additions & 0 deletions .claude/skills/cover-image-fixer/fix-covers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env python3
"""
封面图修复器 - 自动为缺少 coverImage 的文章添加封面图
"""

import sys
from pathlib import Path
import re

def find_articles_without_cover():
"""查找所有没有 coverImage 的文章"""
templates_dir = Path("docs/templates")
articles = []

for md_file in templates_dir.rglob("*.md"):
with open(md_file, 'r', encoding='utf-8') as f:
content = f.read()

# 检查是否有 frontmatter
if not content.startswith('---'):
continue

# 提取 frontmatter
frontmatter_end = content.find('---', 3)
if frontmatter_end == -1:
continue

frontmatter = content[3:frontmatter_end]

# 检查是否已有 coverImage
if 'coverImage:' not in frontmatter:
articles.append(md_file)

return articles


def add_cover_image(file_path, cover_url):
"""为文章添加封面图"""
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()

# 找到 frontmatter 的结束位置
frontmatter_end = content.find('---', 3)
if frontmatter_end == -1:
return False, "无法找到 frontmatter 结束标记"

# 在 frontmatter 结束前插入 coverImage
before = content[:frontmatter_end]
after = content[frontmatter_end:]

# 检查 frontmatter 中是否有其他字段,决定换行
if before.strip() and not before.rstrip().endswith('\n'):
new_content = before + f"\ncoverImage: {cover_url}\n" + after
else:
new_content = before + f"coverImage: {cover_url}\n" + after

# 写入文件
with open(file_path, 'w', encoding='utf-8') as f:
f.write(new_content)

return True, "成功添加封面图"


def main():
"""主函数"""
if len(sys.argv) < 2:
print("❌ 请提供封面图链接")
print("用法: python3 fix-covers.py \"https://your-cover-image-url.com\"")
sys.exit(1)

cover_url = sys.argv[1].strip()

print("📋 扫描 docs/templates 目录...")

articles = find_articles_without_cover()

if not articles:
print("✅ 所有文章都已有封面图!")
return

print(f"📊 发现 {len(articles)} 篇文章缺少封面图")
print()

success_count = 0
failed_count = 0

for i, article in enumerate(articles, 1):
rel_path = article.relative_to(Path.cwd())
print(f"[{i}/{len(articles)}] {rel_path}")

success, msg = add_cover_image(article, cover_url)

if success:
print(f" ✅ {msg}")
success_count += 1
else:
print(f" ❌ {msg}")
failed_count += 1
print()

print("=" * 50)
print(f"✅ 完成! 成功: {success_count}, 失败: {failed_count}")
print("=" * 50)


if __name__ == "__main__":
main()
Loading