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
17
import { ThemeProvider } from "components/ThemeManager/ThemeProvider";
18
18
import { BlobRef, BskyAgent } from "@atproto/api";
19
19
import { SubscribeWithBluesky } from "app/lish/Subscribe";
20
20
+
import { blobRefToSrc } from "src/utils/blobRefToSrc";
20
21
21
22
export async function generateMetadata(props: {
22
23
params: Promise<{ publication: string; did: string; rkey: string }>;
···
263
264
case PubLeafletBlocksHeader.isMain(b.block): {
264
265
if (b.block.level === 1)
265
266
return (
266
266
-
<h2 className={`${className}`}>
267
267
+
<h1 className={`${className}`}>
267
268
<TextBlock {...b.block} />
268
268
-
</h2>
269
269
+
</h1>
269
270
);
270
271
if (b.block.level === 2)
271
272
return (
272
272
-
<h3 className={`${className}`}>
273
273
+
<h2 className={`${className}`}>
273
274
<TextBlock {...b.block} />
274
274
-
</h3>
275
275
+
</h2>
275
276
);
276
277
if (b.block.level === 3)
277
278
return (
278
278
-
<h4 className={`${className}`}>
279
279
+
<h3 className={`${className}`}>
279
280
<TextBlock {...b.block} />
280
280
-
</h4>
281
281
+
</h3>
281
282
);
282
283
// if (b.block.level === 4) return <h4>{b.block.plaintext}</h4>;
283
284
// if (b.block.level === 5) return <h5>{b.block.plaintext}</h5>;
···
291
292
return null;
292
293
}
293
294
};
294
294
-
295
295
-
const blobRefToSrc = (b: BlobRef["ref"], did: string) =>
296
296
-
`/api/atproto_images?did=${did}&cid=${(b as unknown as { $link: string })["$link"]}`;
297
295
298
296
function ListItem(props: {
299
297
item: PubLeafletBlocksUnorderedList.ListItem;