【问题标题】:gatsby and gatsby-theme-docz盖茨比和盖茨比-主题-docz
【发布时间】:2020-01-30 08:08:08
【问题描述】:

我有一个用 gatsby 构建的博客。我还想使用docz 来记录我的反应组件。但是,我似乎无法让两者都在我的应用程序中工作。每当我运行$ 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,
}

【问题讨论】:

    标签: gatsby docz


    【解决方案1】:

    解决方案是使用gatsby-theme-docz,只安装docz 独立!我现在用 yarn docz dev 运行 docz

    【讨论】:

      猜你喜欢
      • 2021-08-22
      • 2020-10-16
      • 2019-08-07
      • 2021-12-24
      • 2021-12-14
      • 2022-08-19
      • 1970-01-01
      • 2021-07-30
      • 2020-10-06
      相关资源
      最近更新 更多