Added changes to church
This commit is contained in:
parent
b8697e601f
commit
4fafa3a172
|
@ -50,6 +50,7 @@ const n2m = new NotionToMarkdown({ notionClient: notion });
|
|||
// @ts-ignore
|
||||
const mdblocks = await n2m.pageToMarkdown(id);
|
||||
const mdString = n2m.toMarkdownString(mdblocks);
|
||||
const generalString = mdString.replace(/(\r\n|\n|\r)/gm, " ").replace(/(-|#)/gm, "").replaceAll(" ", " ");
|
||||
const mdArray = mdString.split("\n");
|
||||
|
||||
for (let i = 0; i < mdArray.length; i++) {
|
||||
|
@ -63,19 +64,19 @@ const mdGood = mdArray.join("\n");
|
|||
|
||||
const htmlData = marked.parse(mdGood);
|
||||
|
||||
const title = mdString
|
||||
.split("\n")
|
||||
.find((line) => line.startsWith("# "))
|
||||
.replace("# ", "");
|
||||
const title = pageData.properties.title.title[0].plain_text.split(" | ").splice(0, pageData.properties.title.title[0].plain_text.split(" | ").length - 1).join(" - ");
|
||||
const description = generalString.substring(0, 250);
|
||||
console.log(description);
|
||||
const image = pageData.cover.external.url;
|
||||
---
|
||||
|
||||
<MainLayout
|
||||
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}
|
||||
blog={false}
|
||||
hasMainTitle={true}
|
||||
>
|
||||
<h1>{title}</h1>
|
||||
<div set:html={htmlData}></div>
|
||||
</MainLayout>
|
||||
|
|
Loading…
Reference in New Issue