mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-14 04:46:49 +00:00
🐎 Improves build speed by removing old platform logic (#9137)
This commit is contained in:
parent
bf158ad17f
commit
14f743145c
@ -10,19 +10,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{%- assign file_parts = page.url | split: '/' | last | split: '.' -%}
|
{%- assign file_parts = page.url | split: '/' | last | split: '.' -%}
|
||||||
|
{%- assign imp_name = file_parts | first -%}
|
||||||
{%- if file_parts.size == 2 -%}
|
{%- assign imp_url = imp_name | prepend: '/components/' | append: '/' -%}
|
||||||
{%- assign is_platform = true -%}
|
|
||||||
{%- assign imp_name = file_parts[1] -%}
|
|
||||||
{%- assign imp_url = imp_name | prepend: '/components/' | append: '/' -%}
|
|
||||||
{%- assign parent_name = file_parts[0] -%}
|
|
||||||
{%- assign parent_url = parent_name | prepend: '/components/' | append: '/' -%}
|
|
||||||
{%- assign parent_component = components | where: 'url', imp_url | first -%}
|
|
||||||
{%- else -%}
|
|
||||||
{%- assign is_platform = false -%}
|
|
||||||
{%- assign imp_name = file_parts | first -%}
|
|
||||||
{%- assign imp_url = imp_name | prepend: '/components/' | append: '/' -%}
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
{%- if page.ha_iot_class -%}
|
{%- if page.ha_iot_class -%}
|
||||||
<div class='section'>
|
<div class='section'>
|
||||||
@ -62,66 +51,6 @@
|
|||||||
Source: <a href='{{github_main_repo}}{{imp_url}}'>{{imp_url}}</a>
|
Source: <a href='{{github_main_repo}}{{imp_url}}'>{{imp_url}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{%- if is_platform and parent_name != 'sensor' -%}
|
|
||||||
<div class='section'>
|
|
||||||
This is a platform for
|
|
||||||
<a href='{{parent_component.url}}'>the {{parent_component.title}} component</a>.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{%- elsif is_platform == false and imp_name != 'ifttt' -%}
|
|
||||||
|
|
||||||
{%- assign platforms_found = false -%}
|
|
||||||
{%- for component in components -%}
|
|
||||||
{%- if component.url != page.url -%}
|
|
||||||
{%- assign comp_imp_name = component.url | split: '/' | last | split: '.' | first -%}
|
|
||||||
{%- if comp_imp_name == imp_name %}
|
|
||||||
{%- unless platforms_found -%}
|
|
||||||
{%- assign platforms_found = true -%}
|
|
||||||
<h1 class='title delta'>Platforms</h1>
|
|
||||||
<ul class='divided'>
|
|
||||||
{%- endunless -%}
|
|
||||||
<li><a href='{{component.url}}'>
|
|
||||||
{{component.title}}
|
|
||||||
</a></li>
|
|
||||||
{% endif -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
|
|
||||||
{%- if platforms_found -%}
|
|
||||||
</ul>
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
{%- assign related_found = false -%}
|
|
||||||
{%- for component in components -%}
|
|
||||||
{%- if component.url != page.url -%}
|
|
||||||
{%- assign comp_file_parts = component.url | split: '/' | last | split: '.' -%}
|
|
||||||
{%- if comp_file_parts.size == 2 -%}
|
|
||||||
{%- assign comp_imp_name = comp_file_parts | last -%}
|
|
||||||
{%- else -%}
|
|
||||||
{%- assign comp_imp_name = comp_file_parts | first -%}
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
{%- if comp_imp_name == imp_name -%}
|
|
||||||
{%- unless related_found -%}
|
|
||||||
{%- assign related_found = true -%}
|
|
||||||
<div class='section'>
|
|
||||||
<h1 class='title delta'>Related components</h1>
|
|
||||||
<ul class='divided'>
|
|
||||||
{%- endunless -%}
|
|
||||||
<li><a href='{{component.url}}'>
|
|
||||||
{{component.title}}
|
|
||||||
</a></li>
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
|
|
||||||
{%- if related_found -%}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
{%- if page.ha_category.first -%}
|
{%- if page.ha_category.first -%}
|
||||||
<div class='section'>
|
<div class='section'>
|
||||||
<h1 class="title delta">Categories</h1>
|
<h1 class="title delta">Categories</h1>
|
||||||
|
@ -68,15 +68,6 @@ Support for these components is provided by the Home Assistant community.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% comment %}
|
|
||||||
## Pages without categories
|
|
||||||
{%- for component in components -%}
|
|
||||||
{% unless component.ha_category %}
|
|
||||||
<p>{{ component.title }}</p>
|
|
||||||
{% endunless %}
|
|
||||||
{%- endfor -%}
|
|
||||||
{% endcomment %}
|
|
||||||
|
|
||||||
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
|
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/vanilla-lazyload/10.17.0/lazyload.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/vanilla-lazyload/10.17.0/lazyload.min.js"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user