Keep listed published rules public and guest-claim rules unlisted, with semantic document markup and share chrome that stays clickable.

Guest publishes remain share-by-link but stay out of the catalog and sitemap, and their pages send noindex until claimed. The published-rule view now uses heading and list markup matching Markdown export, and top banners sit below the header so Share is not covered.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilalloandCursor committed 2026-09-17 17:42:01 -06:00
1 parent 77b0ec8ad8
commit 1445cb7e1e
27 files changed
+524 -86

No files matched your search

@@ -39,17 +39,20 @@ function CommunityRuleView({
categoryName={ruleSection.categoryName}
showRail={!useCardStyle}
>
{ruleSection.entries.map((entry, entryIndex) => {
const hasBlocks = Boolean(entry.blocks?.length);
return (
<TextBlock
key={entryIndex}
title={entry.title}
body={entry.body}
rows={hasBlocks ? entry.blocks : undefined}
/>
);
})}
<ul className="m-0 flex min-w-0 list-none flex-col gap-6 p-0">
{ruleSection.entries.map((entry, entryIndex) => {
const hasBlocks = Boolean(entry.blocks?.length);
return (
<li key={entryIndex} className="min-w-0">
<TextBlock
title={entry.title}
body={entry.body}
rows={hasBlocks ? entry.blocks : undefined}
/>
</li>
);
})}
</ul>
</Section>
))}
</div>
+8 -5
View File
@@ -21,21 +21,24 @@ function SectionView({
}: SectionProps) {
const inner = (
<div className="flex min-w-0 flex-1 flex-col gap-4" style={{ gap: "16px" }}>
<p className={CATEGORY_CLASS}>{categoryName}</p>
<h2 className={`${CATEGORY_CLASS} m-0`}>{categoryName}</h2>
<div className="flex min-w-0 flex-col gap-6">{children}</div>
</div>
);
if (!showRail) {
return (
<div className={`flex min-w-0 flex-col ${className}`.trim()} data-name="Section">
<section
className={`flex min-w-0 flex-col ${className}`.trim()}
data-name="Section"
>
{inner}
</div>
</section>
);
}
return (
<div
<section
className={`flex min-w-0 items-stretch gap-3 ${className}`.trim()}
style={{ gap: "12px" }}
data-name="Section"
@@ -46,7 +49,7 @@ function SectionView({
aria-hidden
/>
{inner}
</div>
</section>
);
}
@@ -50,7 +50,7 @@ function LabeledRowView({ row }: { row: TextRow }) {
return (
<div className="flex min-w-0 flex-col gap-2">
<p className={ROW_LABEL_CLASS}>{row.label}</p>
<h4 className={`${ROW_LABEL_CLASS} m-0`}>{row.label}</h4>
{imageSrc ? (
<>
{/* eslint-disable-next-line @next/next/no-img-element -- same-origin or absolute upload URL */}
@@ -88,18 +88,24 @@ function TextBlockView({
const hasRows = rows && rows.length > 0;
return (
<div
<article
className={`flex min-w-0 flex-col gap-2 ${className}`.trim()}
data-name="TextBlock"
>
<p className={`${ENTRY_TITLE_CLASS} w-full min-w-0`}>{title}</p>
<h3 className={`${ENTRY_TITLE_CLASS} m-0 w-full min-w-0`}>{title}</h3>
<div className="flex min-w-0 flex-col gap-3">
{body.trim().length > 0 ? <ParagraphGroup text={body} /> : null}
{hasRows
? rows!.map((row, i) => <LabeledRowView key={i} row={row} />)
: null}
{hasRows ? (
<ul className="m-0 flex min-w-0 list-none flex-col gap-3 p-0">
{rows!.map((row, i) => (
<li key={i} className="min-w-0">
<LabeledRowView row={row} />
</li>
))}
</ul>
) : null}
</div>
</div>
</article>
);
}