-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.njk
170 lines (166 loc) Β· 10.7 KB
/
categories.njk
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
maxResults: 10
layout: layout.njk
pagination:
data: "sites"
size: 1
alias: vertical
permalink: "/{{ (sites[vertical].name or vertical) | slug }}/"
---
<div class="leaderboard-wrapper">
<table class="leaderboard">
<thead>
<tr>
<th>Rank</th>
<th class="leaderboard-hide-md">Trophy</th>
<th>URL</th>
<th colspan="2" class="leaderboard-hide-sm">Lighthouse</th>
<th class="leaderboard-data-right"><span data-sr-only>Data and Graphs</span></th>
</tr>
</thead>
<tbody>
{%- for site in results | filterToUrls(sites[vertical].urls) | addLighthouseTotals | sort([':lastkey', 'lighthouse', ':lhtotal']) %}
{%- set newestKey = site | getObjectKey(":newest") %}
{%- set key = site | getObjectKey %}
{%- set hundos = site[newestKey] | hundoCount %}
<tr class="leaderboard-list-entry">
<td class="leaderboard-number">#{{ loop.index }}</td>
<td class="leaderboard-hide-md">{% if loop.index0 === 0 %}π{% elseif loop.index0 === 1 %}π₯{% elseif loop.index0 === 2 %}π₯{% endif %}</td>
<td><a href="{{ site[newestKey].url }}"><code class="url">{{ site[newestKey].url | displayUrl }}</code></a></td>
<td class="leaderboard-number leaderboard-hide-sm">{{ site[newestKey] | lighthouseTotal }}</td>
<td class="hundo-emojis{% if hundos === 4 %} hundo-emojis-400{% endif %} leaderboard-hide-sm"><span class="leaderboard-hide-md">{{ "π―" | repeat(hundos) }}</span></td>
<td class="leaderboard-data-right"><a href="#details-{{ site[key].url | shortHash }}" data-expand-alias data-js-only><span class="leaderboard-expand-icon"></span> Data<span class="leaderboard-hide-md"> and Graphs</span></a></td>
</tr>
<tr class="leaderboard-list-entry-details">
<td colspan="6">
<details class="leaderboard-details" id="details-{{ site[key].url | shortHash }}">
<summary>Show Data</summary>
<div class="layout color--lighthouse">
<div class="tablewrap">
<table data-make-chart class="results">
<thead>
<tr>
<th rowspan="2" class="results-date">Date</th>
<th rowspan="2" colspan="2">Rank</th>
<th colspan="9">Lighthouse</th>
<th colspan="2" rowspan="2">Axe</th>
</tr>
<tr>
<th class="results-series-a" colspan="3"><abbr title="Performance">Perf</abbr></th>
<th class="results-series-b" colspan="2"><abbr title="Accessibility">A11Y</abbr></th>
<th class="results-series-c" colspan="2">Best Practices</th>
<th class="results-series-d" colspan="2">SEO</th>
</tr>
</thead>
<tbody>
{%- for entry in site | sort | headAndLast(maxResults) %}
<tr>
<td><code class="date">{{ entry.timestamp | displayDate | safe }}</code></td>
<td class="results-bool">{% if entry.ranks.hundos %}{% if entry.ranks.hundos === 1 %}π{% endif %}{% endif %}</td>
<td>{% if entry.ranks.hundos %}#{{ entry.ranks.hundos }}{% endif %}</td>
<td class="results-bool">{% if entry.lighthouse.performance === 1 %}<span class="leaderboard-hide-sm">β
</span>{% else %}π«{% endif %}</td>
<td data-numeric-value="{{ (entry.lighthouse.performance * 100) | round }}">{{ (entry.lighthouse.performance * 100) | round }}</td>
<td class="results-calc"><a href="https://googlechrome.github.io/lighthouse/scorecalc/#FCP={{ entry.firstContentfulPaint }}&SI={{ entry.speedIndex }}&LCP={{ entry.largestContentfulPaint }}&TTI={{ entry.timeToInteractive }}&TBT={{ entry.totalBlockingTime }}&CLS={{ entry.cumulativeLayoutShift }}&FCI=&FMP=&device={{ entry.lighthouse.type or "mobile" }}&version={{ entry.lighthouse.version or "6.0.0" }}" target="_blank" rel="noopener noreferrer" class="leaderboard-hide-md">Calculator</a></td>
<td class="results-bool">{% if entry.lighthouse.accessibility === 1 %}<span class="leaderboard-hide-sm">β
</span>{% else %}π«{% endif %}</td>
<td data-numeric-value="{{ (entry.lighthouse.accessibility * 100) | round }}">{{ (entry.lighthouse.accessibility * 100) | round }}</td>
<td class="results-bool">{% if entry.lighthouse.bestPractices === 1 %}<span class="leaderboard-hide-sm">β
</span>{% else %}π«{% endif %}</td>
<td data-numeric-value="{{ (entry.lighthouse.bestPractices * 100) | round }}">{{ (entry.lighthouse.bestPractices * 100) | round }}</td>
<td class="results-bool">{% if entry.lighthouse.seo === 1 %}<span class="leaderboard-hide-sm">β
</span>{% else %}π«{% endif %}</td>
<td data-numeric-value="{{ (entry.lighthouse.seo * 100) | round }}">{{ (entry.lighthouse.seo * 100) | round }}</td>
<td class="results-bool">{% if entry.axe.violations == 0 %}<span class="leaderboard-hide-sm">β
</span>{% else %}π«{% endif %}</td>
<td>{{ entry.axe.violations }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
<div data-js-only class="ct-chart ct-double-octave"></div>
</div>
<div class="layout color--vitals">
<div class="tablewrap">
<table data-make-chart class="results">
<thead>
<tr>
<th rowspan="2" class="results-date">Date</th>
<th colspan="8">Core Web Vitals</th>
<th colspan="6">Web Vitals</th>
</tr>
<tr>
<th class="results-series-a" colspan="2"><abbr title="Largest Contentful Paint">LCP</abbr></th>
<th class="results-series-b" colspan="2">Max <span class="leaderboard-hide-sm">Potential </span><abbr title="First Input Delay">FID</abbr></th>
<th class="results-series-c" colspan="2"><abbr title="Total Blocking Time">TBT</abbr></th>
<th colspan="2"><abbr title="Cumulative Layout Shift">CLS</abbr></th>
<th class="results-series-d" colspan="2"><abbr title="First Contentful Paint">FCP</abbr></th>
<th class="results-series-e" colspan="2"><abbr title="Speed Index">SI</abbr></th>
<th class="results-series-f" colspan="2"><abbr title="Time to Interactive">TTI</abbr></th>
</tr>
</thead>
<tbody>
{%- for entry in site | sort | headAndLast(maxResults) %}
<tr>
<td><code class="date">{{ entry.timestamp | displayDate | safe }}</code></td>
<td class="results-bool">{% if entry.largestContentfulPaint <= 1550 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td data-numeric-value="{{ entry.largestContentfulPaint }}">{{ entry.largestContentfulPaint | displayTime }}</td>
{# https://web.dev/lighthouse-max-potential-fid/#how-lighthouse-determines-your-max-potential-fid-score #}
<td class="results-bool">{% if entry.maxPotentialFirstInputDelay <= 130 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td data-numeric-value="{{ entry.maxPotentialFirstInputDelay }}">{{ entry.maxPotentialFirstInputDelay | displayTime }}</td>
<td class="results-bool">{% if entry.totalBlockingTime <= 130 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td data-numeric-value="{{ entry.totalBlockingTime }}">{{ entry.totalBlockingTime | displayTime }}</td>
<td class="results-bool">{% if entry.cumulativeLayoutShift <= 0.03 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td>{{ entry.cumulativeLayoutShift | showDigits(2) }}</td>
<td class="results-bool">{% if entry.firstContentfulPaint <= 1350 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td data-numeric-value="{{ entry.firstContentfulPaint }}">{{ entry.firstContentfulPaint | displayTime }}</td>
<td class="results-bool">{% if entry.speedIndex <= 1960 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td data-numeric-value="{{ entry.speedIndex }}">{{ entry.speedIndex | displayTime }}</td>
<td class="results-bool">{% if entry.timeToInteractive <= 1940 %}<span class="leaderboard-hide-sm">β
</span>{% endif %}</td>
<td data-numeric-value="{{ entry.timeToInteractive }}">{{ entry.timeToInteractive | displayTime }}</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
<div data-js-only class="ct-chart ct-double-octave"></div>
</div>
<div class="layout color--weight">
<div class="tablewrap">
<table data-make-chart class="results">
<thead>
<tr>
<th rowspan="2" class="results-date">Date</th>
<th colspan="7">Weight</th>
</tr>
<tr>
<th class="results-series-a">Total</th>
<th class="results-series-b">HTML</th>
<th class="results-series-c"><abbr title="Cascading Style Sheets">CSS</abbr></th>
<th class="results-series-d"><abbr title="JavaScript">JS</abbr></th>
<th class="results-series-e">Images</th>
<th class="results-series-f">Fonts</th>
<th>Third Party</th>
</tr>
</thead>
<tbody>
{%- for entry in site | sort | headAndLast(maxResults) %}
<tr>
<td><code class="date">{{ entry.timestamp | displayDate | safe }}</code></td>
<td data-numeric-value="{{ entry.weight.total / 1024 }}">{{ entry.weight.total | displayFilesize | safe }}</td>
<td data-numeric-value="{{ entry.weight.document / 1024 }}">{{ entry.weight.document | displayFilesize | safe }}</td>
<td data-numeric-value="{{ entry.weight.stylesheet / 1024 }}">{% if entry.weight.stylesheet or entry.weight.stylesheet === 0 %}{{ entry.weight.stylesheet | displayFilesize | safe }} <span class="count leaderboard-hide-sm">Γ{{ entry.weight.stylesheetCount }}</span>{% else %}β{% endif %}</td>
<td data-numeric-value="{{ entry.weight.script / 1024 }}">{{ entry.weight.script | displayFilesize | safe }} <span class="count leaderboard-hide-sm">Γ{{ entry.weight.scriptCount }}</span></td>
<td data-numeric-value="{{ entry.weight.image / 1024 }}">{{ entry.weight.image | displayFilesize | safe }} <span class="count leaderboard-hide-sm">Γ{{ entry.weight.imageCount }}</span></td>
<td data-numeric-value="{{ entry.weight.font / 1024 }}">{{ entry.weight.font | displayFilesize | safe }} <span class="count leaderboard-hide-sm">Γ{{ entry.weight.fontCount }}</span></td>
<td data-numeric-value="{{ entry.weight.thirdParty / 1024 }}">{{ entry.weight.thirdParty | displayFilesize | safe }} <span class="count leaderboard-hide-sm">Γ{{ entry.weight.thirdPartyCount }}</span></td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
<div data-js-only class="ct-chart ct-double-octave"></div>
</div>
</details>
</td>
</tr>
{%- endfor %}
</tbody>
</table><!-- /leaderboard -->
</div><!-- /leaderboard-wrapper -->