Skip to content

Conversation

@3w36zj6
Copy link
Member

@3w36zj6 3w36zj6 commented Apr 11, 2025

cf. https://github.com/typst-jp/typst-jp.github.io/issues/54

変更点

  • website/Honoのプロジェクトを作成した
  • Hono JSXによる静的サイトジェネレーター (SSG)を実装した
    • テンプレートとマクロはVibe CodingでJinjaからJSXに変換した
    • 型定義を追加した

確認事項

  • bun run devで開発サーバーを利用できる
  • bun run buildでビルドができる
  • bun run previewでビルド結果がプレビューできる

備考

  • このPRはWebサイトを独自のデザインに変更するための前準備であり、元のテンプレートの不完全な実装はそのまま移植している
  • JSXの表現の制約で一部のDOM構造が変化しておりデザインが崩れているが、今後のデザインの変更を見越して修正しない

@3w36zj6 3w36zj6 requested a review from Copilot April 11, 2025 11:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 51 out of 57 changed files in this pull request and generated 5 comments.

Files not reviewed (6)
  • website/.editorconfig: Language not supported
  • website/.gitignore: Language not supported
  • website/package.json: Language not supported
  • website/public/assets/index2ja.json: Language not supported
  • website/public/assets/site.webmanifest: Language not supported
  • website/public/styles/custom.css: Language not supported

return (
<>
{func.params.map((param, index) => (
<div>
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iteration items rendered inside the map are missing a unique 'key' prop. Consider adding a key attribute (e.g. key={index} or a unique identifier) to the top-level element inside the map.

Suggested change
<div>
<div key={param.name}>

Copilot uses AI. Check for mistakes.
<span class="typ-func">{func.name}</span>(
<div class="arguments">
{func.params.map((param, index) => (
<span class="overview-param">
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapped elements for function parameters should include a unique key attribute to ensure stable rendering. Please add a key prop to the root element returned by each iteration.

Suggested change
<span class="overview-param">
<span class="overview-param" key={param.name || index}>

Copilot uses AI. Check for mistakes.
<h2 id="functions">Function</h2>

{content.functions.map((method, index) => (
<div>
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list items rendered inside the map lack a unique key prop. Adding a key attribute will help with element reconciliation during re-renders.

Suggested change
<div>
<div key={method.name || `function-${index}`}>

Copilot uses AI. Check for mistakes.
<h2 id="definitions">定義</h2>
<ul class="subgridded">
{page.body.content.items.map((item) => (
<li>
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each item in the map should have a unique key prop to ensure proper rendering. Please add a key attribute to the

  • element.

    Suggested change
    <li>
    <li key={item.route}>
  • Copilot uses AI. Check for mistakes.
    </h2>

    {content.scope.map((method, index) => (
    <div>
    Copy link

    Copilot AI Apr 11, 2025

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    The iteration over 'content.scope' items is missing a unique key prop. Adding a key attribute to the wrapper element in the map is recommended for stable list rendering.

    Suggested change
    <div>
    <div key={method.name || `method-${index}`}>

    Copilot uses AI. Check for mistakes.
    @kimushun1101
    Copy link
    Member

    ご対応いただきありがとうございます。私が手が出せなかった部分なため大変助かります。

    実行方法について、確認させてください。
    cd website/bun installをすることで、以下のすべてが実行はできました。

    • bun run devで開発サーバーを利用できる
    • bun run buildでビルドができる
    • bun run previewでビルド結果がプレビューできる

    bun run previewではブラウザでの表示ができたのですが、bun run devの方は404 Not Foundになります。
    かんたんに調べたところ、previewの方ではhttp://localhost:4173 から http://localhost:4173/docs/ にリダイレクト(?)されるのに対してdevでは http://localhost:5173 から移らないことが原因でした。URLをhttp://localhost:5173/docs/ に手動で変更すれば動作自体は問題ないと思うのですが、自動で表示してくれると嬉しく思います。

    原因と対策は思いつきますでしょうか?

    @3w36zj6
    Copy link
    Member Author

    3w36zj6 commented Apr 12, 2025

    Trailing Slash Middleware/から/docsへのリダイレクトを追加しました。開発サーバーでの体験は改善されたかと思います。

    Copy link
    Member

    @kimushun1101 kimushun1101 left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    ご対応いただきありがとうございました。無事動作確認ができました。

    @3w36zj6 3w36zj6 force-pushed the feature/migrate-hono-ssg branch from 1687d72 to 0509a83 Compare April 12, 2025 07:01
    @3w36zj6 3w36zj6 merged commit c514876 into main Apr 12, 2025
    3 checks passed
    @3w36zj6 3w36zj6 deleted the feature/migrate-hono-ssg branch April 12, 2025 15:54
    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.

    4 participants