Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for TOML front matter (#141) #164

Merged
merged 2 commits into from Apr 23, 2018
Merged

feat: support for TOML front matter (#141) #164

merged 2 commits into from Apr 23, 2018

Conversation

ghost
Copy link

@ghost ghost commented Apr 20, 2018

I took a stab at swapping out yaml-front-matter for gray-matter to enable TOML front matter. In addition, JSON front matter also works (but I believe it did with yaml-front-matter as well).

Here's an example of how to use TOML front-matter:

---toml
title = 'This is a title'
[[meta]]
  name = 'description'
  content = 'hello'
---

I also refactored the front matter parsing code a bit, making use of the existing parseFrontmatter util.

P.S. This is my first pull request. Please let me know if I am missing anything 😄

@yyx990803 yyx990803 merged commit 70620ba into vuejs:master Apr 23, 2018
@yyx990803
Copy link
Member

Great job for a 1st PR!

@ghost ghost deleted the front-matter-enhancements branch April 23, 2018 15:45
@ulivz ulivz mentioned this pull request May 10, 2018
4 tasks
@ulivz ulivz mentioned this pull request Sep 15, 2018
@rwxrob
Copy link

rwxrob commented Sep 15, 2018

Very nice indeed and not in the documentation that I could find. I will look again and maybe submit a documentation PR to cover it if needed.

I'm a little torn on the ---toml convention but it makes a lot of sense since it allows whatever possible language to be used or added later without inventing yet another marker (as Hugo does for YAML, TOML, and JSON).

@ulivz
Copy link
Member

ulivz commented Sep 15, 2018

@robmuh Welcome to open a PR for that. Features added in the early days may have forgotten to add doc, but should be rare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants