Skip to content

Commit

Permalink
Add support for images from Brands (home-assistant#12276)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Mar 6, 2020
1 parent b56d663 commit 2a523a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions source/_includes/asides/component_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<div class='brand-logo-container section'>
{%- if page.logo -%}
<img src='/images/supported_brands/{{ page.logo }}' />
{%- else -%}
<img src='https://brands.home-assistant.io/{{ page.ha_domain }}/logo.png' srcset='https://brands.home-assistant.io/{{ page.ha_domain }}/[email protected] 2x' />
{%- endif -%}
</div>

Expand Down
4 changes: 2 additions & 2 deletions source/integrations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
{% capture category %}"{{ ha_category | slugify | downcase }}"{% endcapture %}
{% assign categories = categories | push: category %}
{%- endfor -%}
{url:"{{ component.url }}", title:"{{component.title}}", cat: [{{categories|join: ","}}], featured: {% if component.featured %}true{% else %}false{% endif %}, v: "{{major_version}}.{{minor_version}}", logo: "{{component.logo}}"},
{url:"{{ component.url }}", title:"{{component.title}}", cat: [{{categories|join: ","}}], featured: {% if component.featured %}true{% else %}false{% endif %}, v: "{{major_version}}.{{minor_version}}", logo: "{{component.logo}}", domain: "{{component.ha_domain}}"},
{% endif -%}
{%- endfor -%}
false
Expand Down Expand Up @@ -144,7 +144,7 @@
components: [],
image: function () {
if (this.logo === '') {
return '';
return '<img src="https://brands.home-assistant.io/' + this.domain + '/logo.png" srcset="https://brands.home-assistant.io/' + this.domain + '/[email protected] 2x">';
} else {
return '<img data-src="/images/supported_brands/' + this.logo + '">';
}
Expand Down

0 comments on commit 2a523a4

Please sign in to comment.