So much stuff. hljs in backend for example

This commit is contained in:
2022-10-18 16:03:49 +02:00
parent 71c0e839c6
commit 3d968a8f0e
10 changed files with 1076 additions and 47 deletions

View File

@ -1,7 +1,7 @@
import type { GetServerSideProps, NextPage } from "next";
import ContentPage from "../../../../components/Blog/ContentPage";
import Layout from "../../../../components/Blog/Layout";
import { generateContent, getContentList } from "../../../../lib/content/generateBackend";
import { generateContent, getContentList, generateHighlightedDOM } from "../../../../lib/content/generateBackend";
import type { ContentList, Diary, DiaryRender } from "../../../../lib/content/types";
const DiaryMain: NextPage<{ content: DiaryRender }> = ({ content }) => {
@ -19,12 +19,13 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
if (!contentEntry || !page || typeof page !== "string") return { notFound: true };
const contentHtml = await generateContent(contentEntry, Number.parseInt(page));
const contentHighlighted = generateHighlightedDOM(contentHtml);
return {
props: {
content: {
...contentEntry,
html: contentHtml,
html: contentHighlighted,
pageSelected: Number.parseInt(page)
}
}