mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
Use brand logos if ha_brand in search results (#26427)
This commit is contained in:
parent
8a9e58ed56
commit
4da4c3a8f2
@ -103,7 +103,7 @@ var allComponents = [
|
|||||||
{% capture category %}"{{ ha_category | slugify | downcase }}"{% endcapture %}
|
{% capture category %}"{{ ha_category | slugify | downcase }}"{% endcapture %}
|
||||||
{% assign categories = categories | push: category %}
|
{% assign categories = categories | push: category %}
|
||||||
{%- endfor -%}
|
{%- 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}}", domain: "{{component.ha_domain}}"},
|
{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}}", ha_brand: "{{component.ha_brand}}"},
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
false
|
false
|
||||||
@ -161,7 +161,7 @@ allComponents.pop(); // remove placeholder element at the end
|
|||||||
components: [],
|
components: [],
|
||||||
image: function () {
|
image: function () {
|
||||||
if (this.logo === '') {
|
if (this.logo === '') {
|
||||||
return '<img src="https://brands.home-assistant.io/_/' + this.domain + '/logo.png" srcset="https://brands.home-assistant.io/_/' + this.domain + '/logo@2x.png 2x" loading="lazy">';
|
return `<img src="https://brands.home-assistant.io/${this.ha_brand ? "brands": "_"}/${this.domain}/logo.png" srcset="https://brands.home-assistant.io/${this.ha_brand ? "brands ": "_"}/${this.domain}/logo@2x.png 2x" loading="lazy">`;
|
||||||
} else {
|
} else {
|
||||||
return '<img data-src="/images/supported_brands/' + this.logo + '" loading="lazy">';
|
return '<img data-src="/images/supported_brands/' + this.logo + '" loading="lazy">';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user