2014-04-12 16:04:17 -04:00
|
|
|
+++
|
|
|
|
title = "Another Hugo Post"
|
|
|
|
description = "Nothing special, but one post is boring."
|
2014-09-02 15:05:20 -04:00
|
|
|
date = "2014-09-02"
|
2014-04-12 16:04:17 -04:00
|
|
|
categories = [ "example", "configuration" ]
|
|
|
|
tags = [
|
|
|
|
"example",
|
|
|
|
"hugo",
|
|
|
|
"toml"
|
|
|
|
]
|
|
|
|
+++
|
|
|
|
|
2014-09-02 15:05:20 -04:00
|
|
|
TOML, YAML, JSON --- Oh my!
|
2014-04-12 16:04:17 -04:00
|
|
|
-------------------------
|
|
|
|
|
|
|
|
One of the nifty Hugo features we should cover: flexible configuration and front matter formats! This entry has front
|
|
|
|
matter in `toml`, unlike the last one which used `yaml`, and `json` is also available if that's your preference.
|
|
|
|
|
2015-12-24 17:04:58 -05:00
|
|
|
<!--more-->
|
|
|
|
|
2014-04-12 16:04:17 -04:00
|
|
|
The `toml` front matter used on this entry:
|
|
|
|
|
|
|
|
```
|
|
|
|
+++
|
|
|
|
title = "Another Hugo Post"
|
|
|
|
description = "Nothing special, but one post is boring."
|
2014-09-02 15:05:20 -04:00
|
|
|
date = "2014-09-02"
|
2014-04-12 16:04:17 -04:00
|
|
|
categories = [ "example", "configuration" ]
|
|
|
|
tags = [
|
|
|
|
"example",
|
|
|
|
"hugo",
|
|
|
|
"toml"
|
|
|
|
]
|
|
|
|
+++
|
|
|
|
```
|
|
|
|
|
2014-09-02 15:05:20 -04:00
|
|
|
This flexibility also extends to your site's global configuration file. You're free to use any format you prefer::simply
|
|
|
|
name the file `config.yaml`, `config.toml` or `config.json`, and go on your merry way.
|
2014-04-12 16:04:17 -04:00
|
|
|
|
|
|
|
JSON Example
|
|
|
|
------------
|
|
|
|
|
|
|
|
How would this entry's front matter look in `json`? That's easy enough to demonstrate:
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"title": "Another Hugo Post",
|
|
|
|
"description": "Nothing special, but one post is boring.",
|
2014-09-02 15:05:20 -04:00
|
|
|
"date": "2014-09-02",
|
2014-04-12 16:04:17 -04:00
|
|
|
"categories": [ "example", "configuration" ],
|
|
|
|
"tags": [
|
|
|
|
"example",
|
|
|
|
"hugo",
|
|
|
|
"toml"
|
|
|
|
],
|
|
|
|
}
|
2014-09-02 15:05:20 -04:00
|
|
|
```
|