我有一个内置于盖茨比的博客。我还想使用docz
来记录我的react组件。但是,我似乎无法同时在我的应用程序中使用它们。每当我运行$ yarn start
时,我只会得到我的docz页面,而不是我的博客。我该如何使用$ yarn start
来运行我的博客,又如何使用其他命令来运行我的docz东西?谢谢!
// gatsby-config.js
require('dotenv').config();
const colors = require('./src/utils/colors');
const { GRAPHQL_URL } = process.env;
module.exports = {
siteMetadata: {
title: 'blog',
description: "my blog",
author: 'me',
siteUrl: 'https://www.me.com',
},
plugins: [
'gatsby-plugin-typescript',
'gatsby-plugin-tslint',
{
resolve: `gatsby-plugin-tsconfig-paths`,
},
{
resolve: 'gatsby-source-graphql',
options: {
typeName: 'GCMS',
fieldName: 'gcms',
url: GRAPHQL_URL,
},
},
'gatsby-plugin-react-helmet',
'gatsby-plugin-emotion',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/images`,
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'blog',
short_name: 'blog',
start_url: '/',
background_color: '#ffffff',
theme_color: colors.Blue,
display: 'minimal-ui',
icon: 'src/images/icon.png',
},
},
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography`,
},
},
'gatsby-plugin-sitemap',
'gatsby-theme-docz',
],
};
// doczrc.js
export default {
files: ['**/*.{md,markdown,mdx}'],
dest: '.docz/theme/dist',
typescript: true,
}
答案 0 :(得分:2)
解决方案是不要使用gatsby-theme-docz
,而只需独立安装docz
!我现在使用yarn docz dev