Skip to content

Feature/jimeng api support#37

Merged
hobbytp merged 15 commits intomainfrom
feature/jimeng-api-support
Nov 20, 2025
Merged

Feature/jimeng api support#37
hobbytp merged 15 commits intomainfrom
feature/jimeng-api-support

Conversation

@hobbytp
Copy link
Copy Markdown
Owner

@hobbytp hobbytp commented Nov 20, 2025

本次拉取请求更新了AI封面生成工作流,并提升了AI生成封面的视觉效果。主要变更包括:将火山引擎计梦设为默认AI图像提供商,更新环境变量配置说明,并为AI生成封面新增了分类渐变色CSS样式。

AI封面生成工作流改进:

  • 将默认AI图像提供商变更为火山引擎计梦,更新支持服务列表,并在Makefile中修订了火山引擎、ModelScope和OpenAI的环境变量配置说明
  • 优化了generate-ai-coversgenerate-covers-for-directory目标中API密钥检查逻辑,改进了错误提示信息,并为所有支持的服务商提供了更清晰的配置指引

AI生成封面视觉增强:

  • assets/css/custom.css中新增.ai-generated-coverCSS样式,包含响应式布局、渐变背景(浅色/深色)、动态遮罩效果,以及封面文字的优化排版样式
  • 为AI生成封面实现了分类专属渐变色背景,可根据内容类型(如论文、技术、项目等)进行视觉区分

…ine API support

- Enhanced the Makefile to include detailed environment variable instructions for Volcengine, ModelScope, and OpenAI.
- Updated the AI cover generation script to check for Volcengine API keys and provide clearer warnings for missing configurations.
- Improved user guidance for setting up necessary API keys, ensuring a smoother experience for users integrating with the Volcengine service.
…ation

- Introduced a new documentation file for the AI cover generation feature, detailing its capabilities and advantages.
- Updated the image generation configuration to support higher resolution outputs (2560x1440).
- Enhanced the prompt optimization logic to better tailor visual elements based on keywords in the title and description.
- Improved error handling for API responses, including specific logging for access denial issues.
- Added functionality to clean up existing cover configurations in front matter before adding new AI-generated cover information.
- Included new generated cover images in the static directory.
- Created a new markdown file for the book "AI原生范式:重构软件与创造力" with detailed sections and topics.
- Updated docker-compose.yml to include additional resource and public directories.
- Modified list.html to streamline page handling in the template.
- Refactored cover-image.html to enhance cover image generation with dynamic styles.
- Added fix_markdown_refs.py script to process markdown references and superscripts.
- Introduced link_references.py script to create links for references in the markdown file.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances the AI cover generation workflow by switching to Volcengine Jimeng as the default AI image provider and improving the visual presentation of AI-generated covers through CSS enhancements.

Key Changes

  • Default AI Provider Switch: Changed from ModelScope to Volcengine Jimeng (即梦) as the default image generation service, with updated API integration including proper datetime handling and error messages
  • Visual Enhancements: Migrated inline styles from templates to a centralized CSS file (custom.css) with category-specific gradient backgrounds and responsive design for AI-generated covers
  • Workflow Improvements: Enhanced the cover generation script to support both file and directory processing, improved front matter cleanup logic, and updated environment variable configuration guidance in the Makefile

Reviewed Changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
scripts/link_references.py New utility script for processing markdown references (contains hardcoded path issue)
scripts/fix_markdown_refs.py New utility script for fixing markdown reference formatting (contains hardcoded path issue)
scripts/ai_cover_generator.py Updated to use Volcengine Jimeng API with improved datetime handling, Chinese prompts, error handling, and directory support
layouts/partials/cover-image.html Refactored to remove inline styles and use CSS classes with dynamic category-based styling
assets/css/custom.css Added comprehensive AI-generated cover styles with gradients, animations, and category-specific themes
docker-compose.yml Optimized by adding volume exclusions and removing performance-impacting flags
config.toml Added ignore files configuration to improve build performance
Makefile Updated help documentation to reflect Volcengine as default provider with clearer configuration examples
content/zh/glm/glm.md Front matter syntax error in opening delimiter
content/zh/imo/imo_2025_gemini_2.5pro.md Updated category metadata
cache/image-generation/generation_cache.json Added cache entries with hardcoded absolute paths
docs/*.md New API documentation files for Jimeng integration (one contains incomplete error message)
layouts/_default/list.html Simplified page collection logic by removing unnecessary union operations
books/ai_native/0.md New book outline document
content/en/gemini_3.html New HTML demonstration page

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/ai_cover_generator.py Outdated
Comment thread cache/image-generation/generation_cache.json Outdated
Comment thread cache/image-generation/generation_cache.json Outdated
Comment thread content/zh/glm/glm.md Outdated
Comment thread scripts/ai_cover_generator.py Outdated
Comment thread scripts/fix_markdown_refs.py Outdated
Comment thread scripts/fix_markdown_refs.py Outdated
Comment thread scripts/fix_markdown_refs.py Outdated
Comment thread scripts/ai_cover_generator.py Outdated
Comment thread scripts/ai_cover_generator.py Outdated
hobbytp and others added 2 commits November 20, 2025 14:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 20, 2025

@hobbytp I've opened a new pull request, #38, to work on those changes. Once the pull request is ready, I'll request review from you.

hobbytp and others added 2 commits November 20, 2025 14:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 20, 2025

@hobbytp I've opened a new pull request, #39, to work on those changes. Once the pull request is ready, I'll request review from you.

hobbytp and others added 8 commits November 20, 2025 14:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…cache

Co-authored-by: hobbytp <4393477+hobbytp@users.noreply.github.com>
Co-authored-by: hobbytp <4393477+hobbytp@users.noreply.github.com>
Fix hardcoded absolute paths in image generation cache
fix: Replace hardcoded Windows path with ISO timestamp in generation cache
@hobbytp hobbytp merged commit 701ef18 into main Nov 20, 2025
@hobbytp hobbytp deleted the feature/jimeng-api-support branch November 20, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants