mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-28 03:37:06 +00:00
Rename Jekyll components collection to integrations
This commit is contained in:
parent
57c6dec6c2
commit
611115e1ea
@ -63,7 +63,7 @@ titlecase: true # Converts page and post titles to titlecase
|
|||||||
# page_asides:
|
# page_asides:
|
||||||
|
|
||||||
collections:
|
collections:
|
||||||
components:
|
integrations:
|
||||||
output: true
|
output: true
|
||||||
cookbook:
|
cookbook:
|
||||||
output: true
|
output: true
|
||||||
|
@ -10,7 +10,7 @@ regenerate: false
|
|||||||
|
|
||||||
{%- comment -%}Can't use where to count nil because of https://github.com/jekyll/jekyll/issues/6038{%- endcomment -%}
|
{%- comment -%}Can't use where to count nil because of https://github.com/jekyll/jekyll/issues/6038{%- endcomment -%}
|
||||||
{%- assign tot = 0 -%}
|
{%- assign tot = 0 -%}
|
||||||
{%- for comp in site.components -%}
|
{%- for comp in site.integrations -%}
|
||||||
{%- if comp.ha_category -%}
|
{%- if comp.ha_category -%}
|
||||||
{%- if comp.ha_category.first -%}
|
{%- if comp.ha_category.first -%}
|
||||||
{%- assign tot = tot | plus: comp.ha_category.size -%}
|
{%- assign tot = tot | plus: comp.ha_category.size -%}
|
||||||
@ -20,8 +20,8 @@ regenerate: false
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
||||||
{%- assign components = site.components | sort: 'title' -%}
|
{%- assign components = site.integrations | sort: 'title' -%}
|
||||||
{%- assign components_by_version = site.components | group_components_by_release -%}
|
{%- assign components_by_version = site.integrations | group_components_by_release -%}
|
||||||
{%- assign categories = components | map: 'ha_category' | join: ',' | join: ',' | split: ',' | uniq | sort -%}
|
{%- assign categories = components | map: 'ha_category' | join: ',' | join: ',' | split: ',' | uniq | sort -%}
|
||||||
|
|
||||||
<p class='note'>
|
<p class='note'>
|
||||||
@ -38,7 +38,8 @@ Support for these integrations is provided by the Home Assistant community.
|
|||||||
{%- for group in components_by_version -%}
|
{%- for group in components_by_version -%}
|
||||||
<optgroup label="{{ group.label }} ({{group.new_components_count}})">
|
<optgroup label="{{ group.label }} ({{group.new_components_count}})">
|
||||||
{%- for version in group.versions -%}
|
{%- for version in group.versions -%}
|
||||||
<option value="#version/{{ version.label }}">{{ version.label }} ({{ version.new_components_count }})</option>
|
<option value="#version/{{ version.label }}">{{ version.label }} ({{ version.new_components_count }})
|
||||||
|
</option>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
@ -84,19 +85,50 @@ Support for these integrations is provided by the Home Assistant community.
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// This object contains all components we have
|
// This object contains all components we have
|
||||||
var allComponents = [
|
var allComponents = [{
|
||||||
{%- for component in components -%}
|
% -
|
||||||
{%- if component.ha_category -%}
|
for component in components - %
|
||||||
{%- assign sliced_version = component.ha_release | split: '.' -%}
|
} {
|
||||||
{%- assign minor_version = sliced_version[1]|plus: 0 -%}
|
% -
|
||||||
{%- assign major_version = sliced_version[0]|plus: 0 -%}
|
if component.ha_category - %
|
||||||
{%- assign featured_first = true -%}
|
} {
|
||||||
{%- for ha_category in component.ha_category -%}
|
% -assign sliced_version = component.ha_release | split: '.' - %
|
||||||
{url:"{{ component.url }}", title:"{{component.title}}", cat:"{{ha_category | slugify}}", featured: {% if component.featured and featured_first %}true{% else %}false{% endif %}, v: "{{major_version}}.{{minor_version}}", logo: "{{component.logo}}"},
|
} {
|
||||||
{%- assign featured_first = false -%}
|
% -assign minor_version = sliced_version[1] | plus: 0 - %
|
||||||
{%- endfor -%}
|
} {
|
||||||
{% endif -%}
|
% -assign major_version = sliced_version[0] | plus: 0 - %
|
||||||
{%- endfor -%}
|
} {
|
||||||
|
% -assign featured_first = true - %
|
||||||
|
} {
|
||||||
|
% -
|
||||||
|
for ha_category in component.ha_category - %
|
||||||
|
} {
|
||||||
|
url: "{{ component.url }}",
|
||||||
|
title: "{{component.title}}",
|
||||||
|
cat: "{{ha_category | slugify}}",
|
||||||
|
featured: {
|
||||||
|
%
|
||||||
|
if component.featured and featured_first %
|
||||||
|
}
|
||||||
|
true {
|
||||||
|
%
|
||||||
|
else %
|
||||||
|
}
|
||||||
|
false {
|
||||||
|
% endif %
|
||||||
|
},
|
||||||
|
v: "{{major_version}}.{{minor_version}}",
|
||||||
|
logo: "{{component.logo}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
% -assign featured_first = false - %
|
||||||
|
} {
|
||||||
|
% -endfor - %
|
||||||
|
} {
|
||||||
|
% endif - %
|
||||||
|
} {
|
||||||
|
% -endfor - %
|
||||||
|
}
|
||||||
false
|
false
|
||||||
];
|
];
|
||||||
allComponents.pop(); // remove placeholder element at the end
|
allComponents.pop(); // remove placeholder element at the end
|
||||||
@ -240,7 +272,8 @@ allComponents.pop(); // remove placeholder element at the end
|
|||||||
function debounce(func, wait, immediate) {
|
function debounce(func, wait, immediate) {
|
||||||
var timeout;
|
var timeout;
|
||||||
return function () {
|
return function () {
|
||||||
var context = this, args = arguments;
|
var context = this,
|
||||||
|
args = arguments;
|
||||||
var later = function () {
|
var later = function () {
|
||||||
timeout = null;
|
timeout = null;
|
||||||
if (!immediate) {
|
if (!immediate) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user