Skip to content

Commit bfc144d

Browse files
committed
Show example image if one is present
1 parent cb95c7e commit bfc144d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

examples/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ <h1>Learn from examples!</h1>
2525
<div class="columns full">
2626
<h2 id="categories">Categories</h2>
2727
<div class="grid-150" style="font-size: 0.9em; grid-gap: 0 1rem; ">
28-
29-
3028
{% for category in all_categories %}
3129
<a href="#{{ category }}">{{ category | capitalize }}</a>
3230
{% endfor %}
@@ -41,7 +39,12 @@ <h3 id="{{ category }}">{{ category | capitalize }}</h3>
4139
<div class="grid-250">
4240
{%- assign examples = site.data.examplesindex | where: "category", category -%}
4341
{%- for example in examples -%}
44-
{% include learn_card.html title=example.title description=example.brief link=example.path min-height="250px" %}
42+
{%- if example.thumbnail -%}
43+
{%- assign image = example.path | append: "/" | append: example.thumbnail -%}
44+
{%- else -%}
45+
{%- assign image = "" -%}
46+
{%- endif -%}
47+
{% include learn_card.html title=example.title description=example.brief link=example.path min-height="250px" image=image %}
4548
{%- endfor -%}
4649
</div>
4750
<p>˄ <a href="#categories">Top</a></p>

ref/alpha/resource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
layout: api
33
branch: alpha
4-
ref: resource-lua
5-
language: Lua
4+
ref: resource-cpp
5+
language: C++
66
title: API reference (Resource)
77
---
88
{% include anchor_headings.html html=content %}

0 commit comments

Comments
 (0)