Skip to content

Commit 4d67c63

Browse files
committed
update makefile for change png to webp script and update some blogs
1 parent 0cb020c commit 4d67c63

49 files changed

Lines changed: 244 additions & 48 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: update-word-count
5+
name: Update wordCount/readingTime
6+
entry: python scripts/update_word_count.py --update
7+
language: python
8+
additional_dependencies:
9+
- PyYAML>=6.0
10+
files: ^content/.*\.md$
11+
pass_filenames: true

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: dev build clean stop optimize-images analyze-performance build-measure analyze-content analyze-content-ai full-build full-build-ai validate-architecture generate-covers generate-ai-covers generate-cover-from-photo test-covers generate-covers-for-directory ingest-data help
1+
.PHONY: dev build clean stop optimize-images optimize-one analyze-performance build-measure analyze-content analyze-content-ai full-build full-build-ai validate-architecture generate-covers generate-ai-covers generate-cover-from-photo test-covers generate-covers-for-directory ingest-data help
22

33
# Shell 设置
44
# 让每个配方(target)的所有命令在同一个 shell 中执行,确保 .env 中的导出变量可在后续命令中生效
@@ -42,6 +42,15 @@ optimize-images:
4242
@echo "🖼️ 优化图片资源..."
4343
@cd tools/image-optimization && $(PYTHON_CMD) image_optimizer.py --input-dir ../../static/images --output-dir ../../static/images/optimized
4444

45+
# 优化单个图片
46+
optimize-one:
47+
@if [ -z "$(FILE)" ]; then \
48+
echo "❌ 请指定图片文件: make optimize-one FILE=path/to/image.png"; \
49+
exit 1; \
50+
fi
51+
@echo "🖼️ 优化单个图片: $(FILE)..."
52+
@cd tools/image-optimization && $(PYTHON_CMD) image_optimizer.py --file "../../$(FILE)" --input-dir ../../ --output-dir ../../static/images/optimized --sizes 1024
53+
4554
# 分析性能
4655
analyze-performance:
4756
@echo "📊 分析Hugo性能..."
@@ -318,6 +327,7 @@ help:
318327
@echo ""
319328
@echo "Optimization Tools:"
320329
@echo " make optimize-images Optimize image resources"
330+
@echo " make optimize-one FILE=path/to/img Optimize single image and get MD"
321331
@echo " make test-images Test image optimization (preview mode)"
322332
@echo " make analyze-performance Analyze Hugo performance"
323333
@echo " make performance-report Generate performance report"

assets/css/custom.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ body {
105105

106106
/* Article styling */
107107
.post-single {
108-
max-width: 800px;
108+
/* More responsive width on large screens while keeping readability */
109+
max-width: clamp(820px, 72vw, 1200px);
109110
margin: 0 auto;
110-
padding: 2rem;
111+
padding: clamp(1.25rem, 2vw, 2.5rem);
111112
background-color: var(--color-bg-secondary) !important;
112113
border: 1px solid rgba(148, 163, 184, 0.25);
113114
border-radius: 1.25rem;
@@ -123,8 +124,8 @@ body {
123124

124125
/* Article page in sidebar layout */
125126
.has-sidebar .post-single {
126-
max-width: 900px;
127-
padding: 2rem 3rem;
127+
max-width: clamp(860px, 64vw, 1200px);
128+
padding: clamp(1.25rem, 2vw, 2.5rem) clamp(1.25rem, 2.5vw, 3rem);
128129
}
129130

130131
.post-title {
@@ -623,7 +624,7 @@ body {
623624
grid-template-columns: minmax(0, 1fr) 280px;
624625
gap: 2rem;
625626
align-items: start;
626-
width: min(1100px, 100%);
627+
width: min(1400px, 100%);
627628
margin: 0 auto;
628629
padding: 3rem 2rem 4rem;
629630
box-sizing: border-box;
@@ -645,7 +646,8 @@ body {
645646
.post-layout .post-single {
646647
max-width: none;
647648
margin: 0;
648-
padding: 0;
649+
/* Ensure readable spacing between article border and content */
650+
padding: clamp(1.25rem, 2vw, 2.5rem);
649651
background: var(--color-bg);
650652
}
651653

config/_default/hugo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ themesDir = "themes"
55
defaultContentLanguage = "zh"
66
defaultContentLanguageInSubdir = true
77

8+
# 让 Hugo 对中文/日文/韩文的字数与阅读时间统计更准确
9+
hasCJKLanguage = true
10+
811
enableGitInfo = false
912
enableRobotsTXT = true
1013
buildDrafts = false

content/analysis-dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "Hugo博客内容分析仪表板,展示详细的内容质量统
66
tags: ["分析", "仪表板", "统计", "SEO"]
77
categories: ["ai_tools"]
88
wordCount: 354
9-
readingTime: 2
9+
readingTime: 1
1010

1111
ai_cover: "/images/generated-covers/32500cf38346059b27b1e356631d36b1.webp"
1212
cover:

content/big_companies/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "产品介绍"
33
description: "评测主流AI产品,分析其技术特点"
44
wordCount: 287
5-
readingTime: 2
5+
readingTime: 1
66
---
77

88
这里收录了国内外各大厂的AI产品线相关文章,目的在于洞察各大厂在AI领域的布局。

content/en/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: "Latest Posts"
33
date: 2025-01-01
44
draft: false
5+
wordCount: 0
6+
readingTime: 1
57
---
68

79
Welcome to my AI Blog! Here I share insights on AI development, paper reviews, technical analysis, and projects.

content/en/categories/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
title: "Categories"
33
description: "Browse content by category"
4+
wordCount: 0
5+
readingTime: 1
46
---
57
Browse all content organized by category.

content/posts/welcome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "这是一个专注于AI领域的技术博客,包含论文解读
55
categories: ["公告"]
66
tags: ["AI", "博客", "学习"]
77
wordCount: 265
8-
readingTime: 2
8+
readingTime: 1
99

1010
ai_cover: "/images/generated-covers/97db60b4a4648b6136a485c0bb1d2cdd.webp"
1111
cover:

content/zh/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: "about"
66
description: "谭鹏(Peng Tan) - AI 领域独立研究者与技术博主,专注于大语言模型、多代理系统、上下文工程、Vibe Coding 及 AI 开源生态建设,致力于将前沿技术转化为可落地的工程实践"
77
author: "Peng Tan"
88
wordCount: 770
9-
readingTime: 4
9+
readingTime: 2
1010

1111
ai_cover: "static/images/generated-covers/e8287b7dd66ed751414167457b19e124.webp"
1212
cover:

0 commit comments

Comments
 (0)