From fcefb69790ee8f93cb8b659b3baa5f336211681c Mon Sep 17 00:00:00 2001 From: m5r Date: Wed, 4 Aug 2021 05:14:41 +0800 Subject: [PATCH] temporary blog shortcut --- app/blog/pages/articles/[slug].tsx | 4 ++-- integrations/datocms.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/blog/pages/articles/[slug].tsx b/app/blog/pages/articles/[slug].tsx index a1a9172..a33e84f 100644 --- a/app/blog/pages/articles/[slug].tsx +++ b/app/blog/pages/articles/[slug].tsx @@ -2,7 +2,7 @@ import { BlitzPage, GetStaticPaths, GetStaticProps, Head, useRouter } from "blit import ErrorPage from "next/error"; import type { Post } from "integrations/datocms"; -import { getAllPostsWithSlug, getPostAndMorePosts, markdownToHtml } from "integrations/datocms"; +import { getAllPostsWithSlug, getPostAndMorePosts } from "integrations/datocms"; type Props = { post: Post; @@ -63,7 +63,7 @@ export const getStaticProps: GetStaticProps = async ({ params, preview = false } } const data = await getPostAndMorePosts(params.slug, preview); - const content = await markdownToHtml(data.post.content || ""); + const content = /*await markdownToHtml(data.post.content || "");*/ ""; return { props: { diff --git a/integrations/datocms.ts b/integrations/datocms.ts index 9166b14..b288951 100644 --- a/integrations/datocms.ts +++ b/integrations/datocms.ts @@ -1,8 +1,8 @@ import { getConfig } from "blitz"; -import { remark } from "remark"; -import html from "remark-html"; export async function markdownToHtml(markdown: string) { + const { remark } = await import("remark"); + const { default: html } = await import("remark-html"); const result = await remark().use(html).process(markdown); return result.toString(); }