commit fdf8db9c21998272fcc55e125aea4a2a78a75eaa
parent 32d645d900188c6709402ba22f6e36aabba7ec5b
Author: Cyrill Schumacher <cyrill@schumacher.fm>
Date: Thu, 12 Feb 2015 10:16:03 +1100
Initial doc file: Dynamic Content
Diffstat:
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/docs/content/extras/datafiles.md b/docs/content/extras/datafiles.md
@@ -5,7 +5,7 @@ date: 2015-01-22
menu:
main:
parent: extras
-next: /extras/highlighting
+next: /extras/dynamiccontent
prev: /extras/scratch
title: Data Files
weight: 90
diff --git a/docs/content/extras/dynamiccontent.md b/docs/content/extras/dynamiccontent.md
@@ -0,0 +1,28 @@
+---
+aliases:
+- /doc/dynamiccontent/
+date: 2015-02-14
+menu:
+ main:
+ parent: extras
+next: /extras/highlighting
+prev: /extras/datafiles
+title: Dynamic Content
+weight: 91
+---
+
+Dynamic content with a static site generator? Yes it is possible!
+
+In addition to the [built-in variables](/templates/variables/) available from Hugo, you can specify your own custom data that can be accessed via templates or shortcodes.
+
+Hugo supports loading data from [YAML](http://yaml.org/), [JSON](http://www.json.org/), and [TOML](https://github.com/toml-lang/toml) files located in the `data` directory.
+
+**It even works with [LiveReload](/extras/livereload/).**
+
+## The Data Folder
+
+As explained in [Source Organization](/overview/source-directory/), the `data` folder is where you can store additional data for Hugo to use when generating your site. These files must be YAML, JSON or TOML files (using either the `.yml`, `.yaml`, `.json` or `toml` extension) and the data will be accessible as a `map` in `.Site.Data`.
+
+**The keys in this map will be a dot chained set of _path_, _filename_ and _key_ in file (if applicable).**
+
+This is best explained with an example: