シーンを設定するには、Jekyll_dataフォルダ内のdirectory.jsonに著者情報が格納されている必要があります。異なるJekyll_dataファイルのデータを比較する
"name": "Brandon Bellew",
"bio": "Brandon Bellew is a great writer.",
"email": "[email protected]",
"specialties": "introspection, ventilation systems, memorization, post-prandial revelry",
"photo": "http://www.tpgweb2.net/headshots/thumbs/brandon-b-thumb-2.jpg"
私はまた私のジキル_dataフォルダ
"name": "Beginner's Guide to Google Analytics",
"author": "Brandon Bellew",
"date": "May 18 2016",
"description": "The Google Analytics (GA) dashboard is quite intuitive, and it's easy to collect basic information (number of users on the site, average time spent on site, etc.) without having a deep background in analytics. But what about specifics?",
"category": "Analytics"
の内側に、私は私のcatalogue.jsonファイル内のすべての記事を巡回しようとしていることを表示しています、catalogue.jsonに保存されている記事情報を持っています記事の情報は、私のdirectory.jsonファイルの正しい著者から写真を引き出します。
本質的に私がしようとしているのは、カタログ内の記事の「著者」がディレクトリ項目内の著者の「名前」と一致する場合、その著者に関連する写真を表示することです。そうすれば、私が書く記事ごとに著者の写真を別々のアイテムに保存する必要はありません。ここで
はディレクトリに正しい著者からの写真を引っ張っでの私の失敗の試みです:
<h4>Articles</h4>
{% for item in site.data.catalogue %}
{% for item in site.data.directory %}
{% if item.name == page.author %}
<img src="{{ item.photo }}" >
{% endif %}
{% endfor %}
{% endfor %}
はジキルを使用して、このことは可能ですか私はそれを構築する必要がある別の方法はありますか?