Replace the Four Pillars page with the Guide to CommunityRule on the Content page Template.
This commit is contained in:
1 parent
bf9ee79c9f
commit
453139c783
17 files changed
+1005
-32
No files matched your search
@@ -59,6 +59,9 @@ npm-cache/
|
|||||||
# Workshop facilitator portraits
|
# Workshop facilitator portraits
|
||||||
!public/assets/marketing/workshops/*.png
|
!public/assets/marketing/workshops/*.png
|
||||||
|
|
||||||
|
# How-it-works flow screens (Figma figures)
|
||||||
|
!public/assets/marketing/how-it-works/*.png
|
||||||
|
|
||||||
# Open Graph 1200×630 share images (`npm run generate:og-images`)
|
# Open Graph 1200×630 share images (`npm run generate:og-images`)
|
||||||
!public/assets/marketing/og-image.png
|
!public/assets/marketing/og-image.png
|
||||||
!public/assets/marketing/og-image-templates.png
|
!public/assets/marketing/og-image-templates.png
|
||||||
|
|||||||
@@ -0,0 +1,284 @@
|
|||||||
|
import type { ReactNode } from "react";
|
||||||
|
import Link from "next/link";
|
||||||
|
import Button from "../../../components/buttons/Button";
|
||||||
|
import Rule from "../../../components/cards/Rule";
|
||||||
|
import type { Category } from "../../../components/cards/Rule";
|
||||||
|
import type { ChipOption } from "../../../components/controls/MultiSelect/MultiSelect.types";
|
||||||
|
import {
|
||||||
|
ASSETS,
|
||||||
|
getAssetPath,
|
||||||
|
howItWorksFigureAssetPath,
|
||||||
|
} from "../../../../lib/assetUtils";
|
||||||
|
import {
|
||||||
|
asHowItWorksGuideBlock,
|
||||||
|
formatHowItWorksByline,
|
||||||
|
howItWorksReadMinutes,
|
||||||
|
howItWorksWikiMarkdown,
|
||||||
|
type HowItWorksGuideBlock,
|
||||||
|
} from "../../../../lib/howItWorksGuide";
|
||||||
|
import type howItWorksPage from "../../../../messages/en/pages/howItWorks.json";
|
||||||
|
import HowItWorksShareRow from "./HowItWorksShareRow";
|
||||||
|
|
||||||
|
type HowItWorksMessages = typeof howItWorksPage;
|
||||||
|
|
||||||
|
const INLINE_LINK = /\[([^\]]+)\]\(([^)]+)\)/g;
|
||||||
|
const LINK_CLASS = "underline decoration-solid underline-offset-2";
|
||||||
|
const ARTICLE_COLUMN_CLASS =
|
||||||
|
"mx-auto flex w-full flex-col gap-[var(--space-800)] text-[var(--color-content-default-primary)] text-medium-paragraph sm:max-w-[390px] sm:text-large-paragraph md:max-w-[472px] lg:max-w-[700px] lg:text-x-large-paragraph xl:max-w-none xl:text-xx-large-paragraph";
|
||||||
|
|
||||||
|
function isSafeHref(href: string): boolean {
|
||||||
|
return (
|
||||||
|
href.startsWith("#") ||
|
||||||
|
(href.startsWith("/") && !href.startsWith("//")) ||
|
||||||
|
href.startsWith("https://") ||
|
||||||
|
href.startsWith("http://") ||
|
||||||
|
href.startsWith("mailto:")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GuideInlineText({ text }: { text: string }) {
|
||||||
|
const nodes: ReactNode[] = [];
|
||||||
|
let lastIndex = 0;
|
||||||
|
let key = 0;
|
||||||
|
|
||||||
|
for (const match of text.matchAll(INLINE_LINK)) {
|
||||||
|
const matchIndex = match.index ?? 0;
|
||||||
|
if (matchIndex > lastIndex) {
|
||||||
|
nodes.push(text.slice(lastIndex, matchIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
const label = match[1];
|
||||||
|
const href = match[2];
|
||||||
|
if (isSafeHref(href)) {
|
||||||
|
const isInternal = href.startsWith("/") && !href.startsWith("//");
|
||||||
|
nodes.push(
|
||||||
|
isInternal ? (
|
||||||
|
<Link key={key} href={href} className={LINK_CLASS}>
|
||||||
|
{label}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<a key={key} href={href} className={LINK_CLASS}>
|
||||||
|
{label}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
);
|
||||||
|
key += 1;
|
||||||
|
} else {
|
||||||
|
nodes.push(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
lastIndex = matchIndex + match[0].length;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastIndex < text.length) {
|
||||||
|
nodes.push(text.slice(lastIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
return nodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
function chipsFromLabels(labels: string[]): ChipOption[] {
|
||||||
|
return labels.map((label) => ({
|
||||||
|
id: label.toLowerCase().replace(/[^a-z0-9]+/g, "-"),
|
||||||
|
label,
|
||||||
|
state: "unselected" as const,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function teamRuleCategories(
|
||||||
|
groups: HowItWorksMessages["teamRule"]["categories"],
|
||||||
|
): Category[] {
|
||||||
|
return [
|
||||||
|
groups.values,
|
||||||
|
groups.communication,
|
||||||
|
groups.membership,
|
||||||
|
groups.decisionMaking,
|
||||||
|
groups.conflictManagement,
|
||||||
|
].map((group) => ({
|
||||||
|
name: group.name,
|
||||||
|
chipOptions: chipsFromLabels(group.chips),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function GuideParagraph({
|
||||||
|
lead,
|
||||||
|
text,
|
||||||
|
}: {
|
||||||
|
lead?: string;
|
||||||
|
text: string;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<p>
|
||||||
|
{lead ? <strong>{lead} </strong> : null}
|
||||||
|
<GuideInlineText text={text} />
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function FlowFigure({
|
||||||
|
src,
|
||||||
|
caption,
|
||||||
|
}: {
|
||||||
|
src: string;
|
||||||
|
caption: string;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<figure className="flex w-full flex-col gap-[var(--space-300)]">
|
||||||
|
<div className="overflow-clip rounded-[var(--radius-400)] border border-[color-mix(in_srgb,var(--color-content-default-primary)_30%,transparent)]">
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element -- flow screen from Figma; one-sentence caption is the accessible name */}
|
||||||
|
<img
|
||||||
|
src={getAssetPath(howItWorksFigureAssetPath(src))}
|
||||||
|
alt=""
|
||||||
|
width={700}
|
||||||
|
height={438}
|
||||||
|
className="h-auto w-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<figcaption className="text-small-paragraph sm:text-medium-paragraph lg:text-large-paragraph">
|
||||||
|
{caption}
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function TeamRuleFigure({
|
||||||
|
page,
|
||||||
|
}: {
|
||||||
|
page: HowItWorksMessages;
|
||||||
|
}) {
|
||||||
|
const { teamRule } = page;
|
||||||
|
return (
|
||||||
|
<figure
|
||||||
|
id="how-it-works-rule-card"
|
||||||
|
className="flex w-full flex-col gap-[var(--space-300)]"
|
||||||
|
>
|
||||||
|
<div className="flex justify-center overflow-clip rounded-[var(--radius-400)] border border-[color-mix(in_srgb,var(--color-content-default-primary)_30%,transparent)] px-[var(--space-400)] py-[var(--space-600)]">
|
||||||
|
<Rule
|
||||||
|
title={teamRule.title}
|
||||||
|
description={teamRule.description}
|
||||||
|
expanded
|
||||||
|
size="L"
|
||||||
|
fluidWidth
|
||||||
|
interactive={false}
|
||||||
|
hideCategoryAddButton
|
||||||
|
descriptionAtBottom
|
||||||
|
backgroundColor="bg-[var(--color-surface-invert-brand-primary)]"
|
||||||
|
className="w-full max-w-[400px]"
|
||||||
|
categories={teamRuleCategories(teamRule.categories)}
|
||||||
|
icon={
|
||||||
|
// eslint-disable-next-line @next/next/no-img-element -- decorative brand mark beside the title
|
||||||
|
<img
|
||||||
|
src={getAssetPath(ASSETS.LOGO)}
|
||||||
|
alt=""
|
||||||
|
width={88}
|
||||||
|
height={88}
|
||||||
|
className="size-full object-contain brightness-0"
|
||||||
|
role="presentation"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<figcaption className="text-small-paragraph sm:text-medium-paragraph lg:text-large-paragraph">
|
||||||
|
{teamRule.caption}
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GuideBlockView({
|
||||||
|
block,
|
||||||
|
page,
|
||||||
|
shareUrl,
|
||||||
|
}: {
|
||||||
|
block: HowItWorksGuideBlock;
|
||||||
|
page: HowItWorksMessages;
|
||||||
|
shareUrl: string;
|
||||||
|
}) {
|
||||||
|
if (block.type === "p") {
|
||||||
|
return <GuideParagraph lead={block.lead} text={block.text} />;
|
||||||
|
}
|
||||||
|
if (block.type === "figure") {
|
||||||
|
return <FlowFigure src={block.src} caption={block.caption} />;
|
||||||
|
}
|
||||||
|
if (block.type === "ruleFigure") {
|
||||||
|
return <TeamRuleFigure page={page} />;
|
||||||
|
}
|
||||||
|
const wikiMarkdown = howItWorksWikiMarkdown(
|
||||||
|
page.banner.title,
|
||||||
|
page.banner.description,
|
||||||
|
shareUrl,
|
||||||
|
);
|
||||||
|
const mailtoHref = `mailto:?subject=${encodeURIComponent(page.banner.title)}&body=${encodeURIComponent(`${page.banner.title}\n${shareUrl}`)}`;
|
||||||
|
return (
|
||||||
|
<HowItWorksShareRow
|
||||||
|
sendLabel={page.share.send}
|
||||||
|
copyLabel={page.share.copyWiki}
|
||||||
|
printLabel={page.share.print}
|
||||||
|
copiedTitle={page.share.copiedTitle}
|
||||||
|
copyFailedTitle={page.share.copyFailedTitle}
|
||||||
|
mailtoHref={mailtoHref}
|
||||||
|
wikiMarkdown={wikiMarkdown}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function HowItWorksGuideBody({
|
||||||
|
page,
|
||||||
|
shareUrl,
|
||||||
|
}: {
|
||||||
|
page: HowItWorksMessages;
|
||||||
|
shareUrl: string;
|
||||||
|
}) {
|
||||||
|
const minutes = howItWorksReadMinutes(page);
|
||||||
|
const byline = formatHowItWorksByline(page, minutes);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={ARTICLE_COLUMN_CLASS}>
|
||||||
|
<p>
|
||||||
|
{byline}
|
||||||
|
<a href="#before-you-start" className={LINK_CLASS}>
|
||||||
|
{page.byline.beforeYouStart}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{page.sections.map((section) => (
|
||||||
|
<section
|
||||||
|
key={section.id}
|
||||||
|
id={section.id}
|
||||||
|
className="flex w-full flex-col gap-[var(--space-600)]"
|
||||||
|
>
|
||||||
|
<h2 className="font-bricolage-grotesque text-large-heading">
|
||||||
|
{section.heading}
|
||||||
|
</h2>
|
||||||
|
{section.blocks.map((block, index) => (
|
||||||
|
<GuideBlockView
|
||||||
|
key={`${section.id}-${index}`}
|
||||||
|
block={asHowItWorksGuideBlock(block)}
|
||||||
|
page={page}
|
||||||
|
shareUrl={shareUrl}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</section>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<div className="flex flex-wrap items-start gap-[var(--space-400)]">
|
||||||
|
<Button
|
||||||
|
buttonType="filled"
|
||||||
|
palette="default"
|
||||||
|
size="medium"
|
||||||
|
href={page.closing.createRuleHref}
|
||||||
|
>
|
||||||
|
{page.closing.createRule}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
buttonType="outline"
|
||||||
|
palette="default"
|
||||||
|
size="medium"
|
||||||
|
href={page.closing.downloadKitHref}
|
||||||
|
>
|
||||||
|
{page.closing.downloadKit}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import Alert from "../../../components/modals/Alert";
|
||||||
|
import Button from "../../../components/buttons/Button";
|
||||||
|
|
||||||
|
type HowItWorksShareRowProps = {
|
||||||
|
sendLabel: string;
|
||||||
|
copyLabel: string;
|
||||||
|
printLabel: string;
|
||||||
|
copiedTitle: string;
|
||||||
|
copyFailedTitle: string;
|
||||||
|
mailtoHref: string;
|
||||||
|
wikiMarkdown: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function HowItWorksShareRow({
|
||||||
|
sendLabel,
|
||||||
|
copyLabel,
|
||||||
|
printLabel,
|
||||||
|
copiedTitle,
|
||||||
|
copyFailedTitle,
|
||||||
|
mailtoHref,
|
||||||
|
wikiMarkdown,
|
||||||
|
}: HowItWorksShareRowProps) {
|
||||||
|
const [status, setStatus] = useState<"idle" | "copied" | "failed">("idle");
|
||||||
|
|
||||||
|
const handleCopy = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(wikiMarkdown);
|
||||||
|
setStatus("copied");
|
||||||
|
} catch {
|
||||||
|
setStatus("failed");
|
||||||
|
}
|
||||||
|
}, [wikiMarkdown]);
|
||||||
|
|
||||||
|
const handlePrint = useCallback(() => {
|
||||||
|
window.print();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex w-full flex-col gap-[var(--space-400)]">
|
||||||
|
<div className="flex flex-wrap items-start gap-[var(--space-300)]">
|
||||||
|
<Button
|
||||||
|
buttonType="outline"
|
||||||
|
palette="default"
|
||||||
|
size="small"
|
||||||
|
href={mailtoHref}
|
||||||
|
>
|
||||||
|
{sendLabel}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
buttonType="outline"
|
||||||
|
palette="default"
|
||||||
|
size="small"
|
||||||
|
onClick={handleCopy}
|
||||||
|
>
|
||||||
|
{copyLabel}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
buttonType="outline"
|
||||||
|
palette="default"
|
||||||
|
size="small"
|
||||||
|
onClick={handlePrint}
|
||||||
|
>
|
||||||
|
{printLabel}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
{status !== "idle" ? (
|
||||||
|
<Alert
|
||||||
|
type="banner"
|
||||||
|
status={status === "copied" ? "positive" : "danger"}
|
||||||
|
size="s"
|
||||||
|
title={status === "copied" ? copiedTitle : copyFailedTitle}
|
||||||
|
hasBodyText={false}
|
||||||
|
onClose={() => setStatus("idle")}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
import messages from "../../../messages/en/index";
|
import messages from "../../../messages/en/index";
|
||||||
import { getAllBlogPosts } from "../../../lib/content";
|
import { getRelatedBlogPosts } from "../../../lib/content";
|
||||||
import {
|
import {
|
||||||
buildHowItWorksSyntheticPost,
|
buildHowItWorksSyntheticPost,
|
||||||
HOW_IT_WORKS_SENTINEL_SLUG,
|
HOW_IT_WORKS_SENTINEL_SLUG,
|
||||||
@@ -15,6 +15,7 @@ import { absoluteSiteUrl, routeMetadata } from "../../../lib/siteMetadata";
|
|||||||
import ContentBanner from "../../components/sections/ContentBanner";
|
import ContentBanner from "../../components/sections/ContentBanner";
|
||||||
import ContentTemplateDecorativeShapes from "../_components/ContentTemplateDecorativeShapes";
|
import ContentTemplateDecorativeShapes from "../_components/ContentTemplateDecorativeShapes";
|
||||||
import AskOrganizer from "../../components/sections/AskOrganizer";
|
import AskOrganizer from "../../components/sections/AskOrganizer";
|
||||||
|
import HowItWorksGuideBody from "./_components/HowItWorksGuideBody";
|
||||||
import "../blog/blog.css";
|
import "../blog/blog.css";
|
||||||
|
|
||||||
const RelatedArticles = dynamic(
|
const RelatedArticles = dynamic(
|
||||||
@@ -48,10 +49,14 @@ export default async function HowItWorksPage() {
|
|||||||
const origin = await getRequestSiteOrigin();
|
const origin = await getRequestSiteOrigin();
|
||||||
const page = messages.pages.howItWorks;
|
const page = messages.pages.howItWorks;
|
||||||
const syntheticPost = buildHowItWorksSyntheticPost(page);
|
const syntheticPost = buildHowItWorksSyntheticPost(page);
|
||||||
|
const shareUrl = absoluteSiteUrl("/how-it-works", origin);
|
||||||
|
|
||||||
const allPosts = getAllBlogPosts();
|
const relatedPosts = getRelatedBlogPosts(
|
||||||
const relatedPosts = allPosts.slice(0, 8);
|
HOW_IT_WORKS_SENTINEL_SLUG,
|
||||||
const slugOrder = allPosts.map((post) => post.slug);
|
page.relatedSlugs,
|
||||||
|
3,
|
||||||
|
);
|
||||||
|
const slugOrder = page.relatedSlugs;
|
||||||
|
|
||||||
const askOrganizerData = {
|
const askOrganizerData = {
|
||||||
title: messages.pages.home.askOrganizer.title,
|
title: messages.pages.home.askOrganizer.title,
|
||||||
@@ -64,7 +69,7 @@ export default async function HowItWorksPage() {
|
|||||||
"@type": "WebPage",
|
"@type": "WebPage",
|
||||||
name: page.banner.title,
|
name: page.banner.title,
|
||||||
description: messages.metadata.howItWorks.description,
|
description: messages.metadata.howItWorks.description,
|
||||||
url: absoluteSiteUrl("/how-it-works", origin),
|
url: shareUrl,
|
||||||
publisher: {
|
publisher: {
|
||||||
"@type": "Organization",
|
"@type": "Organization",
|
||||||
name: "CommunityRule",
|
name: "CommunityRule",
|
||||||
@@ -86,7 +91,7 @@ export default async function HowItWorksPage() {
|
|||||||
"@type": "ListItem",
|
"@type": "ListItem",
|
||||||
position: 2,
|
position: 2,
|
||||||
name: page.banner.title,
|
name: page.banner.title,
|
||||||
item: absoluteSiteUrl("/how-it-works", origin),
|
item: shareUrl,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -113,10 +118,7 @@ export default async function HowItWorksPage() {
|
|||||||
<ContentTemplateDecorativeShapes variant="guide" />
|
<ContentTemplateDecorativeShapes variant="guide" />
|
||||||
|
|
||||||
<article className="relative z-10 p-[var(--space-600)] sm:py-[var(--space-800)] xl:px-[calc(268/1440*100%)]">
|
<article className="relative z-10 p-[var(--space-600)] sm:py-[var(--space-800)] xl:px-[calc(268/1440*100%)]">
|
||||||
<div
|
<HowItWorksGuideBody page={page} shareUrl={shareUrl} />
|
||||||
className="post-body text-[var(--color-content-default-primary)] text-medium-paragraph sm:text-large-paragraph lg:text-x-large-paragraph xl:text-xx-large-paragraph sm:mx-auto sm:max-w-[390px] md:max-w-[472px] lg:max-w-[700px] xl:max-w-none"
|
|
||||||
dangerouslySetInnerHTML={{ __html: syntheticPost.htmlContent }}
|
|
||||||
/>
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public/
|
|||||||
icons/ # UI chrome (close, help) + FeatureGrid card glyphs
|
icons/ # UI chrome (close, help) + FeatureGrid card glyphs
|
||||||
logos/ # Brand + social lockups
|
logos/ # Brand + social lockups
|
||||||
partners/ # Logo wall partner SVGs (kebab org slug)
|
partners/ # Logo wall partner SVGs (kebab org slug)
|
||||||
marketing/ # Hero, OG share images, feature panels, section numbers, avatars, banners, book cover
|
marketing/ # Hero, OG share images, feature panels, section numbers, avatars, banners, book cover, how-it-works flow screens
|
||||||
case-study/ # CaseStudy card SVG artwork (canonical)
|
case-study/ # CaseStudy card SVG artwork (canonical)
|
||||||
shapes/ # Decorative ornaments (stats, quotes, unions, content shapes)
|
shapes/ # Decorative ornaments (stats, quotes, unions, content shapes)
|
||||||
vector/ # Use-case group marks
|
vector/ # Use-case group marks
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ export function featurePanelPath(key: FeaturePanelKey): string {
|
|||||||
return `assets/marketing/feature-${key}.svg`;
|
return `assets/marketing/feature-${key}.svg`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Flow-screen figures on `/how-it-works`. */
|
||||||
|
export function howItWorksFigureAssetPath(slug: string): string {
|
||||||
|
return `assets/marketing/how-it-works/${slug}.png`;
|
||||||
|
}
|
||||||
|
|
||||||
/** Feature-grid card glyphs in `public/assets/icons/` (Figma **18632:10668**). */
|
/** Feature-grid card glyphs in `public/assets/icons/` (Figma **18632:10668**). */
|
||||||
export type FeatureIconKey =
|
export type FeatureIconKey =
|
||||||
| "git-branch"
|
| "git-branch"
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
import type howItWorksPage from "../messages/en/pages/howItWorks.json";
|
||||||
|
|
||||||
|
const HOW_IT_WORKS_WORDS_PER_MINUTE = 200;
|
||||||
|
|
||||||
|
type HowItWorksMessages = typeof howItWorksPage;
|
||||||
|
|
||||||
|
export type HowItWorksGuideBlock =
|
||||||
|
| { type: "p"; lead?: string; text: string }
|
||||||
|
| { type: "figure"; src: string; caption: string }
|
||||||
|
| { type: "ruleFigure" }
|
||||||
|
| { type: "shareRow" };
|
||||||
|
|
||||||
|
const MARKDOWN_LINK = /\[([^\]]+)\]\(([^)]+)\)/g;
|
||||||
|
|
||||||
|
export function asHowItWorksGuideBlock(
|
||||||
|
block: HowItWorksMessages["sections"][number]["blocks"][number],
|
||||||
|
): HowItWorksGuideBlock {
|
||||||
|
return block as HowItWorksGuideBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function stripGuideMarkup(text: string): string {
|
||||||
|
return text.replace(MARKDOWN_LINK, "$1");
|
||||||
|
}
|
||||||
|
|
||||||
|
function blockPlainText(
|
||||||
|
block: HowItWorksGuideBlock,
|
||||||
|
caption: string,
|
||||||
|
): string {
|
||||||
|
if (block.type === "p") {
|
||||||
|
return [block.lead, block.text].filter(Boolean).join(" ");
|
||||||
|
}
|
||||||
|
if (block.type === "figure") {
|
||||||
|
return block.caption;
|
||||||
|
}
|
||||||
|
if (block.type === "ruleFigure") {
|
||||||
|
return caption;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Visible guide copy used to set the byline read time. */
|
||||||
|
export function collectHowItWorksGuideText(page: HowItWorksMessages): string {
|
||||||
|
const parts: string[] = [];
|
||||||
|
for (const section of page.sections) {
|
||||||
|
parts.push(section.heading);
|
||||||
|
for (const block of section.blocks) {
|
||||||
|
parts.push(
|
||||||
|
blockPlainText(asHowItWorksGuideBlock(block), page.teamRule.caption),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stripGuideMarkup(parts.filter(Boolean).join(" "));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function howItWorksReadMinutes(page: HowItWorksMessages): number {
|
||||||
|
const words = collectHowItWorksGuideText(page)
|
||||||
|
.trim()
|
||||||
|
.split(/\s+/)
|
||||||
|
.filter(Boolean).length;
|
||||||
|
return Math.max(1, Math.round(words / HOW_IT_WORKS_WORDS_PER_MINUTE));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatHowItWorksDate(isoDate: string): string {
|
||||||
|
const date = new Date(`${isoDate}T00:00:00Z`);
|
||||||
|
return new Intl.DateTimeFormat("en-GB", {
|
||||||
|
day: "numeric",
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
timeZone: "UTC",
|
||||||
|
}).format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatHowItWorksByline(
|
||||||
|
page: HowItWorksMessages,
|
||||||
|
minutes: number,
|
||||||
|
): string {
|
||||||
|
return page.byline.template
|
||||||
|
.replace("{author}", page.banner.author)
|
||||||
|
.replace("{date}", formatHowItWorksDate(page.banner.date))
|
||||||
|
.replace("{minutes}", String(minutes));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function howItWorksWikiMarkdown(
|
||||||
|
title: string,
|
||||||
|
description: string,
|
||||||
|
url: string,
|
||||||
|
): string {
|
||||||
|
return `[${title}](${url})\n\n${description}`;
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import type { BlogPost } from "./content";
|
import type { BlogPost } from "./content";
|
||||||
import { markdownToHtml } from "./content";
|
|
||||||
import type howItWorksPage from "../messages/en/pages/howItWorks.json";
|
import type howItWorksPage from "../messages/en/pages/howItWorks.json";
|
||||||
|
|
||||||
export const HOW_IT_WORKS_SENTINEL_SLUG = "__how-it-works__";
|
export const HOW_IT_WORKS_SENTINEL_SLUG = "__how-it-works__";
|
||||||
@@ -8,12 +7,12 @@ type HowItWorksMessages = typeof howItWorksPage;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds a {@link BlogPost}-shaped object for static marketing pages that reuse
|
* Builds a {@link BlogPost}-shaped object for static marketing pages that reuse
|
||||||
* blog article chrome (`ContentBanner`, `.post-body`) without a markdown file.
|
* blog article chrome (`ContentBanner`) without a markdown file.
|
||||||
*/
|
*/
|
||||||
export function buildHowItWorksSyntheticPost(
|
export function buildHowItWorksSyntheticPost(
|
||||||
page: HowItWorksMessages,
|
page: HowItWorksMessages,
|
||||||
): BlogPost {
|
): BlogPost {
|
||||||
const { banner, bodyMarkdown } = page;
|
const { banner } = page;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
slug: HOW_IT_WORKS_SENTINEL_SLUG,
|
slug: HOW_IT_WORKS_SENTINEL_SLUG,
|
||||||
@@ -23,8 +22,8 @@ export function buildHowItWorksSyntheticPost(
|
|||||||
author: banner.author,
|
author: banner.author,
|
||||||
date: banner.date,
|
date: banner.date,
|
||||||
},
|
},
|
||||||
content: bodyMarkdown,
|
content: "",
|
||||||
htmlContent: markdownToHtml(bodyMarkdown),
|
htmlContent: "",
|
||||||
filePath: "messages/en/pages/howItWorks.json",
|
filePath: "messages/en/pages/howItWorks.json",
|
||||||
lastModified: new Date(banner.date),
|
lastModified: new Date(banner.date),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"howItWorks": {
|
"howItWorks": {
|
||||||
"title": "A Guide to CommunityRule",
|
"title": "When your community sits down to write its Rule",
|
||||||
"description": "Sketch your Rule in CommunityRule, then make it your community's own over five short meetings.",
|
"description": "Sketch your Rule in CommunityRule, then make it your community's own over five short meetings.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"how it works",
|
"how it works",
|
||||||
|
|||||||
@@ -1,12 +1,376 @@
|
|||||||
{
|
{
|
||||||
|
"_comment": "Guide to CommunityRule on /how-it-works. Banner, byline, sections, figures and closing buttons follow the Figma Content page Template frame.",
|
||||||
"banner": {
|
"banner": {
|
||||||
"title": "A Guide to CommunityRule",
|
"title": "When your community sits down to write its Rule",
|
||||||
"description": "Sketch your Rule in CommunityRule, then make it your community's own over five short meetings.",
|
"description": "Sketch your Rule in CommunityRule, then make it your community's own over five short meetings.",
|
||||||
"author": "CommunityRule",
|
"author": "CommunityRule Creative Team",
|
||||||
"date": "2026-01-15"
|
"date": "2027-02-18"
|
||||||
|
},
|
||||||
|
"byline": {
|
||||||
|
"template": "By {author}. {date}. {minutes} minute read. ",
|
||||||
|
"beforeYouStart": "Before you start"
|
||||||
},
|
},
|
||||||
"relatedArticles": {
|
"relatedArticles": {
|
||||||
"title": "Related articles"
|
"title": "Related articles"
|
||||||
},
|
},
|
||||||
"bodyMarkdown": "Whether you organize a mutual aid network, manage an open-source project, or run a worker-owned cooperative, unwritten rules are a liability. Implicit structures cause volunteer burnout, endless meetings, and shadow hierarchies where the loudest voices quietly hold the most power.\n\nCommunityRule makes the implicit explicit. It is a modular governance toolkit providing a library of proven patterns that you can mix, match, and export to keep your community safe, equitable, and highly functional.\n\n**How the Platform Works: From Chaos to Clarity**\n\nThe CommunityRule experience is a guided drafting process that takes you from a blank page to a fully functioning governance document.\n\nYou begin by selecting an organizational archetype that matches your mission. The tool then recommends a baseline set of governance patterns. For instance, a mutual aid group receives recommendations prioritized for rapid physical safety, while an open-source project sees patterns optimized for asynchronous code review and protecting maintainer bandwidth.\n\nNext, you customize. You are never locked into a template. You can explore the pattern library to swap out tools, adjust how much authority is granted to different roles, and define your specific safety protocols.\n\nFinally, you export your completed Operating Manual. The platform generates a clean, structured document that you can host on your website, embed in your GitHub repository, or print as a welcome packet for new members. Your group now has a single source of truth.\n\n**The Four Pillars of Governance**\n\nTo build a resilient Operating Manual, you configure settings across four load-bearing pillars. When these are clearly defined, your members are freed from procedural debates and can focus entirely on your shared mission.\n\n**Membership Patterns**\n\nThis pillar defines the boundaries of your community: who is allowed inside, how they join, and what is required to maintain standing.\n\nYou select patterns that align onboarding with your culture. A massive online network might choose an \"Open Access\" pattern to maximize growth, while an activist coalition handling sensitive work might implement \"Exclusionary Vouching,\" requiring new entrants to be personally verified by existing members. Just as importantly, this pillar helps you define clear exit paths. By establishing how members can safely take a leave of absence or transition to an alumni role, you protect the health of the individual and prevent vital institutional knowledge from vanishing when someone burns out.\n\n**Decision-Making Patterns**\n\nThis acts as your organizational engine, defining exactly how proposals turn into executed actions without trapping your group in endless deliberation.\n\nThe key is matching the weight of the decision to the right process. Requiring everyone to vote on daily operations paralyzes a group, but allowing one person to unilaterally change core values destroys trust. You solve this by assigning different patterns to different scopes of work. You might use a \"Do-ocracy\" pattern for administrative tasks, empowering whoever is actually doing the work to make the call without asking permission. For strategic choices, you might implement a \"Supermajority\" pattern, ensuring significant changes have overwhelming buy-in before enactment. This distribution of authority lets your group move fast on the small things and move together on the big things.\n\n**Conflict Management**\n\nConflict is inevitable; toxicity and organizational collapse are preventable. This pillar helps you design repair pathways before a dispute escalates into a crisis.\n\nHealthy communities rely on repair and accountability rather than corporate punishment. You select conflict strategies based on how much external authority is required to solve a problem. For interpersonal friction, \"Restorative Practices\" or \"Peer Mediation\" provide a structured environment and a neutral facilitator, but leave the final resolution to the disputing parties so they co-create their own repair plan. For severe Code of Conduct violations, a \"Conflict Resolution Council\" introduces trusted elders who investigate and issue formal recommendations. Having these patterns pre-selected removes panic and bias from the resolution process.\n\n**Communication Methods**\n\nWhere you talk dictates how you govern. This pillar helps you map your digital and physical infrastructure to ensure you use the right tool for the right conversation.\n\nMixing social banter, secure logistics, and formal voting in one chaotic group chat is a recipe for disaster. You will define the logistics and behavioral norms for each platform your group uses. You might designate Signal strictly for tactical coordination where disappearing messages are mandatory, use Discord for casual onboarding, and reserve a forum like Discourse exclusively for deep, asynchronous policy deliberation.\n\nCrucially, you attach a specific Code oLine truncated
|
"relatedSlugs": [
|
||||||
|
"resolving-active-conflicts",
|
||||||
|
"operational-security-mutual-aid",
|
||||||
|
"making-decisions-without-hierarchy"
|
||||||
|
],
|
||||||
|
"teamRule": {
|
||||||
|
"title": "CommunityRule Creative Team",
|
||||||
|
"description": "We build and maintain CommunityRule for the communities that use it. It is free for every community that wants to write down how it decides.",
|
||||||
|
"caption": "The CommunityRule Creative Team's Rule on one page with its five parts labeled.",
|
||||||
|
"categories": {
|
||||||
|
"values": {
|
||||||
|
"name": "Values",
|
||||||
|
"chips": [
|
||||||
|
"Transparency",
|
||||||
|
"Forkability",
|
||||||
|
"Documentation",
|
||||||
|
"Maintenance",
|
||||||
|
"Voluntarism"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"communication": {
|
||||||
|
"name": "Communication",
|
||||||
|
"chips": [
|
||||||
|
"GitHub / GitLab",
|
||||||
|
"Matrix / Element",
|
||||||
|
"Email distribution list",
|
||||||
|
"How we run meetings"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"membership": {
|
||||||
|
"name": "Membership",
|
||||||
|
"chips": ["Join by contributing", "Companions"]
|
||||||
|
},
|
||||||
|
"decisionMaking": {
|
||||||
|
"name": "Decision-making",
|
||||||
|
"chips": [
|
||||||
|
"Consensus decision-making",
|
||||||
|
"Lazy consensus",
|
||||||
|
"Do-ocracy",
|
||||||
|
"Changing this Rule"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"conflictManagement": {
|
||||||
|
"name": "Conflict management",
|
||||||
|
"chips": ["Conflict ladder", "Hearing panel", "Restorative practices"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"share": {
|
||||||
|
"send": "Send this to your community",
|
||||||
|
"copyWiki": "Copy into your wiki",
|
||||||
|
"print": "Print the card",
|
||||||
|
"copiedTitle": "Copied to clipboard",
|
||||||
|
"copyFailedTitle": "Could not copy"
|
||||||
|
},
|
||||||
|
"closing": {
|
||||||
|
"createRule": "Create rule",
|
||||||
|
"createRuleHref": "/create/informational",
|
||||||
|
"downloadKit": "Download the kit",
|
||||||
|
"downloadKitHref": "/kit"
|
||||||
|
},
|
||||||
|
"sections": [
|
||||||
|
{
|
||||||
|
"id": "what-you-will-have-by-the-end",
|
||||||
|
"heading": "What you will have by the end",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "A Rule is a short document your community can read aloud in a few minutes. [Confirm how long a typical Rule runs.] It has five parts. The first part names what your community values and the plain signs that a value is slipping. CommunityRule calls those signs signals of violation. The other four parts say how you talk, who belongs, how you decide and what happens when you disagree. Every community has answers to those four already, written or not."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Here is ours. The CommunityRule Creative Team, the people who build CommunityRule, adopted its own Rule on 30 October 2026. One of its values is Documentation, which pulls against speed. One sign it is slipping is that only one person knows how to deploy. Whoever does the work decides a small change, and anything bigger is approved after 72 hours with no objection."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ruleFigure"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Nobody starts from a blank page. CommunityRule puts cards in front of your community, drawn from a deck of hundreds, and each card is one way to answer a question. A card is a starting text. Your community can rewrite its words or write a card of its own."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "CommunityRule comes from the Media Economies Design Lab at the University of Colorado Boulder and it is free for every community."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "A Rule is an agreement between people and it sits beside your bylaws if you have them. [One line for co-ops on what to do when practice and bylaws differ.]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "what-a-rule-costs",
|
||||||
|
"heading": "What a Rule costs",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "A Rule costs five short meetings and at least one real argument. It also costs somebody some quiet power. Somebody has been making decisions the community never handed them and a Rule takes those back. That person will feel it and it may be you."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "A Rule needs upkeep too. Leave it alone and your community has hidden rules again plus a document that says something else."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "before-you-start",
|
||||||
|
"heading": "Before you start",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Your community settles five things before anyone sketches. Any member can raise them."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Check that your community is not in the middle of a dispute.",
|
||||||
|
"text": "A community in a dispute cannot write fair rules. Everyone is arguing about an outcome and a Rule is about method. Write it after the dispute and start with [the conflict guide's title] for now."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Choose whose email goes in.",
|
||||||
|
"text": "The tool keeps your place in one browser until someone adds an email. That email becomes the login and only that login can change the Rule later. Use your community's shared inbox if it has one. The Rule stays with whichever email logs in, and deleting that account deletes the Rule. If your community has no shared inbox, choose the person on purpose."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Decide where to start.",
|
||||||
|
"text": "Your community can pick card by card, start from one of the thirteen templates or start from a copy of a Rule another community shared with you. On a template's page choose Customize, which shows the template's cards question by question so your community can change what does not fit. The other button, Use without changes, skips the cards. Changing a template is how a community finds out where it differs."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Find what is already written.",
|
||||||
|
"text": "Bring your bylaws or the pinned message in your chat to the first meeting. The screens take a logo or a photo and no documents, so keep them on the table beside the sketch."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Decide what stays out.",
|
||||||
|
"text": "Leave out rosters, meeting places and legal names if your community's work puts people at risk. Every Rule starts private. Only the people you invite can read it until the person who holds the pen turns on a link. A Rule is public and featured only when a group asks us in writing. [Say who can see a draft and an upload and whether a group can delete them.]"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "sketch-it-in-communityrule",
|
||||||
|
"heading": "Sketch it in CommunityRule",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "The screens are the quick part. One or two people can sketch a whole Rule in one sitting, and nothing is shared until you invite people. [Confirm by timing a sketch through the screens.] Answer for the community you are today and pick what is closest to what you do now. The meetings are where your community decides whether to keep it."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "1. Say who you are.",
|
||||||
|
"text": "The first screens ask your community's name, what it does, its kind, how far it reaches, how established it is and how many people have a say in its big decisions. A short screen of yes or no questions follows, such as whether you pay anyone for the work. The answers sort the cards and are never published."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "2. Add a logo and save your progress.",
|
||||||
|
"text": "Add your community's logo or a photo, or skip it. Then add the email your community chose. A login link goes to that address so you can come back to the sketch."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "3. Name your values.",
|
||||||
|
"text": "Pick the values your community already lives by, up to six, or skip them for now and add them later. Each value asks what it means to your community and how you will know you are not living up to it. The second answer is your signals of violation. Keep a value only if your community can say what breaking it looks like."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "figure",
|
||||||
|
"src": "value-dialog",
|
||||||
|
"caption": "A value in CommunityRule with one row for what it means and one for the signs it is slipping."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "The four questions come next, each on its own screen of cards. They run how you talk, who belongs, how you decide and what happens when you disagree. The cards suggested for a community like yours come first, tagged Recommended. See all shows the rest with a search, and no card is hidden. Open a card to read the whole policy and change its words. Each question needs at least one card before you move on, and your community can pick more than one."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "figure",
|
||||||
|
"src": "decisions-deck",
|
||||||
|
"caption": "A screen of cards for how you decide with the suggested cards tagged Recommended."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "4. Say how you talk.",
|
||||||
|
"text": "Start with where your community really makes its decisions. Say so if that is the group chat. One card is Signal. Your community coordinates in encrypted Signal groups with messages that disappear on a timer. Another is Code of conduct. One code covers how members treat each other in every channel, meeting and space."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "5. Say who belongs.",
|
||||||
|
"text": "The cards cover who can join, how they join and what the community asks of a member. One card is Open admission. Anyone who agrees to follow your Rule can join and start on the work the same day. Another is Vouching. Two members who know someone in person vouch for them before they join. Pick the card closest to what your community did the last time someone asked to join. Leave and return lets a member step back for up to six months and come back without starting over."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "6. Say how you decide.",
|
||||||
|
"text": "This question has the most cards. A vote on every small thing stalls a community. One person changing a big thing breaks trust. So pick one card for everyday calls and one for decisions that touch everyone. One card is Do-ocracy. Whoever does the work decides how it gets done. Another is Supermajority rule. A proposal passes only when your community's supermajority share of the active members who vote says yes, such as three quarters. Stop reading cards when one sounds like your last meeting."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "7. Say what happens when you disagree.",
|
||||||
|
"text": "One card is Conflict ladder. The two people talk first, then each brings a friend to negotiate, and the people your community names step in last. Another is Conflict working group. Two to five members named in advance hear what the first steps could not settle and propose a plan the members approve. Pick now while nobody is angry."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "figure",
|
||||||
|
"src": "final-review",
|
||||||
|
"caption": "Final review in CommunityRule with the Rule as one card and a chip for each part."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "8. Read it through.",
|
||||||
|
"text": "This screen shows your Rule as one card with a chip for each card and value. Open a chip to change its words or use a section's add chip to pick another card. A question with no card and a card with no words are flagged. Fix each flag before you go on."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "9. Invite people or finish.",
|
||||||
|
"text": "Enter an email for each person who should read the Rule, or paste a list. Ask before you add anyone. Each person gets a private link by email and can read the Rule. Only the login your community chose can change it. The Rule and its exports never show names. While the Rule is still a sketch choose Finish without inviting. You can invite everyone from your profile at the last meeting."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "10. Finish.",
|
||||||
|
"text": "Your community has a sketch of its Rule. Rules stay private until you share them. Print it or save it as a PDF for the first meeting. A RULE.md file is there for a repo. To change it later, whoever holds the login opens Edit and goes back to the final review."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "turn-the-sketch-into-your-rule",
|
||||||
|
"heading": "Turn the sketch into your Rule",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "A sketch is not a Rule until your community has argued with it. The kit spreads that argument over five short meetings, each inside a meeting you already hold, and any member can run it. The kit is free for volunteer-run groups and it lives at [communityrule.info/kit](/kit)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Before the first meeting book all five and choose who takes the three roles. The facilitator keeps the room on the question and speaks last. The scribe types only what the room agreed and reads it back. The timekeeper calls time. The roles rotate each meeting. Ask everyone to bring one question your community has never asked out loud. Print the worksheets, or use the kit's online board if you meet on a call. Paper is safer for a community whose work puts people at risk."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Every meeting opens the same way. Someone reads aloud the kit's short rule for how the room decides, before the first proposal. Every meeting closes the same way too. In the last 10 minutes the scribe enters what the room agreed, logged in with the address your community chose, while everyone checks the wording. Nothing else goes into CommunityRule."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Meeting 1, 60 minutes.",
|
||||||
|
"text": "Everyone writes one question your community has never asked out loud, without a name, and the facilitator reads them all. Sort them under the four questions and start with the one that has the most. Spend the rest of the meeting on it. Say how it works now, read what your sketch says and agree what you can."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Meetings 2 to 4, 45 minutes each.",
|
||||||
|
"text": "Take one question each, in whatever order your community chooses. Read back what you agreed last time. Then say how it works now, read what the sketch says and what else you could try and agree what you can. Have more time? Take two questions in one 90-minute meeting."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Meeting 5, 45 minutes.",
|
||||||
|
"text": "Start with values while the room is fresh. For each one say what it looks like when it is slipping. Then someone who wrote the least reads the whole draft aloud. Fix anything that sounds wrong while everyone is there. Agree how the draft reaches every member and when objections close."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Send it out.",
|
||||||
|
"text": "Nothing counts until every member has seen the draft and had time to object. Invite every member from your profile so each gets a private link, and send the draft wherever members actually read, not only the main chat. Objections close the day before your next regular meeting, with at least seven days to respond. That meeting decides any objections the way the draft says. If nobody objects in time the Rule counts. Write down the date it took effect."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "when-your-community-gets-stuck",
|
||||||
|
"heading": "When your community gets stuck",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Most meetings stall in one of a few ways and each has a short fix."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Your community splits on a card.",
|
||||||
|
"text": "This is the argument the meetings are for. It costs less now than in the middle of a dispute. Ask what the community did the last time it came up and pick that card. Give the other card a meeting of its own."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Nobody knows the answer.",
|
||||||
|
"text": "Then nobody decided and somebody has been handling it anyway. Ask who dealt with it last time and pick the card closest to what they did. Then ask the community whether to keep doing it that way. Anything your community does not settle can wait and you can add it to your Rule later."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Time runs out.",
|
||||||
|
"text": "Agree what you can, park the rest with a date and keep the full 10 minutes for the close."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "One or two people do all the talking.",
|
||||||
|
"text": "Go around the room once before opening it up. The facilitator speaks last."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "The room starts reliving an old conflict.",
|
||||||
|
"text": "Bring it back to method. Ask what you would want the Rule to say next time."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Only a few people come.",
|
||||||
|
"text": "Go ahead. Sending the draft out is how everyone else gets a say."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "Still stuck?",
|
||||||
|
"text": "Send your question through [Ask an organizer](#ask-organizer). A person will write back within two working days. You can also bring your draft to office hours. The times are at [communityrule.info/kit](/kit)."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "after-it-counts",
|
||||||
|
"heading": "After it counts",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "1. Put it where the next new member will find it.",
|
||||||
|
"text": "That could be the doc new members read or the wall where you meet."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "2. Use it once on purpose.",
|
||||||
|
"text": "Open the Rule the next time a decision comes up. Do what it says."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "3. Set a date to read it again.",
|
||||||
|
"text": "Read the signals aloud and ask whether anyone has seen one. Change the Rule if someone has."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"lead": "4. Tell us what it changed.",
|
||||||
|
"text": "Write to us through [Ask an organizer](#ask-organizer)."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "what-we-are-not-sure-about",
|
||||||
|
"heading": "What we are not sure about",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "We are the lab and the organizers working with it. We rebuilt CommunityRule because of what we learned about the earlier version. Early versions confused people. Many struggled to understand the modules, find the right ones and customize them. Uptake was slow. Many people tried the editor, often alone or in a workshop, and few groups are known to have adopted a Rule and kept it."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Andy DiLallo rebuilt the tool around what we learned. We think the meetings are the rest of the fix, because a community that argued over its Rule is more likely to keep it. We cannot show that yet."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "Tell us how yours went. The form is called [Ask an organizer](#ask-organizer)."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "updates-from-groups",
|
||||||
|
"heading": "Updates from groups",
|
||||||
|
"blocks": [
|
||||||
|
{
|
||||||
|
"type": "p",
|
||||||
|
"text": "[Dated entries from groups. Empty at launch.]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shareRow"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
@@ -24,16 +24,16 @@ const mockBlogPost = {
|
|||||||
const guidePost = {
|
const guidePost = {
|
||||||
slug: "__how-it-works__",
|
slug: "__how-it-works__",
|
||||||
frontmatter: {
|
frontmatter: {
|
||||||
title: "A Guide to CommunityRule",
|
title: "When your community sits down to write its Rule",
|
||||||
description:
|
description:
|
||||||
"CommunityRule is a modular governance toolkit designed to help democratic groups build, customize, and publish their own Operating Manual.",
|
"Sketch your Rule in CommunityRule, then make it your community's own over five short meetings.",
|
||||||
author: "CommunityRule",
|
author: "CommunityRule Creative Team",
|
||||||
date: "2026-01-15",
|
date: "2027-02-18",
|
||||||
},
|
},
|
||||||
content: "",
|
content: "",
|
||||||
htmlContent: "",
|
htmlContent: "",
|
||||||
filePath: "messages/en/pages/howItWorks.json",
|
filePath: "messages/en/pages/howItWorks.json",
|
||||||
lastModified: new Date("2026-01-15"),
|
lastModified: new Date("2027-02-18"),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import "@testing-library/jest-dom/vitest";
|
||||||
|
import { describe, expect, it, vi, beforeEach } from "vitest";
|
||||||
|
import { fireEvent, waitFor } from "@testing-library/react";
|
||||||
|
import {
|
||||||
|
renderWithProviders as render,
|
||||||
|
screen,
|
||||||
|
} from "../utils/test-utils";
|
||||||
|
import HowItWorksShareRow from "../../app/(marketing)/how-it-works/_components/HowItWorksShareRow";
|
||||||
|
|
||||||
|
const writeText = vi.fn().mockResolvedValue(undefined);
|
||||||
|
|
||||||
|
describe("HowItWorksShareRow", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
writeText.mockReset();
|
||||||
|
writeText.mockResolvedValue(undefined);
|
||||||
|
Object.defineProperty(window.navigator, "clipboard", {
|
||||||
|
configurable: true,
|
||||||
|
value: { writeText },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("copies wiki markdown and prints the page", async () => {
|
||||||
|
const print = vi.spyOn(window, "print").mockImplementation(() => {});
|
||||||
|
|
||||||
|
render(
|
||||||
|
<HowItWorksShareRow
|
||||||
|
sendLabel="Send this to your community"
|
||||||
|
copyLabel="Copy into your wiki"
|
||||||
|
printLabel="Print the card"
|
||||||
|
copiedTitle="Copied to clipboard"
|
||||||
|
copyFailedTitle="Could not copy"
|
||||||
|
mailtoHref="mailto:?subject=Guide"
|
||||||
|
wikiMarkdown="[Guide](https://example.com)"
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
screen.getByRole("link", { name: "Send this to your community" }),
|
||||||
|
).toHaveAttribute("href", "mailto:?subject=Guide");
|
||||||
|
|
||||||
|
fireEvent.click(
|
||||||
|
screen.getByRole("button", { name: "Copy into your wiki" }),
|
||||||
|
);
|
||||||
|
await waitFor(() => {
|
||||||
|
expect(writeText).toHaveBeenCalledWith("[Guide](https://example.com)");
|
||||||
|
});
|
||||||
|
expect(screen.getByText("Copied to clipboard")).toBeInTheDocument();
|
||||||
|
|
||||||
|
fireEvent.click(screen.getByRole("button", { name: "Print the card" }));
|
||||||
|
expect(print).toHaveBeenCalled();
|
||||||
|
print.mockRestore();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,6 +3,7 @@ import { screen, waitFor } from "@testing-library/react";
|
|||||||
import { renderWithProviders as render } from "../utils/test-utils";
|
import { renderWithProviders as render } from "../utils/test-utils";
|
||||||
import HowItWorksPage from "../../app/(marketing)/how-it-works/page";
|
import HowItWorksPage from "../../app/(marketing)/how-it-works/page";
|
||||||
import messages from "../../messages/en/index";
|
import messages from "../../messages/en/index";
|
||||||
|
import { howItWorksReadMinutes } from "../../lib/howItWorksGuide";
|
||||||
|
|
||||||
vi.mock("next/dynamic", () => ({
|
vi.mock("next/dynamic", () => ({
|
||||||
default: (importFn) => {
|
default: (importFn) => {
|
||||||
@@ -13,6 +14,10 @@ vi.mock("next/dynamic", () => ({
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
vi.mock("../../lib/requestSiteOrigin", () => ({
|
||||||
|
getRequestSiteOrigin: async () => "https://communityrule.info",
|
||||||
|
}));
|
||||||
|
|
||||||
vi.mock("../../app/components/sections/ContentBanner", () => ({
|
vi.mock("../../app/components/sections/ContentBanner", () => ({
|
||||||
default: ({ post, variant }) => (
|
default: ({ post, variant }) => (
|
||||||
<section data-testid="content-banner" data-variant={variant}>
|
<section data-testid="content-banner" data-variant={variant}>
|
||||||
@@ -32,11 +37,16 @@ vi.mock("../../app/components/sections/AskOrganizer", () => ({
|
|||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
async function renderPage() {
|
||||||
|
const ui = await HowItWorksPage();
|
||||||
|
return render(ui);
|
||||||
|
}
|
||||||
|
|
||||||
describe("HowItWorksPage", () => {
|
describe("HowItWorksPage", () => {
|
||||||
const page = messages.pages.howItWorks;
|
const page = messages.pages.howItWorks;
|
||||||
|
|
||||||
test("renders banner, body sections, related articles, and ask organizer", async () => {
|
test("renders banner, guide sections, related articles, and ask organizer", async () => {
|
||||||
render(<HowItWorksPage />);
|
await renderPage();
|
||||||
|
|
||||||
expect(screen.getByTestId("content-banner")).toBeInTheDocument();
|
expect(screen.getByTestId("content-banner")).toBeInTheDocument();
|
||||||
expect(
|
expect(
|
||||||
@@ -48,6 +58,31 @@ describe("HowItWorksPage", () => {
|
|||||||
);
|
);
|
||||||
expect(screen.getByText(page.banner.description)).toBeInTheDocument();
|
expect(screen.getByText(page.banner.description)).toBeInTheDocument();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
screen.getByRole("heading", { name: "What you will have by the end" }),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
screen.getByRole("heading", { name: "Sketch it in CommunityRule" }),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
screen.getByText(page.teamRule.caption),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
screen.getByRole("link", { name: page.closing.createRule }),
|
||||||
|
).toHaveAttribute("href", page.closing.createRuleHref);
|
||||||
|
expect(
|
||||||
|
screen.getByRole("link", { name: page.closing.downloadKit }),
|
||||||
|
).toHaveAttribute("href", page.closing.downloadKitHref);
|
||||||
|
expect(
|
||||||
|
screen.getByRole("link", { name: page.byline.beforeYouStart }),
|
||||||
|
).toHaveAttribute("href", "#before-you-start");
|
||||||
|
expect(
|
||||||
|
screen.getByText(
|
||||||
|
`By ${page.banner.author}. 18 February 2027. ${howItWorksReadMinutes(page)} minute read.`,
|
||||||
|
{ exact: false },
|
||||||
|
),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.getByTestId("related-articles")).toBeInTheDocument();
|
expect(screen.getByTestId("related-articles")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
@@ -57,15 +92,35 @@ describe("HowItWorksPage", () => {
|
|||||||
screen.getByText(messages.pages.home.askOrganizer.title),
|
screen.getByText(messages.pages.home.askOrganizer.title),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(
|
expect(
|
||||||
screen.getByText(/How the Platform Works: From Chaos to Clarity/),
|
screen.queryByText(/How the Platform Works: From Chaos to Clarity/),
|
||||||
|
).not.toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
screen.queryByText(/The Four Pillars of Governance/),
|
||||||
|
).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("gives each flow screen a one-sentence caption", async () => {
|
||||||
|
await renderPage();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
screen.getByText(
|
||||||
|
"A value in CommunityRule with one row for what it means and one for the signs it is slipping.",
|
||||||
|
),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(
|
expect(
|
||||||
screen.getByText(/mutual aid network, manage an open-source project/),
|
screen.getByText(
|
||||||
|
"A screen of cards for how you decide with the suggested cards tagged Recommended.",
|
||||||
|
),
|
||||||
|
).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
screen.getByText(
|
||||||
|
"Final review in CommunityRule with the Rule as one card and a chip for each part.",
|
||||||
|
),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("clips body ornaments at the page frame and keeps them behind copy", () => {
|
test("clips body ornaments at the page frame and keeps them behind copy", async () => {
|
||||||
const { container } = render(<HowItWorksPage />);
|
const { container } = await renderPage();
|
||||||
|
|
||||||
const page = container.querySelector("div.min-h-screen");
|
const page = container.querySelector("div.min-h-screen");
|
||||||
expect(page).toHaveClass("overflow-x-clip");
|
expect(page).toHaveClass("overflow-x-clip");
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import messages from "../../messages/en/index";
|
||||||
|
import {
|
||||||
|
collectHowItWorksGuideText,
|
||||||
|
formatHowItWorksByline,
|
||||||
|
formatHowItWorksDate,
|
||||||
|
howItWorksReadMinutes,
|
||||||
|
howItWorksWikiMarkdown,
|
||||||
|
} from "../../lib/howItWorksGuide";
|
||||||
|
|
||||||
|
describe("howItWorksGuide", () => {
|
||||||
|
const page = messages.pages.howItWorks;
|
||||||
|
|
||||||
|
it("formats the Figma date and byline from the final text", () => {
|
||||||
|
expect(formatHowItWorksDate(page.banner.date)).toBe("18 February 2027");
|
||||||
|
const minutes = howItWorksReadMinutes(page);
|
||||||
|
expect(minutes).toBeGreaterThanOrEqual(10);
|
||||||
|
expect(formatHowItWorksByline(page, minutes)).toBe(
|
||||||
|
`By CommunityRule Creative Team. 18 February 2027. ${minutes} minute read. `,
|
||||||
|
);
|
||||||
|
expect(collectHowItWorksGuideText(page)).toContain(
|
||||||
|
"A Rule is a short document your community can read aloud in a few minutes.",
|
||||||
|
);
|
||||||
|
expect(collectHowItWorksGuideText(page)).not.toContain("](/kit)");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("builds wiki markdown from the title, description and URL", () => {
|
||||||
|
expect(
|
||||||
|
howItWorksWikiMarkdown(
|
||||||
|
page.banner.title,
|
||||||
|
page.banner.description,
|
||||||
|
"https://communityrule.info/how-it-works",
|
||||||
|
),
|
||||||
|
).toBe(
|
||||||
|
`[${page.banner.title}](https://communityrule.info/how-it-works)\n\n${page.banner.description}`,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user