diff --git a/site/_docs/datafiles.md b/site/_docs/datafiles.md index 7f54a279..5a5de195 100644 --- a/site/_docs/datafiles.md +++ b/site/_docs/datafiles.md @@ -114,3 +114,30 @@ The organizations can then be accessed via `site.data.orgs`, followed by the fil {% endraw %} {% endhighlight %} + +## Example: Accessing a specific author + +Pages and posts can also access a specific item. The example below shows how to access a specific item: + +'_data/peoplejekyll.yml': +{% highlight yaml %} +dave: + name: David Smith + link: /bitcoin-expert/ + twitter: DavidSilvaSmith +{% endhighlight %} + +The author can then be specified as a page variable in a post's frontmatter: + +{% highlight html %} +{% raw %} +--- +title: sample post +author: dave +--- + +{% assign author = site.data.people.[page.author] %} + + +{% endraw %} +{% endhighlight %}