import Layout from "../../components/main" import Link from 'next/link' import getConfig from 'next/config' export async function getServerSideProps(context) { const { serverRuntimeConfig, publicRuntimeConfig } = getConfig() const pslug = context.params.page const res = await fetch(serverRuntimeConfig.base_path + `/api/page/` + pslug) const pagedata = await res.json() pagedata.title = "Angry Beanie - " + pagedata.title const secres = await fetch(serverRuntimeConfig.base_path + `/api/sections`) const secdata = await secres.json() return { props: { sections : secdata, pagedata }, // will be passed to the page component as props } } function Page ({articles, sections, pagedata}) { return (

{pagedata.title}

); } export default Page