fix color

This commit is contained in:
2025-06-13 20:15:20 +09:00
parent 36863e4d9f
commit 33c166fa0c
9 changed files with 551 additions and 117 deletions

121
README.md
View File

@ -4,60 +4,62 @@ AI-powered static blog generator with ATProto integration, part of the ai.ai eco
## 🚀 Quick Start
### Basic Blog Setup
### Development Setup
```bash
# 1. Initialize a new blog
ailog init my-blog
# 1. Clone and setup
git clone https://git.syui.ai/ai/log
cd log
# 2. Configure your blog (edit my-blog/config.toml)
[site]
title = "My Blog"
description = "A blog powered by ailog"
base_url = "https://yourdomain.com"
language = "ja"
# 2. Start development services
./run.zsh serve # Blog development server
./run.zsh c # Cloudflare tunnel (log.syui.ai)
./run.zsh o # OAuth web server
./run.zsh co # Comment system monitor
[build]
highlight_code = true
minify = false
[ai]
enabled = true
auto_translate = false
comment_moderation = false
ask_ai = true
provider = "ollama"
model = "gemma3:4b"
host = "https://ollama.yourdomain.com"
system_prompt = "You are a helpful AI assistant trained on this blog's content."
ai_did = "did:plc:your-ai-bot-did"
# 3. Build your blog
ailog build
# 4. Serve locally
ailog serve
# 3. Start Ollama (for Ask AI)
brew install ollama
ollama pull gemma2:2b
OLLAMA_ORIGINS="https://log.syui.ai" ollama serve
```
### ATProto Comment System
### Production Deployment
```bash
# 1. Add OAuth configuration to my-blog/config.toml
[oauth]
json = "client-metadata.json"
redirect = "oauth/callback"
admin = "your-did-here"
collection_comment = "ai.syui.log"
collection_user = "ai.syui.log.user"
# 1. Build static site
hugo
# 2. Build OAuth app
ailog oauth build my-blog
# 2. Deploy to GitHub Pages
git add .
git commit -m "Update blog"
git push origin main
# 3. Authenticate with ATProto
ailog auth init
# 3. Automatic deployment via GitHub Actions
# Site available at: https://yourusername.github.io/repo-name
```
# 4. Start stream monitoring
ailog stream start my-blog
### ATProto Integration
```bash
# 1. OAuth Client Setup (oauth/client-metadata.json)
{
"client_id": "https://log.syui.ai/client-metadata.json",
"client_name": "ai.log Blog System",
"redirect_uris": ["https://log.syui.ai/oauth/callback"],
"scope": "atproto",
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"application_type": "web",
"dpop_bound_access_tokens": true
}
# 2. Comment System Configuration
# Collection: ai.syui.log (comments)
# User Management: ai.syui.log.user (registered users)
# 3. Services
./run.zsh o # OAuth authentication server
./run.zsh co # ATProto Jetstream comment monitor
```
### Development with run.zsh
@ -130,15 +132,30 @@ ai.logは、[Anthropic Docs](https://docs.anthropic.com/)にインスパイア
- **自動TOC**: 右サイドバーに目次を自動生成
- **レスポンシブ**: モバイル・デスクトップ対応
### 🤖 AI統合機能
- **Ask AI**: ローカルLLM(Ollama)による質問応答
- トップページでのみ利用可能
- atproto OAuth認証必須
- Cloudflare Tunnel経由でCORS問題解決済み
- **自動翻訳**: 日本語↔英語の自動生成
- **AI記事強化**: コンテンツの自動改善
- **AIコメント**: 記事への一言コメント生成
- **カスタマイズ可能なAI設定**: system_prompt、ai_did、プロフィール連携
### 🤖 Ask AI機能 ✅
- **ローカルAI**: Ollama(gemma2:2b)による質問応答
- **認証必須**: ATProto OAuth認証でアクセス制御
- **トップページ限定**: ブログコンテンツに特化した回答
- **CORS解決済み**: OLLAMA_ORIGINS設定でクロスオリジン問題解消
- **プロフィール連携**: AIアバターとしてATProtoプロフィール画像表示
- **レスポンス最適化**: 80文字制限+高いtemperatureで多様な回答
- **ローディング表示**: Font Awesomeアイコンによる一行ローディング
### 🔧 Ask AI設定方法
```bash
# 1. Ollama設定
brew install ollama
ollama pull gemma2:2b
# 2. CORS設定で起動
OLLAMA_ORIGINS="https://log.syui.ai" ollama serve
# 3. AI DID設定 (my-blog/templates/base.html)
const aiConfig = {
systemPrompt: 'You are a helpful AI assistant.',
aiDid: 'did:plc:your-ai-bot-did'
};
```
### 🌐 分散SNS連携
- **atproto OAuth**: Blueskyアカウントでログイン