Update config

update toc key
This commit is contained in:
DefectingCat
2022-08-19 11:04:55 +08:00
parent ca4dade52f
commit 015339dfcf
2 changed files with 33 additions and 20 deletions

View File

@ -2,7 +2,7 @@ import { getHeadings, SingleToc } from 'lib/utils';
import Anchor from 'components/mdx/Anchor';
import styles from './PostToc.module.css';
import classNames from 'classnames';
import { useCallback, useState } from 'react';
import { Fragment, useCallback, useState } from 'react';
import { FiChevronDown } from 'react-icons/fi';
interface Props {
@ -61,14 +61,14 @@ const PostToc = ({ toc, tocLength }: Props) => {
<div className="pl-4 border-l-4 border-gray-300 toc">
<ul className="!pl-[unset]">
{toc?.map((h) => (
<>
<TocItem item={h} key={h.link} />
<Fragment key={h.link}>
<TocItem item={h} />
{h.children.map((child) => (
<ul className="!pl-4" key={child.link}>
<TocItem item={child} />
</ul>
))}
</>
</Fragment>
))}
</ul>
</div>

View File

@ -1,9 +1,24 @@
import remarkFrontmatter from 'remark-frontmatter';
import composePlugins from 'next-compose-plugins';
// import composePlugins from 'next-compose-plugins';
const composedConfig = composePlugins([
/** @type {import('next').NextConfig} */
{
// const composedConfig = composePlugins([
// /** @type {import('next').NextConfig} */
// {
// reactStrictMode: true,
// output: 'standalone',
// experimental: {
// // runtime: 'nodejs',
// // outputStandalone: true,
// images: { allowFutureImage: true },
// },
// pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
// images: { domains: ['avatars.githubusercontent.com'] },
// },
// ]);
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
reactStrictMode: true,
output: 'standalone',
experimental: {
@ -12,8 +27,6 @@ const composedConfig = composePlugins([
images: { allowFutureImage: true },
},
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
images: { domains: ['avatars.githubusercontent.com'] },
},
]);
};
export default composedConfig;
export default nextConfig;