Add total count to all category
This commit is contained in:
parent
f6602cab8c
commit
05fabc002b
2 changed files with 12 additions and 5 deletions
|
@ -372,6 +372,10 @@ p.note {
|
|||
@media only screen and (min-width: $desk-start) {
|
||||
#components-page {
|
||||
.filter-button-group {
|
||||
.featured {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: block;
|
||||
background: 0;
|
||||
|
|
|
@ -13,19 +13,22 @@ body_id: components-page
|
|||
regenerate: true
|
||||
---
|
||||
|
||||
{% assign count = site.components | size %}
|
||||
{% assign nocat = site.components | where: 'ha_category', null | size %}
|
||||
{% assign tot = count | minus: nocat %}
|
||||
{% assign components = site.components | sort: 'title' %}
|
||||
{% assign categories = components | sort: 'ha_category' | map: 'ha_category' | uniq %}
|
||||
|
||||
<p class='note'>
|
||||
Support for these components is provided by the Home Assistant community.
|
||||
</p>
|
||||
|
||||
{% assign components = site.components | sort: 'title' %}
|
||||
{% assign categories = components | sort: 'ha_category' | map: 'ha_category' | uniq %}
|
||||
|
||||
<div class="grid">
|
||||
<div class="grid__item one-sixth lap-one-whole palm-one-whole">
|
||||
|
||||
<div class="filter-button-group">
|
||||
<a href='#all' class="btn">All</a>
|
||||
<a href='#featured' class="btn">Featured</a>
|
||||
<a href='#all' class="btn">All ({{tot}})</a>
|
||||
<a href='#featured' class="btn featured">Featured</a>
|
||||
|
||||
{% for category in categories %}
|
||||
{% if category and category != 'Other' %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue