import ContentTable from "../../../../components/ContentTable"; import Sidebar from "../../../../components/Sidebar"; import styles from "../../../../styles/modules/Article.module.scss"; import Image from "next/image"; import Markdown from "../../../../components/Markdown"; import { ArticleWithIncludes, FetchManager } from "../../../../manager/fetchManager"; import { formatTextToUrlName } from "../../../../utils"; //* MAIN export default async function ArticlePage({ params, }: { params: { articleName: string; categoryName: string; test: string }; }) { const articleName: string = formatTextToUrlName(params.articleName); const article: ArticleWithIncludes = await FetchManager.Article.getByName(articleName); const dateUpdated: Date = new Date(article.dateUpdated); const dateCreated: Date = new Date(article.dateCreated); const dateOptions: Intl.DateTimeFormatOptions = { month: "long", day: "numeric", year: "numeric" }; const markdown: string = article?.markdown ?? ""; console.log(params.test); return (

{`Published on ${dateCreated.toLocaleDateString("en-US", dateOptions)}`}
{dateUpdated > dateCreated ? `Updated on ${dateUpdated.toLocaleDateString("en-US", dateOptions)}` : ""}

{article?.title}

Docker Setup Ubuntu
{article?.image?.alt

{article?.introduction}

); } export async function generateStaticParams() { // Fetchmanager does not work here const articles: ArticleWithIncludes[] = await FetchManager.Article.list(false); return await Promise.all( articles.map(async (article) => ({ categoryName: article.category?.name ?? "", articleName: article.name ?? "", })) ); } export function getServerSideProps() { console.log("-----------------------------------"); return { test: "weird test" }; }