fix(org): No order is used
This commit is contained in:
parent
9a16cccace
commit
f985389236
2 changed files with 4 additions and 8 deletions
|
@ -53,10 +53,8 @@ const BlogPage = ({ locale, slug, page }) => {
|
||||||
export async function getStaticProps({ params, locale }) {
|
export async function getStaticProps({ params, locale }) {
|
||||||
const { slug } = params
|
const { slug } = params
|
||||||
|
|
||||||
// if the slug isn't present in the prebuilt order, return 404
|
// if the slug isn't present in the prebuilt posts, return 404
|
||||||
if (order[locale].indexOf(`blog/${slug}`) === -1) {
|
if (!Object.keys(posts).includes(`blog/${slug}`)) return { notFound: true }
|
||||||
return { notFound: true }
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -56,10 +56,8 @@ const ShowcasePage = ({ locale, slug, page }) => {
|
||||||
export async function getStaticProps({ params, locale }) {
|
export async function getStaticProps({ params, locale }) {
|
||||||
const { slug } = params
|
const { slug } = params
|
||||||
|
|
||||||
// if the slug isn't present in the prebuilt order, return 404
|
// if the slug isn't present in the prebuilt posts, return 404
|
||||||
if (order[locale].indexOf(`showcase/${slug}`) === -1) {
|
if (!Object.keys(posts).includes(`showcase/${slug}`)) return { notFound: true }
|
||||||
return { notFound: true }
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue