Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b827e5

Browse files
committed
Merge branch 'current' into next
2 parents facee61 + 4d3d8ba commit 3b827e5

File tree

6 files changed

+43
-11
lines changed

6 files changed

+43
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public
77
source/_data/analytics_data.json
88
source/_data/blueprint_exchange_data.json
99
source/_data/version_data.json
10+
source/_data/alerts_data.json
1011
source/_stash
1112
source/stylesheets/screen.css
1213
source/.jekyll-cache/

Rakefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ task :generate do
3333
abort("Generating CSS failed") unless success
3434
success = system "rake analytics_data"
3535
abort("Generating analytics data failed") unless success
36+
success = system "rake alerts_data"
37+
abort("Generating alerts data failed") unless success
3638
success = system "rake version_data"
3739
abort("Generating version data failed") unless success
3840
success = system "rake blueprint_exchange_data"
@@ -74,6 +76,7 @@ task :preview, :listen do |t, args|
7476
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
7577
system "rake analytics_data"
7678
system "rake version_data"
79+
system "rake alerts_data"
7780
system "rake blueprint_exchange_data"
7881
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build -t --watch --incremental")
7982
compassPid = Process.spawn("compass watch")
@@ -191,6 +194,19 @@ task :analytics_data do
191194
end
192195
end
193196

197+
198+
desc "Download data from alerts.home-assistant.io"
199+
task :alerts_data do
200+
uri = URI('https://alerts.home-assistant.io/alerts.json')
201+
202+
remote_data = JSON.parse(Net::HTTP.get(uri))
203+
204+
File.open("#{source_dir}/_data/alerts_data.json", "w") do |file|
205+
file.write(JSON.generate(remote_data))
206+
end
207+
end
208+
209+
194210
desc "Download version data from version.home-assistant.io"
195211
task :version_data do
196212
uri = URI('https://version.home-assistant.io/stable.json')

sass/custom/_paulus.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ $primary-color: #049cdb;
5151
}
5252
}
5353

54+
.integration-alert {
55+
margin: -1em 0;
56+
background-color: wheat;
57+
padding: 4px;
58+
59+
a {
60+
text-decoration: none !important;
61+
}
62+
63+
}
64+
5465
@media only screen and (max-width: $menu-collapse) {
5566
.search-container {
5667
z-index: 20;

source/_includes/asides/component_navigation.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% assign percentage = 100.0 | times: site.data.analytics_data.integrations[page.ha_domain] | divided_by: site.data.analytics_data.reports_integrations | round: 1 %}
22
<section class="aside-module grid__item one-whole lap-one-half">
3-
43
<div class='brand-logo-container section'>
54
{%- if page.logo -%}
65
<img src='/images/supported_brands/{{ page.logo }}' />
@@ -13,12 +12,6 @@
1312
{%- endif -%}
1413
</div>
1514

16-
{%- if page.ha_domain -%}
17-
<div class="section">
18-
<kb-alert-link integration="{{ page.ha_domain }}"></kb-alert-link>
19-
</div>
20-
{%- endif -%}
21-
2215
<div class='section'>
2316
The {{ page.name | default: page.title }} integration was introduced in Home Assistant {{ page.ha_release | default: "unknown" }},
2417
and it's used by <a title="Open analytics.home-assistant.io" href="https://analytics.home-assistant.io/#integrations" target="_blank" rel="noopener">
@@ -61,5 +54,3 @@ <h1 class="title delta">Categories</h1>
6154
{%- endif -%}
6255

6356
</section>
64-
65-
<script src="https://alerts.home-assistant.io/ce-alert-link.js"></script>

source/_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% include site/head.html %}
22
<body {% if page.body_id %} id="{{ page.body_id }}"{% endif %}>
3-
43
<header class='site-header'>
54
{% include site/header.html %}
65
</header>
6+
77
<div class="page-content">
88

99
{% if page.hero_unit %}

source/_layouts/page.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ <h1 class="title indent">
1010
}}{% endif %}
1111
</h1>
1212
</header>
13+
{% if page.collection == "integrations" %}
14+
{% assign active_alert = "" %}
15+
{% for alert in site.data.alerts_data %}
16+
{% if alert.integrations and alert.integrations[0].package == page.ha_domain %}
17+
{% assign active_alert = alert.alert_url %}
18+
{% endif %}
19+
{% endfor %}
20+
{% if active_alert != "" %}
21+
<div class="integration-alert">
22+
<a href="{{active_alert}}" target="_blank">⚠️ There is an active alert for this integration!</a>
23+
</div>
24+
{% endif %}
25+
{% endif %}
1326
<hr class="divider" />
1427
{% endif %}
1528
{{ content }}
1629

1730
{% include feedback.html %}
18-
</article>
31+
</article>

0 commit comments

Comments
 (0)