Added changes to church

This commit is contained in:
Rafael González 2023-01-21 11:47:23 -06:00
parent b8697e601f
commit 4fafa3a172
1 changed files with 6 additions and 5 deletions

View File

@ -50,6 +50,7 @@ const n2m = new NotionToMarkdown({ notionClient: notion });
// @ts-ignore // @ts-ignore
const mdblocks = await n2m.pageToMarkdown(id); const mdblocks = await n2m.pageToMarkdown(id);
const mdString = n2m.toMarkdownString(mdblocks); const mdString = n2m.toMarkdownString(mdblocks);
const generalString = mdString.replace(/(\r\n|\n|\r)/gm, " ").replace(/(-|#)/gm, "").replaceAll(" ", " ");
const mdArray = mdString.split("\n"); const mdArray = mdString.split("\n");
for (let i = 0; i < mdArray.length; i++) { for (let i = 0; i < mdArray.length; i++) {
@ -63,19 +64,19 @@ const mdGood = mdArray.join("\n");
const htmlData = marked.parse(mdGood); const htmlData = marked.parse(mdGood);
const title = mdString const title = pageData.properties.title.title[0].plain_text.split(" | ").splice(0, pageData.properties.title.title[0].plain_text.split(" | ").length - 1).join(" - ");
.split("\n") const description = generalString.substring(0, 250);
.find((line) => line.startsWith("# ")) console.log(description);
.replace("# ", "");
const image = pageData.cover.external.url; const image = pageData.cover.external.url;
--- ---
<MainLayout <MainLayout
title={title} title={title}
description="Aquí pordrás encontrar una lista de todas las notas de clases que he dado y sermones que he escuchado." description={description}
image={image} image={image}
blog={false} blog={false}
hasMainTitle={true} hasMainTitle={true}
> >
<h1>{title}</h1>
<div set:html={htmlData}></div> <div set:html={htmlData}></div>
</MainLayout> </MainLayout>