1.安装插件
我用Gatsby就是因为它支持Markdown.所以不墨迹,直接整Md支持。
yarn add gatsby-source-filesystem
yarn add gatsby-transformer-remark
2.添加格式化文章
在src>pages下面,添加三篇文章,头部格式如下:
path : "/blog/my-first-post"date : "2019-05-01"title : "Hello world"tags : ['教程','Gatsby']
excerpt : "Gatsby hello word post"
完整代码如图所示:


本文是Gatsby入门指南的第一部分,主要介绍如何安装支持Markdown的插件以及如何添加格式化的Markdown文章。在Gatsby的src>pages目录下创建Markdown格式的文章,每个文章包含路径、日期、标题、标签和摘要等元信息。
353

被折叠的 条评论
为什么被折叠?



