You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB

import getPosts from "./blog";
export const dynamic = 'auto',
dynamicParams = true,
revalidate = false,
fetchCache = 'force-no-cache',
runtime = 'nodejs',
preferredRegion = 'auto'
export default async function Page({ children }) {
const posts = await getPosts;
return(
<div>
<div className="postList">
{posts.items.map((item, i) => (
<div key={i} className="post">
<h1>
{item.title}
</h1>
<div className="postContent">
<div className="categories">
{item["@expand"].categories.map((item, i) => (
<div key={i} style={{backgroundColor: item.color, color: item.text_color , borderRadius: 100, textAlign: "center", padding: "0.15rem", paddingLeft: "0.3rem", paddingRight: "0.3rem", fontWeight: "bold", boxShadow: "#111111 0.3rem 0.3rem 0.3rem"}}>
{item.name}
</div>
))}
</div>
{item.content.split(/\r?\n/).map((item, i) => (
<p className="postParagraph" key={i}>
{item}
</p>
))}
</div>
</div>
))}
</div>
</div>
);
}