我正在使用Gatsby和gatsby-remark-images
,因此可以链接到Markdown图片。
我真的很想在降价促销中使用绝对路径访问图像,但是我似乎无法使其正常工作。例如,第一个无效,但是第二个有效:
![Not working](/src/images/2017/04/ToString-Method-Added.png)
![Working](./ToString-Method-Added.png)
这是我的gatsby-config.js
(我以教程为起点):
module.exports = {
siteMetadata: { title: `Pandas Eating Lots` },
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: { name: `src`, path: `${__dirname}/src/` }
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: "GatsbyJS",
short_name: "GatsbyJS",
start_url: "/",
background_color: "#6b37bf",
theme_color: "#6b37bf",
display: "standalone"
}
},
"gatsby-plugin-offline",
`gatsby-plugin-react-helmet`,
`gatsby-transformer-remark`,
`gatsby-plugin-emotion`,
`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: 590
}
}
]
}
}
]
};
我尝试向gatsby-source-filesystem
添加另一个/src/images
,但这没有帮助。
我想做的是可能的吗?如果可以,我想念的是什么?