diff --git a/.gitignore b/.gitignore index 6384f76a26c..4510dbe63d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .gist-cache .pygments-cache public +source/_data/analytics_data.json source/_stash source/stylesheets/screen.css source/.jekyll-cache/ diff --git a/Rakefile b/Rakefile index 8df92944c02..dc17981edbf 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,9 @@ require "rubygems" require "bundler/setup" require "stringex" +require 'net/http' +require 'json' + ## -- Misc Configs -- ## public_dir = "public/" # compiled site directory @@ -28,6 +31,8 @@ task :generate do puts "## Generating Site with Jekyll" success = system "compass compile --css-dir #{source_dir}/stylesheets" abort("Generating CSS failed") unless success + success = system "rake analytics_data" + abort("Generating analytics data failed") unless success success = system "jekyll build" abort("Generating site failed") unless success if ENV["CONTEXT"] != 'production' @@ -63,6 +68,7 @@ task :preview, :listen do |t, args| puts "Starting to watch source with Jekyll and Compass." puts "Now listening on http://localhost:#{server_port}" system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css") + success = system "rake analytics_data" jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build -t --watch --incremental") compassPid = Process.spawn("compass watch") rackupPid = Process.spawn("rackup --port #{server_port} --host #{listen_addr}") @@ -168,6 +174,19 @@ task :clean do rm_rf [Dir.glob(".pygments-cache/**"), Dir.glob(".gist-cache/**"), Dir.glob(".sass-cache/**"), "source/stylesheets/screen.css"] end +desc "Download data from analytics.home-assistant.io" +task :analytics_data do + uri = URI('https://analytics.home-assistant.io/data.json') + + remote_data = JSON.parse(Net::HTTP.get(uri)) + last_entry=remote_data.keys().sort().reverse()[0] + + File.open("#{source_dir}/_data/analytics_data.json", "w") do |file| + file.write(JSON.generate(remote_data[last_entry])) + end + +end + def get_stdin(message) print message STDIN.gets.chomp diff --git a/sass/custom/_paulus.scss b/sass/custom/_paulus.scss index 2dba14063b2..4ad20e27657 100644 --- a/sass/custom/_paulus.scss +++ b/sass/custom/_paulus.scss @@ -455,8 +455,9 @@ div.note { } } } - } + } + .brand-logo-container { text-align: center; margin-top: 50px; diff --git a/source/_includes/asides/component_navigation.html b/source/_includes/asides/component_navigation.html index 75a809b5399..ff81043a5ae 100644 --- a/source/_includes/asides/component_navigation.html +++ b/source/_includes/asides/component_navigation.html @@ -18,39 +18,20 @@ {%- endif -%} - {%- if page.ha_iot_class -%} -
- {%- endif -%} +