From 4b02a31228de183fb195973e175b3c1c16c10ba7 Mon Sep 17 00:00:00 2001 From: aldemirlucas Date: Wed, 11 Dec 2024 11:10:45 -0300 Subject: [PATCH] fix/ajust redirect correct edit md --- next/pages/blog/[slug].js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/next/pages/blog/[slug].js b/next/pages/blog/[slug].js index 6d3bd980..cafc4800 100644 --- a/next/pages/blog/[slug].js +++ b/next/pages/blog/[slug].js @@ -55,6 +55,7 @@ export async function getStaticProps({ params, locale }) { return { props: { slug, + locale, ...serialize, ...(await serverSideTranslations(locale, ['common', 'blog', 'menu'])), }, @@ -69,10 +70,18 @@ export async function getStaticPaths() { }; } -export default function Post({ slug, mdxSource, headings }) { +export default function Post({ slug, locale, mdxSource, headings }) { const { t } = useTranslation('blog') const { frontmatter } = mdxSource; + const repository = () => { + const baseUrl = process.env.NEXT_PUBLIC_BASE_URL_FRONTEND + if (baseUrl === "http://localhost:3000" || baseUrl === "https://development.basedosdados.org") return "development" + if (baseUrl === "https://staging.basedosdados.org") return "staging" + if (baseUrl === "https://basedosdados.org") return "main" + return null + } + return ( {t("noticedSomething")}