mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 17:57:14 +00:00
Add support for images from Brands (#12276)
This commit is contained in:
parent
b56d6638c1
commit
2a523a4d20
@ -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 }}/logo@2x.png 2x' />
|
||||
{%- endif -%}
|
||||
</div>
|
||||
|
||||
|
@ -95,7 +95,7 @@ var allComponents = [
|
||||
{% 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
|
||||
@ -144,7 +144,7 @@ allComponents.pop(); // remove placeholder element at the end
|
||||
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 + '/logo@2x.png 2x">';
|
||||
} else {
|
||||
return '<img data-src="/images/supported_brands/' + this.logo + '">';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user