forked from RustPython/rustpython.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmarks.html
78 lines (73 loc) · 2.77 KB
/
benchmarks.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
layout: default
---
<section>
<div class="w-80 m-auto mt-2">
<div class="d-md-flex">
<div class="d-sm-none">
<img class="logo" src="{{site.baseurl}}/assets/img/rust-python-logo.svg" alt="RustPython Logo">
</div>
<div class="pl-md-2">
<div class="section-title">RustPython</div>
<div class="title">{{ page.title | escape }}</div>
<small>{{ site.benchmarks-intro }}</small>
</div>
</div>
</div>
</section>
<div class="w-80 m-auto mt-2">
<div class="benchmarks-intro">
{{ content }}
</div>
{% assign folders = "" | split: ", " %}
{% for image in site.static_files %}
{% if image.path contains 'criterion/' %}
{% assign imagepath = image.path | split: "/" %}
{% for subpath in imagepath %}
{% if forloop.index0 == 3 %}
{% assign folders = folders | append: pathName %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% assign folders = folders | uniq %}
<!-- The code block below does exactly the same as the one above, which one is cleaner? -->
<!-- {% assign folders = "" | split: ", " %}
{% for folder in site.static_files %}
{% if folder.path contains 'criterion/' %}
{% assign temp = folder.path | split: 'criterion/' %}
{% assign pathName = temp[1] | split: '/' | first %}
{% assign pathName = pathName | split: ", " %}
{% assign folders = folders | concat: pathName %}
{% endif %}
{% endfor%}
{% assign folders = folders | uniq %} -->
{% if folders.size == 0 %}
<p style="color: red;">There are no benchmarks to be displayed.</p>
<p>This shouldn't be happening, please contact one of the maintainers
through <a href="https://gitter.im/rustpython/Lobby">Gitter</a> to report this problem.</p>
{% else %}
<ul class="tab" data-tab="benchmarks">
{% for folder in folders %}
<li {% if forloop.index==1 %} class="active" {% endif %}>
<a href="">{{ folder }}</a>
</li>
{% endfor%}
</ul>
<ul class="tab-content" id="benchmarks">
{% for folder in folders %}
<li {% if forloop.index==1 %} class="active" {% endif %}>
<br>
{% for image in site.static_files %}
{% if image.path contains folder %}
<figure>
<img src="{{ site.baseurl }}{{ image.path }}" alt="image" />
<figcaption>{{ image.name }}</figcaption>
</figure>
{% endif %}
{% endfor%}
</li>
{% endfor%}
</ul>
{% endif %}
</div>