tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
make heading levels match draft
awarm.space
9 months ago
a51553af
03ca7314
+7
-9
1 changed file
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
page.tsx
+7
-9
app/lish/[did]/[publication]/[rkey]/page.tsx
···
17
import { ThemeProvider } from "components/ThemeManager/ThemeProvider";
18
import { BlobRef, BskyAgent } from "@atproto/api";
19
import { SubscribeWithBluesky } from "app/lish/Subscribe";
0
20
21
export async function generateMetadata(props: {
22
params: Promise<{ publication: string; did: string; rkey: string }>;
···
263
case PubLeafletBlocksHeader.isMain(b.block): {
264
if (b.block.level === 1)
265
return (
266
-
<h2 className={`${className}`}>
267
<TextBlock {...b.block} />
268
-
</h2>
269
);
270
if (b.block.level === 2)
271
return (
272
-
<h3 className={`${className}`}>
273
<TextBlock {...b.block} />
274
-
</h3>
275
);
276
if (b.block.level === 3)
277
return (
278
-
<h4 className={`${className}`}>
279
<TextBlock {...b.block} />
280
-
</h4>
281
);
282
// if (b.block.level === 4) return <h4>{b.block.plaintext}</h4>;
283
// if (b.block.level === 5) return <h5>{b.block.plaintext}</h5>;
···
291
return null;
292
}
293
};
294
-
295
-
const blobRefToSrc = (b: BlobRef["ref"], did: string) =>
296
-
`/api/atproto_images?did=${did}&cid=${(b as unknown as { $link: string })["$link"]}`;
297
298
function ListItem(props: {
299
item: PubLeafletBlocksUnorderedList.ListItem;
···
17
import { ThemeProvider } from "components/ThemeManager/ThemeProvider";
18
import { BlobRef, BskyAgent } from "@atproto/api";
19
import { SubscribeWithBluesky } from "app/lish/Subscribe";
20
+
import { blobRefToSrc } from "src/utils/blobRefToSrc";
21
22
export async function generateMetadata(props: {
23
params: Promise<{ publication: string; did: string; rkey: string }>;
···
264
case PubLeafletBlocksHeader.isMain(b.block): {
265
if (b.block.level === 1)
266
return (
267
+
<h1 className={`${className}`}>
268
<TextBlock {...b.block} />
269
+
</h1>
270
);
271
if (b.block.level === 2)
272
return (
273
+
<h2 className={`${className}`}>
274
<TextBlock {...b.block} />
275
+
</h2>
276
);
277
if (b.block.level === 3)
278
return (
279
+
<h3 className={`${className}`}>
280
<TextBlock {...b.block} />
281
+
</h3>
282
);
283
// if (b.block.level === 4) return <h4>{b.block.plaintext}</h4>;
284
// if (b.block.level === 5) return <h5>{b.block.plaintext}</h5>;
···
292
return null;
293
}
294
};
0
0
0
295
296
function ListItem(props: {
297
item: PubLeafletBlocksUnorderedList.ListItem;