Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
petyosi committed Jan 4, 2024
1 parent b440cb3 commit 7ac6eeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions app/editor/api/NavGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client'
import { ApiRefNode, TypeFieldMap, RefNodeField, MarkdownApiRefDocument } from '@/app/apiDocsStructures'
import React, { useEffect } from 'react'
import React from 'react'
import ExpandMoreIcon from '@/app/images/expand_more.svg'
import ExpandLessIcon from '@/app/images/expand_less.svg'
import { useParams } from 'next/navigation'
Expand Down
11 changes: 6 additions & 5 deletions app/editor/api/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable react-refresh/only-export-components */
import { getApiDocs } from '@/app/getApiDocs'
import { MDXRemote } from 'next-mdx-remote/rsc'
import rehypePrism from 'rehype-prism-plus'
import rehypeSlug from 'rehype-slug'
Expand Down Expand Up @@ -46,11 +45,13 @@ interface PageParams {
}

export function generateMetadata({ params }: { params: PageParams }) {
return {}
const { docs } = getApiDocs('./api-ref')
const doc = docs.find((file) => file.slug === params.slug)
let slug = params.slug
if (!slug) {
slug = ['API Reference']
}

return {
title: `${doc?.title} | MDXEditor`,
title: `${slug.at(-1)} | MDXEditor`,
description:
'MDXEditor is an open-source React component that lets your users edit markdown documents naturally, just like in Google docs or Notion.',
}
Expand Down

0 comments on commit 7ac6eeb

Please sign in to comment.