Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/lib/md/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getMdMetadata = async ({
}) => {
const slug = slugArray.join("/")

const { markdown, isTranslated } = await importMd(locale, slug)
const { markdown } = await importMd(locale, slug)
const { frontmatter } = await compile({
markdown,
slugArray: slug.split("/"),
Expand All @@ -35,7 +35,6 @@ export const getMdMetadata = async ({
description,
image,
author,
noIndex: !isTranslated,
})
return metadata
}
7 changes: 1 addition & 6 deletions src/lib/utils/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { getTranslations } from "next-intl/server"

import { DEFAULT_OG_IMAGE, SITE_URL } from "@/lib/constants"

import { isPageTranslated } from "../i18n/pageTranslation"

import { isLocaleValidISO639_1 } from "./translations"
import { getFullUrl } from "./url"

Expand Down Expand Up @@ -119,8 +117,5 @@ export const getMetadata = async ({
return { ...base, robots: { index: false } }
}

const isTranslated = await isPageTranslated(locale, slugString)

// If the page is not translated, do not index the page
return isTranslated ? base : { ...base, robots: { index: false } }
return base
}