我正在构建带有function的博客,其中post文件是.mdx,我使用gatsby-plugin-mdx的MDXRenderer将它们呈现为HTML。我使用的是.module.scss样式,但不能在呈现的HTML中使用模块,有类似于参数或函数的方法吗?
import * as React from "react";
import { graphql } from "gatsby";
import { MDXRenderer } from "gatsby-plugin-mdx";
import Layout from "../../com
目标:尝试使用盖茨比创建一个简单的博客
成果:
- Expected Outcome: Things should go as defined in the tutorial guide
- Actual Outcome: Getting Dependency tree error in step(s) & Also a warning message like `34 vulnerabilities (11 moderate, 23 high)` whenever installing something using npm in this project
我正在尝试使用GatsbyJS创建一个博客。我遵循以下教程 https://www.gatsbyjs.org/docs/recipes/#optimizing-and-querying-images-in-post-frontmatter-with-gatsby-image 博客包含标题、特色图片和文本。 MDX-file结构如下所示。 ---
title: My First Post
featuredImage: ./corgi.png
---
Post content... 而且,gatsby-node.js文件中的代码如下 exports.createPages = async ({
我有盖茨比的应用程序。
当我在本地构建它时,它工作得很好,但是当我尝试将它部署到Netlify或Gitlab时,我会得到以下错误消息: Netlify错误消息:
8:44:20 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
8:44:20 PM: npm WARN config location in the cache, and they are managed by
8:44:20 PM: npm WARN config [`cacac
我正在尝试显示md文件中的Gatsby环境变量。我在网上查看了最好的方法是什么,在md文件中使用JSX (在mdx插件的帮助下)似乎是最好的选择。例如,我想映射一个来自环境变量的数组,以便显示所有值。但是,不可能访问任何变量。
ex (在我的mdx文件中):<div>{process.env.MyVariable.map(el=>(<div>{el}</div>))}</div>
错误:ReferenceError: process is not defined
我开始在这个上添加Gatsby 。我仔细检查了一下如何使用这个。我可以访问.j
我试图在我的盖茨比博客上添加一个特色图片,但无法使它工作。我到处找了几样东西,但是我一直有一条错误消息:Field "featuredImage" must not have a selection since type "String" has no subfields.
以下是我的博客结构:
src
|- images
|- house.jpeg
| - pages
|- actualites
|- house.mdx
我的house.mdx有以下前端内容:
---
title: House
path: /house
date: 2