diff --git a/content/arreter-alcool.mdx b/app/blog/(articles)/arreter-alcool/page.mdx similarity index 94% rename from content/arreter-alcool.mdx rename to app/blog/(articles)/arreter-alcool/page.mdx index 1882d0d..9dce95d 100644 --- a/content/arreter-alcool.mdx +++ b/app/blog/(articles)/arreter-alcool/page.mdx @@ -1,12 +1,12 @@ ---- -title: "Comment arrêter l'alcool ?" -order: 1 -category: "Santé et bien-être" -date: Mars 10, 2024 -image: ../images/articles/maitriser consommation alcool .jpg -alt: "Portrait noir et blanc d'une personne cachant son visage avec sa main. Interprétable comme un signe de refus." -description: “Découvrez des stratégies concrètes pour arrêter l'alcool, des conseils pour évaluer votre relation avec la boisson, et explorez les ressources et le soutien disponibles pour une vie plus équilibrée.” ---- +export const metadata = { + title: "Comment arrêter l'alcool ?" + order: 1 + category: "Santé et bien-être" + date: Mars 10, 2024 + image: ../images/articles/maitriser consommation alcool .jpg + alt: "Portrait noir et blanc d'une personne cachant son visage avec sa main. Interprétable comme un signe de refus." + description: “Découvrez des stratégies concrètes pour arrêter l'alcool, des conseils pour évaluer votre relation avec la boisson, et explorez les ressources et le soutien disponibles pour une vie plus équilibrée.” +} Vous pensez avoir une consommation excessive d’alcool ? Vous souhaitez arrêter de consommer de l’alcool ? Voici notre guide pour diminuer ou arrêter votre consommation au profit d’une meilleure santé ! diff --git a/content/arreter-l-alcool-oz-ensemble.mdx b/app/blog/(articles)/arreter-l-alcool-oz-ensemble/page.mdx similarity index 100% rename from content/arreter-l-alcool-oz-ensemble.mdx rename to app/blog/(articles)/arreter-l-alcool-oz-ensemble/page.mdx diff --git a/app/blog/[blog]/page.tsx b/app/blog/(articles)/blabls.tsx similarity index 74% rename from app/blog/[blog]/page.tsx rename to app/blog/(articles)/blabls.tsx index 6750a86..47e9108 100644 --- a/app/blog/[blog]/page.tsx +++ b/app/blog/(articles)/blabls.tsx @@ -1,6 +1,5 @@ import React from "react" -import { serialize } from "next-mdx-remote/serialize" -import { MDXRemote } from "next-mdx-remote/rsc" +import BlogContent from "./BlogContent" import fs from "fs" import path from "path" import matter from "gray-matter" @@ -66,35 +65,8 @@ export default async function Blog({ params }) {
- +
) } - -async function getBlogPost(params: { blog: string }) { - const filePath = path.join(process.cwd(), "content", `${params.blog}.mdx`) - const fileContents = fs.readFileSync(filePath, "utf-8") - const { content, data } = matter(fileContents) - const mdxSource = await serialize(content, { - mdxOptions: { - development: false, - }, - }) - - const articleDate = parse(data.date, "MMMM d, yyyy", new Date(), { - locale: fr, - }) - - const currentDate = new Date() - - if (articleDate >= currentDate) { - return { - notFound: true, - } - } - return { - mdxSource, - data, - } -} diff --git a/app/blog/(articles)/blobol.tsx b/app/blog/(articles)/blobol.tsx new file mode 100644 index 0000000..23acab0 --- /dev/null +++ b/app/blog/(articles)/blobol.tsx @@ -0,0 +1,50 @@ +import React from "react" +import Navigation, { DownloadPopupStandalone } from "~/components/Navigation" +import Footer from "~/components/Footer" +import fs from "fs" +import path from "path" +import matter from "gray-matter" +import { parse } from "date-fns" +import { fr } from "date-fns/locale" +import type { Metadata } from "next" + +// export async function generateMetadata({ +// params, +// }: { +// params: { blog: string } +// }): Promise { +// // read route params +// const filePath = path.join(process.cwd(), "content", `${params.blog}.mdx`) +// const fileContents = fs.readFileSync(filePath, "utf-8") +// const { data } = matter(fileContents) + +// const articleDate = parse(data.date, "MMMM d, yyyy", new Date(), { +// locale: fr, +// }) + +// const currentDate = new Date() + +// if (articleDate >= currentDate) { +// return null +// } +// return { +// title: data.title, +// description: data.description, +// openGraph: { +// title: data.title, +// description: data.description, +// images: [data.image], +// }, +// } +// } + +export default function BlogLayout({ children }) { + return ( + <> + + + {children} +