Component details pages added
This commit is contained in:
parent
04f48395d6
commit
03d0d75ae1
130 changed files with 610 additions and 471 deletions
102
source/_includes/asides/component_navigation.html
Normal file
102
source/_includes/asides/component_navigation.html
Normal file
|
@ -0,0 +1,102 @@
|
|||
{% assign components = site.components | sort: 'title' %}
|
||||
<section class="aside-module grid__item one-whole lap-one-half">
|
||||
<div class='brand-logo-container section'>
|
||||
{% if page.logo %}
|
||||
<img src='/images/supported_brands/{{ page.logo }}' />
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% assign file_parts = page.url | split: '/' | last | split: '.' %}
|
||||
{% if file_parts.size == 3 %}
|
||||
{% assign is_platform = true %}
|
||||
{% assign imp_name = file_parts[1] %}
|
||||
{% assign parent_name = file_parts[0] %}
|
||||
{% assign parent_url = parent_name | prepend: '/components/' | append: '.html' %}
|
||||
{% assign parent_component = components | where: 'url', parent_url | first %}
|
||||
{% else %}
|
||||
{% assign is_platform = false %}
|
||||
{% assign imp_name = file_parts | first %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 == 3 %}
|
||||
{% assign comp_imp_name = comp_file_parts[1] %}
|
||||
{% 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 %}
|
||||
<div class='section'>
|
||||
<h1 class="title delta">Category {{page.ha_category}}</h1>
|
||||
<ul class='divided'>
|
||||
{% for component in components %}
|
||||
{% if component.ha_category == page.ha_category %}
|
||||
<li>
|
||||
{% if component.url == page.url %}
|
||||
{{component.title}}
|
||||
{% else %}
|
||||
<a href='{{component.url}}'>{{component.title}}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
|
@ -8,9 +8,9 @@
|
|||
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
|
||||
<li><a href='/getting-started/automation.html'>Automation</a></li>
|
||||
<li><a href='/cookbook'>Configuration cookbook</a></li>
|
||||
<li><a href='/components/'>Component overview</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href='/components/'>Components</a></li>
|
||||
<li>
|
||||
<a href="{{ root_url }}/developers/">Developers</a>
|
||||
<ul>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<div class="grid">
|
||||
|
||||
{% include asides/social.html %}
|
||||
|
||||
{% include_array default_asides %}
|
||||
|
||||
{% assign url_parts = page.url | split: '/' %}
|
||||
{% if url_parts[1] == 'components' %}
|
||||
{% include asides/component_navigation.html %}
|
||||
{% else %}
|
||||
{% include asides/social.html %}
|
||||
{% include_array default_asides %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue