Use Content Component
This commit is contained in:
@ -1,21 +1,14 @@
|
||||
import type { GetServerSideProps, NextPage } from "next";
|
||||
import Layout from "../../../components/Blog/Layout";
|
||||
import DiaryPageSelector from "../../../components/Blog/DiaryPageSelector";
|
||||
import ContentPage from "../../../components/Blog/ContentPage";
|
||||
import { generateContent, getContentList } from "../../../lib/content/generateBackend";
|
||||
import type { ContentList, Diary } from "../../../lib/content/types";
|
||||
import type { ContentList, DiaryRender, Diary } from "../../../lib/content/types";
|
||||
|
||||
import styles from "../../../styles/Blog/Content.module.scss";
|
||||
|
||||
interface IContentRender extends Diary {
|
||||
html: string;
|
||||
}
|
||||
|
||||
const DiaryMain: NextPage<{ content: IContentRender }> = ({ content }) => {
|
||||
const DiaryMain: NextPage<{ content: DiaryRender }> = ({ content }) => {
|
||||
return <Layout title={`${content.title} - c0ntroller.de`}>
|
||||
<DiaryPageSelector title={content.title} pageSelected={0} name={content.name} pages={content.entries.map(e => e.title)} />
|
||||
<div dangerouslySetInnerHTML={{ __html: content.html }}>
|
||||
</div>
|
||||
<DiaryPageSelector title={content.title} pageSelected={0} name={content.name} pages={content.entries.map(e => e.title)} bottom />
|
||||
<ContentPage content={content} />
|
||||
</Layout>;
|
||||
};
|
||||
|
||||
@ -33,7 +26,8 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
|
||||
props: {
|
||||
content: {
|
||||
...contentEntry,
|
||||
html: contentHtml
|
||||
html: contentHtml,
|
||||
pageSelected: 0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,21 +1,14 @@
|
||||
import type { GetServerSideProps, NextPage } from "next";
|
||||
import DiaryPageSelector from "../../../../components/Blog/DiaryPageSelector";
|
||||
import ContentPage from "../../../../components/Blog/ContentPage";
|
||||
import Layout from "../../../../components/Blog/Layout";
|
||||
import { generateContent, getContentList } from "../../../../lib/content/generateBackend";
|
||||
import type { ContentList, Diary } from "../../../../lib/content/types";
|
||||
import type { ContentList, Diary, DiaryRender } from "../../../../lib/content/types";
|
||||
|
||||
import styles from "../../../../styles/Blog/Content.module.scss";
|
||||
|
||||
interface IContentRender extends Diary {
|
||||
html: string;
|
||||
pageSelected: number;
|
||||
}
|
||||
|
||||
const DiaryMain: NextPage<{ content: IContentRender }> = ({ content }) => {
|
||||
const DiaryMain: NextPage<{ content: DiaryRender }> = ({ content }) => {
|
||||
return <Layout title={`${content.entries[content.pageSelected - 1].title} - ${content.title} - c0ntroller.de`}>
|
||||
<div dangerouslySetInnerHTML={{ __html: content.html }}>
|
||||
</div>
|
||||
<DiaryPageSelector title={content.title} pageSelected={content.pageSelected} name={content.name} pages={content.entries.map(e => e.title)} bottom />
|
||||
<ContentPage content={content} />
|
||||
</Layout>;
|
||||
};
|
||||
|
||||
|
@ -1,21 +1,14 @@
|
||||
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 type { ContentList } from "../../../lib/content/types";
|
||||
import type { ContentList, ProjectRender } from "../../../lib/content/types";
|
||||
|
||||
import styles from "../../../styles/Blog/Content.module.scss";
|
||||
|
||||
interface IContentRender {
|
||||
more?: string;
|
||||
repo?: string;
|
||||
title: string;
|
||||
html: string;
|
||||
}
|
||||
|
||||
const Post: NextPage<{ content: IContentRender }> = ({ content }) => {
|
||||
const Post: NextPage<{ content: ProjectRender }> = ({ content }) => {
|
||||
return <Layout title={`${content.title} - c0ntroller.de`}>
|
||||
<div dangerouslySetInnerHTML={{ __html: content.html }}>
|
||||
</div>
|
||||
<ContentPage content={content} />
|
||||
</Layout>;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user