Welcome to mirror list, hosted at ThFree Co, Russian Federation.

another-post.md « post « content « blog « examples - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a063b80f4e369d7bcdcb6eb745d31f1c3692b3f9 (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
+++
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.

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"
    ],
}
```