Skip to content

Commit 2068443

Browse files
add GitHub issue link to chapter pages for suggesting changes
Each chapter header now has a "Suggest a change" button that opens a pre-filled GitHub issue on project-creed/ethos with the chapter title, URL, and a prompt for the reader's suggestion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8fc6b88 commit 2068443

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

web/app/routes/chapters.$slug.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,27 @@ export default function ChapterPost() {
168168
<div className="flex gap-10">
169169
<article className="min-w-0 flex-1 rounded-2xl border border-[#e1e6f0] bg-white p-7 sm:p-10">
170170
<header className="mb-8 border-b border-[#e1e6f0] pb-8">
171-
<p className="text-[11px] font-medium text-amber-700/70">
172-
Chapter {String(chapter.order).padStart(2, "0")}
173-
</p>
174-
<h1 className="mt-3 text-3xl font-bold leading-tight text-slate-900 sm:text-4xl">
175-
{chapter.title}
176-
</h1>
171+
<div className="flex items-start justify-between gap-4">
172+
<div>
173+
<p className="text-[11px] font-medium text-amber-700/70">
174+
Chapter {String(chapter.order).padStart(2, "0")}
175+
</p>
176+
<h1 className="mt-3 text-3xl font-bold leading-tight text-slate-900 sm:text-4xl">
177+
{chapter.title}
178+
</h1>
179+
</div>
180+
<a
181+
href={`https://github.com/project-creed/ethos/issues/new?title=${encodeURIComponent(`Suggestion: ${chapter.title}`)}&body=${encodeURIComponent(`**Chapter:** ${chapter.title}\n**URL:** https://ethosian.info/chapters/${chapter.slug}\n\n**Suggested change:**\n\n<!-- Describe what you'd like to see changed and why -->`)}&labels=suggestion`}
182+
target="_blank"
183+
rel="noopener noreferrer"
184+
className="mt-1 shrink-0 flex items-center gap-1.5 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-xs font-medium text-slate-500 transition-colors hover:border-slate-300 hover:text-slate-700"
185+
>
186+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="size-3.5">
187+
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" />
188+
</svg>
189+
Suggest a change
190+
</a>
191+
</div>
177192
<p className="mt-3 text-base leading-relaxed text-slate-600">{chapter.description}</p>
178193
</header>
179194

0 commit comments

Comments
 (0)