mirror of
https://github.com/SrIzan10/spongebin.git
synced 2026-05-01 11:05:09 +00:00
fix: remove codeblock preview since discord doesn't support markdown in description
This commit is contained in:
@@ -39,17 +39,10 @@ export async function generateMetadata({ params }: Props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const numLines = paste.content.split("\n").length;
|
const numLines = paste.content.split("\n").length;
|
||||||
const codeblockContent = paste.content
|
|
||||||
.split("\n")
|
|
||||||
.slice(0, 3)
|
|
||||||
.join("\n")
|
|
||||||
.replace(/`/g, "\\`");
|
|
||||||
|
|
||||||
const codeblockPreview = `\`\`\`${paste.language}\n${codeblockContent}\n\`\`\``;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: `spongebin • ${paste.id}`,
|
title: `spongebin • ${paste.id}`,
|
||||||
description: `a paste containing ${numLines} lines of ${paste.language}\ncode:\n${codeblockPreview}`,
|
description: `a paste containing ${numLines} lines of ${paste.language}`,
|
||||||
openGraph: { images: "/sponge.png" },
|
openGraph: { images: "/sponge.png" },
|
||||||
twitter: { card: "summary" },
|
twitter: { card: "summary" },
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user