Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
82 changes: 38 additions & 44 deletions .kiro/specs/blog-feature/tasks.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,96 @@
# Tasks: Blog/Column Feature

## Task 1: Install vitepress-plugin-blog
## Task 1: 記事データローダーを用意する

### Description
ブログプラグインをインストールする
`createContentLoader` で記事一覧データを生成する。

### Files to modify
- `package.json`
- `docs/blog/posts.data.ts`

### Acceptance criteria
- [ ] `npm install vitepress-plugin-blog` が成功
- [ ] package.json に依存関係が追加される
- [x] `createContentLoader` で `blog/posts/*.md` を読み込む
- [x] 公開フラグでフィルタリングできる
- [x] 日付降順でソートされる

---

## Task 2: Configure blog plugin in VitePress
## Task 2: 記事一覧ページを作成する

### Description
config.mts に blogPlugin を追加し、テーマを設定する
ブログ一覧ページを作成し、タグでフィルタリングできるようにする。

### Files to modify
- `docs/.vitepress/config.mts`
- `docs/.vitepress/theme/index.ts` (新規作成)
- `docs/blog/index.md`

### Acceptance criteria
- [ ] blogPlugin が vite.plugins に追加される
- [ ] theme/index.ts で withBlogTheme が設定される
- [ ] 開発サーバーが正常に起動する
- [x] 記事一覧が表示される
- [x] タグフィルタが利用できる

---

## Task 3: Create blog directory structure
## Task 3: ブログディレクトリ構造を作成する

### Description
ブログ用のディレクトリ構造を作成する
ブログの投稿ディレクトリとサンプル記事を作成する。

### Files to create
- `docs/blog/index.md`
- `docs/blog/posts/` (ディレクトリ)
- `docs/blog/posts/2026-01-26-getting-started-with-isms.md`
- `docs/blog/posts/2026-01-27-risk-assessment-tips.md`
- `docs/blog/posts/2026-01-28-what-is-isms.md`

### Acceptance criteria
- [ ] docs/blog/index.md が BlogIndex コンポーネントを使用
- [ ] docs/blog/posts/ ディレクトリが存在
- [x] frontmatter が正しく設定されている(blogPost: true)
- [x] 記事一覧ページに表示される
- [x] タグが設定されている

---

## Task 4: Update navigation
## Task 4: ナビゲーションを追加する

### Description
ヘッダーナビとサイドバーにブログを追加する
ヘッダーナビとサイドバーにブログを追加する

### Files to modify
- `docs/.vitepress/config.mts`

### Acceptance criteria
- [ ] nav に「ブログ」リンクが追加される
- [ ] sidebar に '/blog/' 設定が追加される
- [ ] ヘッダーからブログページにアクセスできる
- [x] nav に「ブログ」リンクが追加される
- [x] sidebar に '/blog/' 設定が追加される

---

## Task 5: Update OGP image generation
## Task 5: OGP画像生成のカテゴリにブログを追加する

### Description
ブログ記事用の OGP 画像生成設定を追加する
OGP 画像生成設定に blog のカテゴリを追加する。

### Files to modify
- `docs/.vitepress/config.mts`

### Acceptance criteria
- [ ] category.byPathPrefix に 'blog' が追加される
- [ ] ブログ記事の OGP 画像が生成される
- [x] category.byPathPrefix に 'blog' が追加される

---

## Task 6: Create sample blog posts
## Task 6: 機能拡張(未完)

### Description
サンプル記事を2本作成する

### Files to create
- `docs/blog/posts/2026-01-26-getting-started-with-isms.md`
- `docs/blog/posts/2026-01-26-risk-assessment-tips.md`
ブログ機能として未実装の項目を追加する。

### Acceptance criteria
- [ ] frontmatter が正しく設定されている(blogPost: true)
- [ ] 記事一覧ページに表示される
- [ ] タグが設定されている
- [ ] ページネーション
- [ ] 前後記事ナビゲーション
- [ ] 読了時間表示
- [ ] RSS/Atom フィード

---

## Task 7: Verify build and functionality
## Task 7: ビルドと動作確認

### Description
ビルドと機能動作を確認する
ビルドと動作を確認する。

### Commands
- `npm run build`
Expand All @@ -102,10 +99,7 @@ config.mts に blogPlugin を追加し、テーマを設定する
### Acceptance criteria
- [ ] ビルドが成功する
- [ ] 記事一覧ページが表示される
- [ ] タグフィルタリングが動作する
- [ ] 記事詳細ページが表示される
- [ ] 前後記事へのナビゲーションが動作する
- [ ] OGP 画像が生成される

---

Expand All @@ -119,11 +113,11 @@ Task 1 → Task 2 → Task 3 → Task 4 → Task 5 → Task 6 → Task 7

| Task | Effort |
|------|--------|
| Task 1 | 5 min |
| Task 1 | 10 min |
| Task 2 | 15 min |
| Task 3 | 10 min |
| Task 4 | 10 min |
| Task 5 | 5 min |
| Task 6 | 20 min |
| Task 7 | 15 min |
| **Total** | **~80 min** |
| Task 6 | 60 min |
| Task 7 | 20 min |
| **Total** | **~130 min** |
18 changes: 9 additions & 9 deletions .kiro/specs/ogp-generation/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ export default defineConfig({
```

### Acceptance Criteria
- [ ] AC-1.1: og:titleがページごとに自動生成される
- [ ] AC-1.2: og:descriptionがページごとに自動生成される
- [ ] AC-1.3: og:urlがページごとに自動生成される
- [ ] AC-1.4: frontmatterのtitleがog:titleに使用される
- [ ] AC-1.5: frontmatterのdescriptionがog:descriptionに使用される
- [ ] AC-1.6: titleがない場合はサイトデフォルトが使用される
- [ ] AC-2.1: twitter:cardが生成される
- [ ] AC-2.2: twitter:titleが生成される
- [ ] AC-2.3: twitter:descriptionが生成される
- [x] AC-1.1: og:titleがページごとに自動生成される
- [x] AC-1.2: og:descriptionがページごとに自動生成される
- [x] AC-1.3: og:urlがページごとに自動生成される
- [x] AC-1.4: frontmatterのtitleがog:titleに使用される
- [x] AC-1.5: frontmatterのdescriptionがog:descriptionに使用される
- [x] AC-1.6: titleがない場合はサイトデフォルトが使用される
- [x] AC-2.1: twitter:cardが生成される
- [x] AC-2.2: twitter:titleが生成される
- [x] AC-2.3: twitter:descriptionが生成される

---

Expand Down
91 changes: 53 additions & 38 deletions .kiro/specs/ogp-image-generation/tasks.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,73 @@
# Tasks: OGP画像自動生成

## Task 1: vitepress-plugin-og-imageのインストール
## Task 1: @nolebase/vitepress-plugin-og-image の導入

### Description
OGP画像生成用のVitePressプラグインをインストールする
OGP画像生成用プラグインを導入する

### Commands
```bash
npm install vitepress-plugin-og-image -D
npm install @nolebase/vitepress-plugin-og-image -D
```

### Acceptance Criteria
- [ ] package.jsonにvitepress-plugin-og-imageが追加される
- [x] package.jsonに`@nolebase/vitepress-plugin-og-image`が追加される

---

## Task 2: OgImagePluginの設定
## Task 2: buildEnd でOGP画像生成を実行

### Description
config.mtsにOgImagePluginを設定し、buildEndフックで画像を生成する
VitePressの`buildEnd`でOGP画像を生成する

### Files to Modify
- `docs/.vitepress/config.mts`

### Implementation
```typescript
import { OgImagePlugin } from 'vitepress-plugin-og-image'

const ogImagePlugin = new OgImagePlugin({
destDir: '/og',
import { buildEndGenerateOpenGraphImages } from '@nolebase/vitepress-plugin-og-image/vitepress'

export default defineConfig({
// ...
async buildEnd(siteConfig) {
await buildEndGenerateOpenGraphImages({
baseUrl: 'https://isms-guide.com',
category: {
byPathPrefix: [
{ prefix: 'controls', text: '管理策' },
{ prefix: 'requirements', text: '要求事項' },
{ prefix: 'templates', text: 'テンプレート' },
{ prefix: 'glossary', text: '用語集' },
{ prefix: 'about', text: 'サイト情報' },
{ prefix: 'isms/guidelines', text: 'ガイドライン' },
{ prefix: 'isms/policies', text: '方針' },
{ prefix: 'isms/procedures', text: '手順書' },
{ prefix: 'isms/records', text: '記録' },
{ prefix: 'isms/plans', text: '計画書' },
{ prefix: 'isms/registers', text: '台帳' },
{ prefix: 'isms/soa', text: '適用宣言書' },
{ prefix: 'isms/manual', text: 'マニュアル' },
{ prefix: 'blog', text: 'ブログ' },
],
},
maxCharactersPerLine: 12,
svgFontBuffers: [mplus1p],
})(siteConfig)
}
})

export default withMermaid(
defineConfig({
// ... 既存設定

buildEnd(siteConfig) {
ogImagePlugin.buildEnd(siteConfig)
}
})
)
```

### Acceptance Criteria
- [ ] OgImagePluginがインポートされる
- [ ] destDirが'/og'に設定される
- [ ] buildEndフックで画像生成が呼び出される
- [x] buildEndでOGP画像生成が呼び出される
- [x] カテゴリラベルがパスプレフィックスで付与される
- [x] フォントバッファが指定される

---

## Task 3: transformHeadにog:image設定を追加
## Task 3: transformHead に og:image / twitter:image を追加

### Description
既存のtransformHead関数にog:imageとtwitter:imageメタタグを追加する
ページごとにOGP画像のメタタグを出力する

### Files to Modify
- `docs/.vitepress/config.mts`
Expand All @@ -65,21 +80,21 @@ transformHead({ pageData }) {

// ... 既存のOGP設定

// og:image
const ogImageMeta = ogImagePlugin.transformHead({ pageData })
head.push(...ogImageMeta)
const ogImagePath = pageData.relativePath
.replace(/\.md$/, '.png')
.replace(/([^/]+)\.png$/, 'og-$1.png')
const ogImageUrl = `${siteUrl}/${ogImagePath}`

// twitter:image (og:imageと同じURLを使用)
const ogImageUrl = `${siteUrl}/og/${pageData.relativePath.replace(/\.md$/, '.png').replace(/index\.png$/, 'index.png')}`
head.push(['meta', { property: 'og:image', content: ogImageUrl }])
head.push(['meta', { name: 'twitter:image', content: ogImageUrl }])

return head
}
```

### Acceptance Criteria
- [ ] AC-1.4: og:imageメタタグが設定される
- [ ] AC-1.5: twitter:imageメタタグが設定される
- [x] og:imageメタタグが設定される
- [x] twitter:imageメタタグが設定される

---

Expand All @@ -97,12 +112,12 @@ npm run build

2. 画像ディレクトリ確認
```bash
ls -la docs/.vitepress/dist/og/
ls -la docs/.vitepress/dist | rg '^og-'
```

3. 画像仕様確認
```bash
file docs/.vitepress/dist/og/index.png
file docs/.vitepress/dist/og-index.png
```

4. メタタグ確認
Expand All @@ -111,22 +126,22 @@ grep -E 'og:image|twitter:image' docs/.vitepress/dist/index.html
```

### Expected Output
- `/og/`ディレクトリに各ページのPNG画像が生成される
- ルートや各ディレクトリに `og-*.png` が生成される
- 画像サイズは1200x630px
- HTMLに`og:image`と`twitter:image`メタタグが含まれる

### Acceptance Criteria
- [ ] AC-1.1: OGP画像が自動生成される
- [ ] AC-2.1: 画像サイズが1200x630px
- [ ] AC-2.2: 画像形式がPNG
- [ ] AC-2.3: 画像が`/og/`ディレクトリに出力される
- [ ] AC-2.3: `og-*.png` が出力される

---

## Implementation Order

1. **Task 1**: プラグインインストール(2分)
2. **Task 2**: OgImagePlugin設定(10分)
1. **Task 1**: プラグイン導入(2分)
2. **Task 2**: buildEnd設定(10分)
3. **Task 3**: transformHead更新(5分)
4. **Task 4**: ビルド検証(10分)

Expand Down
Loading
Loading