Skip to content

Commit 3c20914

Browse files
committed
added some more info to the crate
1 parent 83d9013 commit 3c20914

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

templates/crates/single.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,26 @@
33

44
{% block content %}
55
<div class="center mw7">
6-
{% set info = load_data(url="https://crates.io/api/v1/crates/" ~ term.name, format="json") %}
6+
{#% set info = load_data(url="https://crates.io/api/v1/crates/" ~ term.name, format="json") %#}
7+
{% set info = load_data(url="https://crates.io/api/v1/crates/winapi", format="json") %}
78
<h1 class="w-100">{{ term.name }}</h1>
9+
{# assign a shorter variable to info.crate for sanity #}
10+
{% set c = info.crate %}
811
<div>
9-
{% if info.crate.description %}
10-
<p>{{info.crate.description}}</p>
12+
{% if c.description %}
13+
<p>{{c.description}}</p>
14+
{% endif %}
15+
16+
{% if c.updated_at %}
17+
<p>Updated at {{c.updated_at | date(format="%Y-%m-%d %H:%M%Z")}}</p>
18+
{% endif %}
19+
20+
{% if c.documentation %}
21+
<p>
22+
<a target="_blank" href="{{c.documentation}}">
23+
Documentation
24+
</a>
25+
</p>
1126
{% endif %}
1227
</div>
1328

0 commit comments

Comments
 (0)