[英]How to implement gatsby-remark-images-grid in markdown using Gatsby.js
我正在使用markdown在Gatsby.js中創建一個博客,我想在我的博客文章中使用CSS網格來顯示漂亮的圖像網格。
因此,我知道Gatsby有出色的插件可以解決幾乎所有問題。
我發現關於gatsby-remark-images-grid的假設是可以解決我的問題的,但是我似乎無法使其正常工作。
我確實正確安裝了它(我認為:npm install gatsby-remark-images-grid --save),將其放入我的gatsby-config.js中,如下所示:
module.exports = {
siteMetadata: {
title: 'Kids and Coconuts',
siteUrl: 'https://kidsandcoconuts.com',
},
plugins: [
'gatsby-plugin-react-helmet',
`gatsby-plugin-sharp`,
`gatsby-transformer-sharp`,
{
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/gatsby-icon.png', // This path is relative to the root of the site.
},
},
`gatsby-plugin-catch-links`,
'gatsby-plugin-offline',
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
`gatsby-remark-prismjs`,
{
resolve: "gatsby-remark-images-grid",
options: {
},
},
]
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content`,
name: "pages",
},
},
],
}
我試圖在我的一篇博客文章中放置一個圖像網格:
```
![](../time.jpg)
![](../time.jpg)
```
有人看到我忘記或做錯了什么嗎?
坦克一百萬!
在降價文件中定義路徑。 如果markdown文件位於src/pages/index.md
和src/images/image.jpg
可以將其放入MD文件中。
images:
- /images/image1.jpg
- /images/image2.jpg
- /images/image3.jpg
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.