Improve age-restricted hyperlinks, clean up markup, and add navigation icons
This commit is contained in:
parent
c55c82633d
commit
57c2c7c649
31 changed files with 279 additions and 138 deletions
|
|
@ -90,9 +90,9 @@ export const GET: APIRoute<Props, Params> = async ({ props: { story }, site }) =
|
|||
}, Promise.resolve(""));
|
||||
switch (exportFormat) {
|
||||
case "bbcode":
|
||||
return { exportWebsite, description: markdownToBbcode(storyDescription).replaceAll(/\n\n\n+/g, "\n\n") };
|
||||
return { descriptionFilename: `description_${exportWebsite}.txt`, descriptionText: markdownToBbcode(storyDescription).replaceAll(/\n\n\n+/g, "\n\n") };
|
||||
case "markdown":
|
||||
return { exportWebsite, description: storyDescription.replaceAll(/\n\n\n+/g, "\n\n").trim() };
|
||||
return { descriptionFilename: `description_${exportWebsite}.md`, descriptionText: storyDescription.replaceAll(/\n\n\n+/g, "\n\n").trim() };
|
||||
default:
|
||||
const unknown: never = exportFormat;
|
||||
throw new Error(`Unknown export format "${unknown}"`);
|
||||
|
|
@ -131,10 +131,10 @@ export const GET: APIRoute<Props, Params> = async ({ props: { story }, site }) =
|
|||
story: storyText,
|
||||
description: description.reduce(
|
||||
(acc, item) => {
|
||||
acc[item.exportWebsite] = item.description;
|
||||
acc[item.descriptionFilename] = item.descriptionText;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<PostWebsite, string>,
|
||||
{} as Record<string, string>,
|
||||
),
|
||||
thumbnail: story.data.thumbnail ? story.data.thumbnail.src : null,
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue