问题的完整描述可以在这里找到https://github.com/gatsbyjs/gatsby/issues/5638
简而言之,我正在使用gatsby-plugin-remark并gatsby-transformer-remark优化放置在 md 文件前端的图像。
说我的降价文件有
---
title: Beautiful UI
featured_image: ../../images/project-vscbui.png
subtitle: A set of color themes for VSCode
order: 90
link: https://vscbui.rocks
templateKey: projects
---
...
Run Code Online (Sandbox Code Playgroud)
我像这样查询
export const projectQuery = graphql`
query ProjectQuery {
projects: allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___order] }
filter: { frontmatter: { templateKey: { eq: "projects" } } }
limit: 1000
) {
edges {
node {
id
frontmatter {
title
subtitle
featured_image {
childImageSharp {
sizes(maxWidth: 960) …Run Code Online (Sandbox Code Playgroud) gatsby ×1