Updates
This commit is contained in:
@@ -2,24 +2,30 @@ import Layout from "@/layouts/main";
|
||||
import Main from "@/components/pages/blog/slug";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import datasquirel from "@moduletrace/datasquirel";
|
||||
import { DSQL_TBENME_BLOG_POSTS, PagePropsType } from "@/types";
|
||||
import { PagePropsType } from "@/types";
|
||||
import { APIResponseObject } from "@moduletrace/datasquirel/dist/package-shared/types";
|
||||
import { serialize } from "next-mdx-remote/serialize";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import rehypePrismPlus from "rehype-prism-plus";
|
||||
import matter from "gray-matter";
|
||||
import { DSQL_TBEN_ME_BLOG_POSTS } from "@/types/dsql";
|
||||
|
||||
export default function SingleBlogPost() {
|
||||
export default function SingleBlogPost({ blogPost }: PagePropsType) {
|
||||
return (
|
||||
<Layout>
|
||||
<Layout
|
||||
meta={{
|
||||
title: blogPost?.meta_title,
|
||||
description: blogPost?.meta_description,
|
||||
}}
|
||||
>
|
||||
<Main />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export const getStaticProps: GetStaticProps<PagePropsType> = async (ctx) => {
|
||||
const blogPostRes: APIResponseObject<DSQL_TBENME_BLOG_POSTS[]> =
|
||||
await datasquirel.crud<DSQL_TBENME_BLOG_POSTS>({
|
||||
const blogPostRes: APIResponseObject<DSQL_TBEN_ME_BLOG_POSTS> =
|
||||
await datasquirel.crud<DSQL_TBEN_ME_BLOG_POSTS>({
|
||||
action: "get",
|
||||
table: "blog_posts",
|
||||
query: {
|
||||
@@ -67,8 +73,8 @@ export const getStaticProps: GetStaticProps<PagePropsType> = async (ctx) => {
|
||||
};
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = async (ctx) => {
|
||||
const blogPostRes: APIResponseObject<DSQL_TBENME_BLOG_POSTS[]> =
|
||||
await datasquirel.crud<DSQL_TBENME_BLOG_POSTS>({
|
||||
const blogPostRes: APIResponseObject<DSQL_TBEN_ME_BLOG_POSTS> =
|
||||
await datasquirel.crud<DSQL_TBEN_ME_BLOG_POSTS>({
|
||||
action: "get",
|
||||
table: "blog_posts",
|
||||
query: {
|
||||
|
||||
@@ -2,8 +2,9 @@ import Layout from "@/layouts/main";
|
||||
import Main from "@/components/pages/blog";
|
||||
import { GetStaticProps } from "next";
|
||||
import datasquirel from "@moduletrace/datasquirel";
|
||||
import { DSQL_TBENME_BLOG_POSTS, PagePropsType } from "@/types";
|
||||
import { PagePropsType } from "@/types";
|
||||
import { APIResponseObject } from "@moduletrace/datasquirel/dist/package-shared/types";
|
||||
import { DSQL_TBEN_ME_BLOG_POSTS } from "@/types/dsql";
|
||||
|
||||
export default function BlogPage() {
|
||||
return (
|
||||
@@ -14,8 +15,8 @@ export default function BlogPage() {
|
||||
}
|
||||
|
||||
export const getStaticProps: GetStaticProps<PagePropsType> = async (ctx) => {
|
||||
const blogPosts: APIResponseObject<DSQL_TBENME_BLOG_POSTS[]> =
|
||||
await datasquirel.crud<DSQL_TBENME_BLOG_POSTS>({
|
||||
const blogPosts: APIResponseObject<DSQL_TBEN_ME_BLOG_POSTS> =
|
||||
await datasquirel.crud<DSQL_TBEN_ME_BLOG_POSTS>({
|
||||
action: "get",
|
||||
table: "blog_posts",
|
||||
query: {
|
||||
|
||||
Reference in New Issue
Block a user