Hello,
I am trying to output correctly in my views a bio description of the author, based on the current language of the website.
So I have a data/authors.yml
file that looks like this:
- matt:
name: Matt
bio:
en: "bio in English"
ja: "bio in Japanese"
- eric:
name: Eric
bio:
en: "bio in English"
ja: "bio in Japanese"
in my article frontmatter I have:
author: eric
lang: en
In my article view file, I want to display some info about authors that will depend on the language of the site. So I have at the very beginning of the file. find_author
is my helper to point to correct author in .yml
file
- author = find_author(current_article.data.author)
- lang = current_page.data.lang
But somehow I keep failing to combine the data to correctly display the bio from .yml
file:
#{author.bio.lang}