Skip to content

Commit 05fabc0

Browse files
committed
Add total count to all category
1 parent f6602ca commit 05fabc0

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

sass/custom/_paulus.scss

+4
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ p.note {
372372
@media only screen and (min-width: $desk-start) {
373373
#components-page {
374374
.filter-button-group {
375+
.featured {
376+
margin: 12px 0;
377+
}
378+
375379
.btn {
376380
display: block;
377381
background: 0;

source/components/index.html

+8-5
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@
1313
regenerate: true
1414
---
1515

16+
{% assign count = site.components | size %}
17+
{% assign nocat = site.components | where: 'ha_category', null | size %}
18+
{% assign tot = count | minus: nocat %}
19+
{% assign components = site.components | sort: 'title' %}
20+
{% assign categories = components | sort: 'ha_category' | map: 'ha_category' | uniq %}
21+
1622
<p class='note'>
1723
Support for these components is provided by the Home Assistant community.
1824
</p>
1925

20-
{% assign components = site.components | sort: 'title' %}
21-
{% assign categories = components | sort: 'ha_category' | map: 'ha_category' | uniq %}
22-
2326
<div class="grid">
2427
<div class="grid__item one-sixth lap-one-whole palm-one-whole">
2528

2629
<div class="filter-button-group">
27-
<a href='#all' class="btn">All</a>
28-
<a href='#featured' class="btn">Featured</a>
30+
<a href='#all' class="btn">All ({{tot}})</a>
31+
<a href='#featured' class="btn featured">Featured</a>
2932

3033
{% for category in categories %}
3134
{% if category and category != 'Other' %}

0 commit comments

Comments
 (0)