一、简介 gatsby-config.js 位于项目根目录,用于配置项目信息,如果没有就新建一个。 plugins 用于配置 plugin ,这个是最常用的 siteMetadata 设置项目的基本信息:title等描述 flags 可设置的值,看这里! pathPrefix 转换URLhttp://www.example.com为http://www.example.com/blog proxy 开发模式下,让不存在的URL ...
gatsby-config.js module.exports={ siteMetadata:{ title:`Gatsby`, }, plugins:[ `gatsby-transform-plugin`, { resolve:`gatsby-plugin-name`, options:{ optionA:true, optionB:`Another option`, }, }, ], } TheTypeScript and Gatsby documentationshows how to set up a configuration file in Type...
eos_token = tf.placeholder(tf.int32, []) ignore_ids = tf.placeholder(tf.bool, [news_config.vocab_size]) # Load the model config to get it set up to match the pre-trained model weights tokens, probs = sample( news_config=news_config, initial_context=initial_context, eos_token=eos_...
我们可以使用名为Gatsby -source-drive的插件将文件直接导入到Gatsby的本地文件系统中。这需要在谷歌api中设置一个服务帐户。然后需要将其添加到gatsby-config.js中,并从谷歌驱动器文件夹中获得唯一的ID。这个API的好处在于它保存并缓存了谷歌驱动器文件夹的内容,所以即使您的驱动器发生了什么事情,文件还是安全的。...
// gatsby-config.js module.exports = { siteMetadata: { title: "My First Gatsby Site", }, plugins: [ "gatsby-plugin-image", "gatsby-plugin-sharp", ], }; 显示图片 StaticImage 是 gatsby-plugin-image 提供的组件,类似html 中的 img 标签,可以在页面中直接使用。 代码语言:txt 复制 import *...
├── gatsby-config.js // 主要配置文件├── gatsby-node.js // 视图层配置 ├── package.json ├── public ├── src ├── components // 组件 ├── pages // 页面文件 ├── templates // 模版文件 Gatsby 采用约定式路由,page文件夹要注意,全都是采用小写命名,例如: ...
config.resolve.alias = { ...config.resolve.alias, 'react-dom': '@hot-loader/react-dom' } } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 再重新启动项目,就可以消除这个警告 项目结构 ├── .cache ├── public ├── src | └── pages // 该文件夹下的文件会被映射为路由 ...
const config = getConfig() if (stage.startsWith('develop') && config.resolve) { config.resolve.alias = { ...config.resolve.alias, 'react-dom': '@hot-loader/react-dom' } } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 再重新启动项目,就可以消除这个警告 ...
To add custom webpack configurations, create (if there’s not one already) agatsby-node.jsfile in your root directory. Inside this file, export a function calledonCreateWebpackConfig. When Gatsby creates its webpack config, this function will be called allowing you to modify the default web...
完成后, 需要做些配置, 修改gatsby-config.js文件, 替换成以下内容: module.exports = { siteMetadata: { title: `Gatsby Default Starter`, }, plugins: [ `gatsby-plugin-react-helmet`, { resolve: `gatsby-source-strapi`, options: { apiURL: `http://localhost:1337`, ...