Skip to content

Sorahost/knowledge-base

Repository files navigation

SoraHost ナレッジベース

SoraHost(ゲームサーバーホスティング)向けの公開ドキュメントサイト。要件定義書 (docs/requirements.md)に基づくフルスクラッチ実装。

  • フレームワーク: SvelteKit 5 + adapter-cloudflare
  • 実行環境: Cloudflare Workers(エッジ実行 / 全ページプリレンダリング)
  • Markdown: unified (remark / rehype) — 目次自動生成・シンタックスハイライト
  • 検索: ビルド時に静的インデックス JSON を生成 → クライアントで Fuse.js
  • UI: ダーク × モノスペースの「計器盤 / ターミナル」トーン

開発

npm install
npm run dev        # 開発サーバー(http://localhost:5173)
npm run build      # プロダクションビルド(プリレンダリング)
npm run preview    # ビルド結果をローカル確認
npm run check      # svelte-check による型チェック

コンテンツの追加

content/ 配下に Markdown ファイルを追加するだけで記事になります。 frontmatter で表示情報を指定します。

---
title: 記事タイトル
description: 検索結果・OGP に使われる概要
category: guide          # 省略時は第1階層ディレクトリ名
order: 10                # カテゴリ内の並び順(小さいほど上)
updated: 2026-07-14
tags: [タグ1, タグ2]
---

# 見出し

本文…
  • URL は content/guide/create-server.md/guide/create-server
  • content/faq/index.md/faq(ディレクトリの索引ページ)
  • content/index.md/(トップページ本文)
  • カテゴリの表示名・並び順は src/lib/server/content.tsCATEGORY_LABELS で定義

デプロイ

main への push で GitHub Actions が wrangler deploy を実行します。 以下のシークレットを GitHub リポジトリに設定してください。

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID

手動デプロイは npm run deploy(ローカルで wrangler login 済みの場合)。 カスタムドメイン(例: docs.sorahost.jp)は Cloudflare ダッシュボードの Workers → Custom Domains で紐付けます。

構成

content/                  Markdown コンテンツ
src/
  lib/
    types.ts              記事・ナビの型定義
    server/
      markdown.ts         remark/rehype パイプライン(HTML・目次・全文抽出)
      content.ts          コンテンツ読込・ナビ構築・検索インデックス生成
  routes/
    +layout.svelte        ヘッダー / サイドバー / フッター
    +page.svelte          トップページ
    [...slug]/            記事ページ(パンくず・目次)
    search/               クライアント全文検索
    search-index.json/    検索インデックス(プリレンダリング JSON)

About

ナレッジベース

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors