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")}