-
Notifications
You must be signed in to change notification settings - Fork 0
fix: redefine daxue sections #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| - id: lunyu | ||
| name: 論語 | ||
| compositionYear: -479 # 孔子没後、弟子たちが編纂 | ||
| sectionLabel: 篇 | ||
| totalSections: 20 | ||
| sections: | ||
| - id: '1' | ||
|
|
@@ -67,6 +68,7 @@ | |
| - id: mengzi | ||
| name: 孟子 | ||
| compositionYear: -300 # 孟子の弟子たちが編纂 | ||
| sectionLabel: 篇 | ||
| totalSections: 14 | ||
| sections: | ||
| - id: '1' | ||
|
|
@@ -115,25 +117,97 @@ | |
| - id: daxue | ||
| name: 大学 | ||
| compositionYear: -450 # 曾子の作とされる | ||
| totalSections: 1 | ||
| sectionLabel: 章 | ||
| totalSections: 6 | ||
| sections: | ||
| - id: '1' | ||
| name: 大学 | ||
| totalChapters: 11 | ||
| name: 第一章 | ||
| totalChapters: 3 | ||
| - id: '2' | ||
| name: 第二章 | ||
| totalChapters: 4 | ||
| - id: '3' | ||
| name: 第三章 | ||
| totalChapters: 1 | ||
| - id: '4' | ||
| name: 第四章 | ||
| totalChapters: 1 | ||
| - id: '5' | ||
| name: 第五章 | ||
| totalChapters: 2 | ||
| - id: '6' | ||
| name: 第六章 | ||
| totalChapters: 4 | ||
|
|
||
| - id: zhongyong | ||
| name: 中庸 | ||
| compositionYear: -430 # 子思の作とされる | ||
| totalSections: 1 | ||
| sectionLabel: 章 | ||
| totalSections: 19 | ||
|
Comment on lines
+120
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Daxue/zhongyong still sectioned 大学・中庸について、section無し(または空セクション)で章を扱える形(A案/B案)になっておらず、複数の命名セクションを導入しています. This does not meet the checklist requirement that UI should be able to treat them as having no sections (or an empty section) without inconsistency. Agent Prompt
|
||
| sections: | ||
| - id: '1' | ||
| name: 中庸 | ||
| totalChapters: 33 | ||
| name: 第一章 | ||
| totalChapters: 1 | ||
| - id: '2' | ||
| name: 第二章 | ||
| totalChapters: 1 | ||
| - id: '3' | ||
| name: 第三章 | ||
| totalChapters: 1 | ||
| - id: '4' | ||
| name: 第四章 | ||
| totalChapters: 1 | ||
| - id: '5' | ||
| name: 第五章 | ||
| totalChapters: 1 | ||
| - id: '6' | ||
| name: 第六章 | ||
| totalChapters: 1 | ||
| - id: '7' | ||
| name: 第七章 | ||
| totalChapters: 1 | ||
| - id: '8' | ||
| name: 第八章 | ||
| totalChapters: 1 | ||
| - id: '9' | ||
| name: 第九章 | ||
| totalChapters: 1 | ||
| - id: '10' | ||
| name: 第十章 | ||
| totalChapters: 1 | ||
| - id: '11' | ||
| name: 第十一章 | ||
| totalChapters: 1 | ||
| - id: '12' | ||
| name: 第十二章 | ||
| totalChapters: 1 | ||
| - id: '13' | ||
| name: 第十三章 | ||
| totalChapters: 1 | ||
| - id: '14' | ||
| name: 第十四章 | ||
| totalChapters: 1 | ||
| - id: '15' | ||
| name: 第十五章 | ||
| totalChapters: 1 | ||
| - id: '16' | ||
| name: 第十六章 | ||
| totalChapters: 1 | ||
| - id: '17' | ||
| name: 第十七章 | ||
| totalChapters: 1 | ||
| - id: '18' | ||
| name: 第十八章 | ||
| totalChapters: 1 | ||
| - id: '19' | ||
| name: 第十九章 | ||
| totalChapters: 1 | ||
|
|
||
| # 五経 | ||
|
|
||
| - id: yijing | ||
| name: 易経 | ||
| sectionLabel: 経 | ||
| totalSections: 2 | ||
| sections: | ||
| - id: '1' | ||
|
|
@@ -145,6 +219,7 @@ | |
|
|
||
| - id: shujing | ||
| name: 書経 | ||
| sectionLabel: 篇 | ||
| totalSections: 4 | ||
| sections: | ||
| - id: '1' | ||
|
|
@@ -162,6 +237,7 @@ | |
|
|
||
| - id: shijing | ||
| name: 詩経 | ||
| sectionLabel: 篇 | ||
| totalSections: 4 | ||
| sections: | ||
| - id: '1' | ||
|
|
@@ -179,6 +255,7 @@ | |
|
|
||
| - id: liji | ||
| name: 礼記 | ||
| sectionLabel: 篇 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. liji section name redundant liji is still defined with a single section whose name equals book.name, which can keep the redundant UI hierarchy (e.g., 礼記 → 礼記 → ...). This does not satisfy the requirement to eliminate consecutive book.name/section.name duplication for 礼記. Agent Prompt
|
||
| totalSections: 1 | ||
| sections: | ||
| - id: '1' | ||
|
|
@@ -187,6 +264,7 @@ | |
|
|
||
| - id: chunqiu | ||
| name: 春秋左氏伝 | ||
| sectionLabel: 篇 | ||
| totalSections: 12 | ||
| sections: | ||
| - id: '1' | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -33,11 +33,12 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> { | |||||
| const section = getSectionById(bookId, sectionId); | ||||||
|
|
||||||
| if (!book || !section) { | ||||||
| return { title: '編が見つかりません' }; | ||||||
| return { title: 'セクションが見つかりません' }; | ||||||
| } | ||||||
|
|
||||||
| const sectionLabel = book.sectionLabel ?? '編'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused variable
🔧 Remove unused variable- const sectionLabel = book.sectionLabel ?? '編';
const title = `${section.name} - ${book.name}`;📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Unused sectionlabel in metadata generateMetadata in the section page declares sectionLabel but never uses it. With Biome linter enabled (recommended rules) and CI running biome check src, this will fail lint and block merges/builds. Agent Prompt
|
||||||
| const title = `${section.name} - ${book.name}`; | ||||||
| const description = `${book.name} ${section.name}の全章を一覧表示。現在${section.chapters.length}/${section.totalChapters}章を収録。孔子の教えを白文と訓読みで学習できます。`; | ||||||
| const description = `${book.name} ${section.name}の全章を一覧表示。現在${section.chapters.length}/${section.totalChapters}章を収録。白文と訓読みで学習できます。`; | ||||||
|
|
||||||
| return createMetadata({ | ||||||
| title, | ||||||
|
|
@@ -63,8 +64,13 @@ export default async function SectionPage({ params }: Props) { | |||||
| const prevUrl = prevSection ? `/books/${bookId}/${prev}` : null; | ||||||
| const nextUrl = nextSection ? `/books/${bookId}/${next}` : null; | ||||||
|
|
||||||
| const prevLabel = prevSection ? `前の編(${prevSection.name})へ` : undefined; | ||||||
| const nextLabel = nextSection ? `次の編(${nextSection.name})へ` : undefined; | ||||||
| const sectionLabel = book.sectionLabel ?? '編'; | ||||||
| const prevLabel = prevSection | ||||||
| ? `前の${sectionLabel}(${prevSection.name})へ` | ||||||
| : undefined; | ||||||
| const nextLabel = nextSection | ||||||
| ? `次の${sectionLabel}(${nextSection.name})へ` | ||||||
| : undefined; | ||||||
|
|
||||||
| return ( | ||||||
| <PageWithSidebar showSidebar={false}> | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Rindrics/izuminokami-kanesada
Length of output: 209
Input directory structure does not match the new daxue and zhongyong section definitions.
The YAML defines daxue with 6 sections and zhongyong with 19 sections, but the input directories contain only
contents/input/daxue/1/1.yamlandcontents/input/zhongyong/1/1.yaml. The content generation script will not find files for sections 2-6 (daxue) and 2-19 (zhongyong), leaving these sections empty. Reorganize the input files to match the new section structure:contents/input/daxue/1/,contents/input/daxue/2/, ...,contents/input/daxue/6/and similarly for zhongyong.🤖 Prompt for AI Agents