Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

"Proper" YAML front-matter format?

Started by Muut Archive 11 years ago · 4 replies · 1242 views
11 years ago

I've been writing YAML page front-matter like this:

TXT

title: 'Using Typora with Grav'
slug: using-typora-with-grav
date: 11/25/2015
taxonomy:
topic: [web development]
tag: [opinion, grav, technique]
featherlight:
active: true

TXT

If I open that page in the Admin, it re-writes the front-matter like this:

TXT

title: 'Using Typora With Grav'
process:
markdown: true
twig: true
robots:
noindex: true
nofollow: true
slug: using-typora-with-grav
date: '25-11-2015 00:00'
taxonomy:
tag:

  • opinion
  • technique
  • grav
    topic:
  • 'web development'
    child_type: default
    featherlight:
    active: true
    TXT
    
    

I assume the more verbose format is preferred?

11 years ago

How about some code blocks bob?

There are multiple YAML shortcuts and yes, it's a shortcut because it's often easier to write. Unfortunately the admin doesn't really know how you had something written before, it simply loads the values into the form, then after validation, it saves the results as YAML, there are rules in place that tell it to use short version up to a certain depth, and long after. I think that is past 2 levels.

11 years ago

I thought I had code blocks in the post via and but they didn't come out that way. Wrong syntax? Those are 3 `.

11 years ago

Now I'm getting code blocks I don't want!

11 years ago

I assume the

YAML
robots:
  noindex: true
  nofollow: true

is the default and it turns off robots, such as Google's web spider? Is so, is that the best default?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago