Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

Original prompt

目的:

要件:

  1. ベースブランチ: develop
  2. 新規ブランチ名: feature/giscus-lazy-style
  3. 両PRの良い点を統合した最終実装を作ること。統合の具体方針:
    • build-blog.js: コメントスニペットは記事テンプレート内に直接 <script> を埋め込まず、プレースホルダ
      を出力する実装に統一。
    • data 属性の命名は data-repo, data-repo-id, data-category, data-category-id, data-mapping, data-theme とし、escapeHtml による安全化を行う。
    • createHtml テンプレート内でコメント領域の挿入位置を記事本文の外(関連記事/おすすめの上)に配置。
    • head に assets/css/giscus-comments.css をリンクし、body の最後に assets/js/giscus-loader.js を defer で追加する。
    • client loader 名は giscus-loader.js を採用し、IntersectionObserver を使って遅延読み込みを行う(フォールバックで即時読み込み)。loader は placeholder の data-* を script 要素にコピーして giscus を初期化する。
    • スタイルファイルは assets/css/giscus-comments.css として追加し、.post-comments/.giscus/.giscus-frame に対するカード風スタイル、レスポンシブ、ダークモードに対応。
    • locales: missing keys を補完(comments_title、related_title など)。存在する翻訳キー名の差異があれば最も既存コードに合わせる。
  4. テスト手順を PR の説明に記載すること(環境変数付きのローカルビルド、DOM の確認、loader の動作確認、CSS の見た目確認)。
  5. .env.example を更新して必要な GISCUS 環境変数を追記する。
  6. PR のタイトル: feat(giscus): lazy-load comments + styles, move comments section

追加指示:

期待される成果物:

  • feature/giscus-lazy-style ブランチに統合実装をコミット
  • develop に向けた Draft PR を1つ作成(PR 内容にテスト手順・環境変数・CSP 注意点を記載)

依頼者: BreadMotion (会話内リクエスト)

注: 既にリポジトリに PR #54 と PR #55 の draft が存在します。これらをベースに比較・統合して新しい PR を作成してください。

This pull request was created as a result of the following prompt from Copilot chat.

目的:

要件:

  1. ベースブランチ: develop
  2. 新規ブランチ名: feature/giscus-lazy-style
  3. 両PRの良い点を統合した最終実装を作ること。統合の具体方針:
    • build-blog.js: コメントスニペットは記事テンプレート内に直接 <script> を埋め込まず、プレースホルダ
      を出力する実装に統一。
    • data 属性の命名は data-repo, data-repo-id, data-category, data-category-id, data-mapping, data-theme とし、escapeHtml による安全化を行う。
    • createHtml テンプレート内でコメント領域の挿入位置を記事本文の外(関連記事/おすすめの上)に配置。
    • head に assets/css/giscus-comments.css をリンクし、body の最後に assets/js/giscus-loader.js を defer で追加する。
    • client loader 名は giscus-loader.js を採用し、IntersectionObserver を使って遅延読み込みを行う(フォールバックで即時読み込み)。loader は placeholder の data-* を script 要素にコピーして giscus を初期化する。
    • スタイルファイルは assets/css/giscus-comments.css として追加し、.post-comments/.giscus/.giscus-frame に対するカード風スタイル、レスポンシブ、ダークモードに対応。
    • locales: missing keys を補完(comments_title、related_title など)。存在する翻訳キー名の差異があれば最も既存コードに合わせる。
  4. テスト手順を PR の説明に記載すること(環境変数付きのローカルビルド、DOM の確認、loader の動作確認、CSS の見た目確認)。
  5. .env.example を更新して必要な GISCUS 環境変数を追記する。
  6. PR のタイトル: feat(giscus): lazy-load comments + styles, move comments section

追加指示:

期待される成果物:

  • feature/giscus-lazy-style ブランチに統合実装をコミット
  • develop に向けた Draft PR を1つ作成(PR 内容にテスト手順・環境変数・CSP 注意点を記載)

依頼者: BreadMotion (会話内リクエスト)

注: 既にリポジトリに PR #54 と PR #55 の draft が存在します。これらをベースに比較・統合して新しい PR を作成してください。


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

2 participants