元のHTMLファイルと同じ見た目・機能を保ちながら、Hugoで管理できるように移行したプロジェクトです。
KAMUI CODE は、MCP(Model Context Protocol)に準拠した複数のサーバー群を統合的に提供するソリューションのドキュメントサイトです。このプロジェクトは、単一のHTMLファイルから、Hugoの静的サイトジェネレーターを使用した管理しやすい構造に移行されました。
requirement-docs/
├── config.yaml # Hugo設定ファイル(YAML形式)
├── content/
│ └── _index.md # ホームページのフロントマター
├── data/
│ ├── sections.yaml # 全セクションのコンテンツデータ
│ ├── kamui-doc-menus.json
│ ├── mcp_catalog.json
│ ├── mcp_playlists.json
│ └── pages.yaml
├── themes/kamui-docs/ # カスタムテーマ
│ ├── theme.yaml # テーマ設定
│ ├── layouts/
│ │ ├── _default/
│ │ │ └── baseof.html # ベースレイアウト
│ │ ├── index.html # ホームページテンプレート
│ │ └── partials/ # 再利用可能なパーシャル
│ │ ├── sidebar.html
│ │ ├── header.html
│ │ ├── modals.html
│ │ ├── table.html
│ │ ├── image-grid.html
│ │ ├── mermaid.html
│ │ ├── cards.html
│ │ ├── code.html
│ │ ├── dynamic-table.html
│ │ ├── flow-diagram.html
│ │ ├── mcp-section.html
│ │ ├── dynamic-cards.html
│ │ ├── gantt.html
│ │ ├── mermaid-with-caption.html
│ │ ├── design-specs.html
│ │ └── client-samples.html
│ └── static/
│ ├── css/
│ │ └── main.css # 全てのスタイル
│ └── js/
│ └── main.js # 全てのJavaScript
├── static/
│ ├── images/ # 全ての画像ファイル
│ │ ├── journey-discover.png
│ │ ├── journey-explore.png
│ │ ├── journey-compare.png
│ │ ├── journey-trial.png
│ │ ├── journey-purchase.png
│ │ └── ... (その他の画像)
│ └── data/ # JSONデータファイル
│ ├── kamui-doc-menus.json
│ ├── mcp_catalog.json
│ ├── mcp_playlists.json
│ └── menus.json
└── public/ # ビルド出力ディレクトリ
元のHTMLファイルにあった全ての機能が移行されています:
data/sections.yamlで全コンテンツを管理# 開発サーバーを起動(ライブリロード付き)
hugo server
# 別のポートで起動
hugo server -p 8080
# ドラフトも含めて表示
hugo server --buildDrafts
# 本番用ビルド
hugo
# ビルドされたファイルは public/ ディレクトリに出力されます
data/sections.yaml を編集static/images/ に配置sections.yaml に新しいエントリを追加- id: section-id
category: 1
category_name: カテゴリ名
title: セクションタイトル
content: |
マークダウン形式のコンテンツ
images:
- path: /images/example.png
name: 画像名
mermaid: |
graph TD
A --> B
cards:
- title: カードタイトル
badges:
- バッジ1
content: カード内容
dynamic_table:
id: tableId
headers:
- ヘッダー1
- ヘッダー2
data_source: json-data-source
additional_mermaid:
- type: system_architecture
content: |
graph TB
A --> B
custom_html: |
<div class="custom-content">
<!-- カスタムHTMLコンテンツ -->
</div>
design_specs:
colors:
- group: グループ名
swatches:
- name: 色名
color: "#000000"
data/sections.yaml に新しいエントリを追加:
- id: new-section
category: 1
category_name: カテゴリ名
title: 新しいセクション
content: |
マークダウン形式のコンテンツ
- リスト項目1
- リスト項目2
- id: gallery-section
category: 2
category_name: ギャラリー
title: 画像ギャラリー
content: ギャラリーの説明
images:
- path: /images/image1.png
name: 画像1
- path: /images/image2.png
name: 画像2
- id: flow-section
title: フロー図
mermaid: |
graph TD
A[開始] --> B{条件分岐}
B -->|Yes| C[処理1]
B -->|No| D[処理2]
- id: multi-diagram
title: 複数の図
additional_mermaid:
- type: architecture
content: |
graph TB
A --> B
- type: sequence
content: |
sequenceDiagram
A->>B: リクエスト
- id: dynamic-table-section
title: 動的テーブル
dynamic_table:
id: myTable
headers:
- 列1
- 列2
- 列3
data_source: table-data
JavaScriptでデータを提供(main.js):
window.tableData = [
{ col1: "値1", col2: "値2", col3: "値3" },
{ col1: "値4", col2: "値5", col3: "値6" }
];
- id: custom-section
title: カスタムセクション
custom_html: |
<div class="custom-container">
<style>
.custom-container {
background: #f0f0f0;
padding: 20px;
}
/* ダークモード対応 */
[data-theme="dark"] .custom-container {
background: #2a2a2a;
color: #e0e0e0;
}
</style>
<h3>カスタムコンテンツ</h3>
<p>任意のHTMLを記述できます</p>
</div>
- id: cards-section
title: サービス一覧
cards:
- title: サービスA
badges:
- 新機能
- おすすめ
content: サービスAの説明
details:
料金: 月額1,000円
利用制限: なし
- title: サービスB
badges:
- 人気
content: サービスBの説明
- id: code-section
title: 実装例
content: |
以下のコードを使用してください:
```javascript
function example() {
console.log("Hello, KAMUI!");
}
```
Pythonの例:
```python
def example():
print("Hello, KAMUI!")
```
layouts/index.html で条件分岐を追加:
<!-- 特別な処理 -->
<!-- 通常の処理 -->
YAMLでマークアップを定義:
- id: interactive
custom_html: |
<div class="interactive-element">
<button id="myButton">クリック</button>
<div id="result"></div>
</div>
JavaScriptで動作を実装(main.js):
document.addEventListener('DOMContentLoaded', () => {
const button = document.getElementById('myButton');
if (button) {
button.addEventListener('click', () => {
document.getElementById('result').textContent = 'クリックされました!';
});
}
});
- id: responsive-section
custom_html: |
<style>
.responsive-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
@media (max-width: 768px) {
.responsive-grid {
grid-template-columns: 1fr;
}
}
</style>
<div class="responsive-grid">
<div>項目1</div>
<div>項目2</div>
<div>項目3</div>
</div>
/public に設定hugo
git add public/
git commit -m "Build site"
git push
Hugo対応の設定で自動デプロイが可能です。
kamui-gradient-soft-2.png に設定/images/ から始まる絶対パスを使用main.js に集約main.css に全スタイルを記載static/data/ ディレクトリに配置custom_html フィールドで直接記述可能MIT License
KAMUI CODE プロジェクトチーム