我正在尝试在我的 Gatsby 博客上添加特色图片,但无法使其正常工作。我在这里和那里尝试了几件事情,但我一直收到此错误消息:Field "featuredImage" must not have a selection since type "String" has no subfields.
这是我的博客结构:
src
|- images
|- house.jpeg
| - pages
|- actualites
|- house.mdx
Run Code Online (Sandbox Code Playgroud)
我house.mdx
有以下frontmatter:
---
title: House
path: /house
date: 2019-01-29
featuredImage: ../../images/house.jpeg
---
Run Code Online (Sandbox Code Playgroud)
我gatsby-plugin
看起来像这样:
plugins: [
`gatsby-plugin-resolve-src`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/images`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages`,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 800, …
Run Code Online (Sandbox Code Playgroud) 我在 NextJS 中有一个带有 next-i18next 的网站,除了页面之外的每个页面都必须翻译legal
。
这些legal
页面是 Markdown 格式的,并且由于[legal].js
页面及其中的getStaticPaths
和 ,我启用了动态路由。getStaticProps
问题是,通过构建我的网站,我的法律页面会以该语言为前缀(此处en
)。我想删除它,因为我不想翻译这些页面。
我在这里做错了什么?
多谢
文件夹结构:
pages
|- index.js
|- [legal].js
|- privacy-policy.mdx
Run Code Online (Sandbox Code Playgroud)
下一个-i18next.config.js
pages
|- index.js
|- [legal].js
|- privacy-policy.mdx
Run Code Online (Sandbox Code Playgroud)
[法律].js
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en'],
fallbackLng: 'en',
defaultNS: ['homepage', 'header', 'footer'],
localeDetection: false,
},
}
Run Code Online (Sandbox Code Playgroud)
构建输出: