summaryrefslogtreecommitdiffhomepage
path: root/examples/blog/content/post/another-post.md
blob: 057c2d27bb6d04389d2313969d713c90ff772944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
+++
title = "Another Hugo Post"
description = "Nothing special, but one post is boring."
date = "2014-09-02"
categories = [ "example", "configuration" ]
tags = [
    "example",
    "hugo",
    "toml"
]
+++

TOML, YAML, JSON --- Oh my!
-------------------------

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.

<!--more-->

The `toml` front matter used on this entry:

```
+++
title = "Another Hugo Post"
description = "Nothing special, but one post is boring."
date = "2014-09-02"
categories = [ "example", "configuration" ]
tags = [
    "example",
    "hugo",
    "toml"
]
+++
```

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.

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.",
    "date": "2014-09-02",
    "categories": [ "example", "configuration" ],
    "tags": [
        "example",
        "hugo",
        "toml"
    ],
}
```