【问题标题】:How to combine 2 Gatsby sites in one domain?如何在一个域中合并 2 个 Gatsby 站点?
【发布时间】:2020-05-31 01:23:14
【问题描述】:

我想在一个域中合并 2 个 Gatsby 站点,例如 mydomain.com 中的 Gatsby1(登录页面)和 mydomain.com/blog 中的 Gatsby2(博客),我该怎么做?

【问题讨论】:

  • 您可以使用子域,例如:blog.mydomain.com,配置与其他子域类似
  • 不,我不想要子域

标签: gatsby netlify static-site jamstack


【解决方案1】:

创建两个 Gatbsy 项目。可以从根mydomain.com 配置一个。需要使用path prefixes:

gatsby-config.js

module.exports = {
  pathPrefix: `/blog`,
}

构建时需要使用标志:gatsby build --prefix-paths

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-07-23
  • 2015-05-26
  • 1970-01-01
  • 2013-08-06
  • 2019-12-01
  • 2011-11-24
  • 1970-01-01
相关资源
最近更新 更多