Add total count to all category

This commit is contained in:
Paulus Schoutsen 2016-08-14 15:09:21 -07:00
parent f6602cab8c
commit 05fabc002b
2 changed files with 12 additions and 5 deletions

View File

@ -372,6 +372,10 @@ p.note {
@media only screen and (min-width: $desk-start) { @media only screen and (min-width: $desk-start) {
#components-page { #components-page {
.filter-button-group { .filter-button-group {
.featured {
margin: 12px 0;
}
.btn { .btn {
display: block; display: block;
background: 0; background: 0;

View File

@ -13,19 +13,22 @@ body_id: components-page
regenerate: true 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'> <p class='note'>
Support for these components is provided by the Home Assistant community. Support for these components is provided by the Home Assistant community.
</p> </p>
{% assign components = site.components | sort: 'title' %}
{% assign categories = components | sort: 'ha_category' | map: 'ha_category' | uniq %}
<div class="grid"> <div class="grid">
<div class="grid__item one-sixth lap-one-whole palm-one-whole"> <div class="grid__item one-sixth lap-one-whole palm-one-whole">
<div class="filter-button-group"> <div class="filter-button-group">
<a href='#all' class="btn">All</a> <a href='#all' class="btn">All ({{tot}})</a>
<a href='#featured' class="btn">Featured</a> <a href='#featured' class="btn featured">Featured</a>
{% for category in categories %} {% for category in categories %}
{% if category and category != 'Other' %} {% if category and category != 'Other' %}