From 611115e1ea2dc110277c0a55f5e25aef47f26af7 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 29 Sep 2019 22:03:21 +0200 Subject: [PATCH] Rename Jekyll components collection to integrations --- _config.yml | 2 +- source/integrations/index.html | 399 ++++++++++++++++++--------------- 2 files changed, 217 insertions(+), 184 deletions(-) diff --git a/_config.yml b/_config.yml index c8657356797..1fcd8b3c3e8 100644 --- a/_config.yml +++ b/_config.yml @@ -63,7 +63,7 @@ titlecase: true # Converts page and post titles to titlecase # page_asides: collections: - components: + integrations: output: true cookbook: output: true diff --git a/source/integrations/index.html b/source/integrations/index.html index 3e4de44d1ba..dca1868b1a4 100644 --- a/source/integrations/index.html +++ b/source/integrations/index.html @@ -10,22 +10,22 @@ regenerate: false {%- comment -%}Can't use where to count nil because of https://github.com/jekyll/jekyll/issues/6038{%- endcomment -%} {%- assign tot = 0 -%} -{%- for comp in site.components -%} - {%- if comp.ha_category -%} - {%- if comp.ha_category.first -%} - {%- assign tot = tot | plus: comp.ha_category.size -%} - {%- else -%} - {%- assign tot = tot | plus: 1 -%} - {%- endif -%} - {%- endif %} +{%- for comp in site.integrations -%} +{%- if comp.ha_category -%} +{%- if comp.ha_category.first -%} +{%- assign tot = tot | plus: comp.ha_category.size -%} +{%- else -%} +{%- assign tot = tot | plus: 1 -%} +{%- endif -%} +{%- endif %} {%- endfor -%} -{%- assign components = site.components | sort: 'title' -%} -{%- assign components_by_version = site.components | group_components_by_release -%} +{%- assign components = site.integrations | sort: 'title' -%} +{%- assign components_by_version = site.integrations | group_components_by_release -%} {%- assign categories = components | map: 'ha_category' | join: ',' | join: ',' | split: ',' | uniq | sort -%}

-Support for these integrations is provided by the Home Assistant community. + Support for these integrations is provided by the Home Assistant community.

@@ -34,21 +34,22 @@ Support for these integrations is provided by the Home Assistant community. All ({{tot}}) Featured
Added in:
-{%- for category in categories -%} - {%- assign components_count = components | where: 'ha_category', category | size -%} - {%- if category and category != 'Other' and components_count != 0 -%} - {{ category }} ({{ components_count }}) - {%- endif -%} -{%- endfor -%} + {%- endfor -%} +
+ {%- for category in categories -%} + {%- assign components_count = components | where: 'ha_category', category | size -%} + {%- if category and category != 'Other' and components_count != 0 -%} + {{ category }} ({{ components_count }}) + {%- endif -%} + {%- endfor -%} Other ({{ components | where: 'ha_category', 'Other' | size }})
@@ -69,7 +70,7 @@ Support for these integrations is provided by the Home Assistant community. {% raw %} + \ No newline at end of file