我的降价有一些额外的备注,如下所示:
--- path: "/" date: "2018-10-12" title: "xxxx" description: "desccc" --- some of the text
我怎样才能得到描述?
{ allMarkdownRemark( sort: { order: DESC, fields: [frontmatter___date] } limit: 1000 ) { edges { node { frontmatter { path title date } } } } }
嗯,降价文件的头部分通常被称为 frontmatter 并且会自动为您转换,所以只需添加 description frontmatter { ... } title 例如字段。
frontmatter
description
frontmatter { ... }
title