我正在尝试使用 gatsby-remark-images 在我的 markdown 文件中使用内联图像。不幸的是,该图像无法加载到我的本地主机上。我不知道这是否只是语法错误,或者我错过了一些重大的东西。
这是config https://github.com/wbonneville/gatsby_blog/blob/master/gatsby-config.js:(我怀疑我在某个地方做错了什么,就在这里。)
module.exports = {
siteMetadata: {
title: ``,
description: `A blog where code is written about`,
author: `@wesley`,
},
plugins: [
`gatsby-plugin-sass`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-catch-links`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 1200,
},
},
],
},
},
`gatsby-transformer-remark`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/mt.png`, // This path is relative to the root of the site.
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
};
我一遍又一遍地仔细研究有关盖茨比的糟糕文档。我很困惑。有人知道发生了什么事吗?我能够让特色图像发挥作用,但这不是我想要的。
package.json:
Path in markdown file is right (I believe):
Screenshot of what I'm getting: