diff --git a/site/_docs/datafiles.md b/site/_docs/datafiles.md index 2996eb52..afa54b8f 100644 --- a/site/_docs/datafiles.md +++ b/site/_docs/datafiles.md @@ -119,3 +119,33 @@ file name: {% endraw %} {% endhighlight %} + +## Example: Accessing a specific author + +Pages and posts can also access a specific data item. The example below shows how to access a specific item: + +`_data/people.yml`: +{% highlight yaml %} +dave: + name: David Smith + 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] %} + + {{ author.name }} + + +{% endraw %} +{% endhighlight %} diff --git a/site/_docs/variables.md b/site/_docs/variables.md index 628a9904..11ff633b 100644 --- a/site/_docs/variables.md +++ b/site/_docs/variables.md @@ -103,10 +103,10 @@ following is a reference of the available data.
If the page being processed is a Post, this contains a list of up to ten
- related Posts. By default, these are low quality but fast to compute.
+ related Posts. By default, these are the ten most recent posts.
For high quality but slow to compute results, run the
jekyll
command with the --lsi
(latent semantic
- indexing) option.
+ indexing) option. Also note Github pages does not support the lsi
option when generating sites.