hexo-front-matter

2018-11-09 admin

hexo-front-matter是什么

什么是hexo-front-matter,Front-matter parser.

hexo-front-matter使用教程帮助文档

hexo-front-matter

Build Status NPM version Coverage Status

Front-matter parser.

What is Front-matter?

Front-matter allows you to specify data at the top of a file. Here’re two formats:

YAML front-matter

---
layout: false
title: "Hello world"
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

JSON front-matter

;;;
"layout": false,
"title": "Hello world"
;;;
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Prefixing separators are optional.

API

parse(str, [options])

Parses front-matter.

stringify(obj, [options])

Converts an object to a front-matter string.

Option Description Default
mode The mode can be either json or yaml. yaml
separator Separator ---
prefixSeparator Add prefixing separator. false

split(str)

Splits a YAML front-matter string.

escape(str)

Converts hard tabs to soft tabs.

License

MIT

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-44988.html

文章标题:hexo-front-matter

回到顶部