diff --git a/plugins/filters.rb b/plugins/filters.rb new file mode 100644 index 00000000000..5eacd7b8cf4 --- /dev/null +++ b/plugins/filters.rb @@ -0,0 +1,76 @@ +module Jekyll + module AssetFilter + # Octopress filters + # Copyright (c) 2014 Brandon Mathis + + # MIT License + + # Permission is hereby granted, free of charge, to any person obtaining + # a copy of this software and associated documentation files (the + # "Software"), to deal in the Software without restriction, including + # without limitation the rights to use, copy, modify, merge, publish, + # distribute, sublicense, and/or sell copies of the Software, and to + # permit persons to whom the Software is furnished to do so, subject to + # the following conditions: + + # The above copyright notice and this permission notice shall be + # included in all copies or substantial portions of the Software. + + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + + def site_url + 'https://home-assistant.io' + end + + # Prepend a url with the full site url + # + # input - a url + # + # Returns input with all urls expanded to include the full site url + # e.g. /images/awesome.gif => http://example.com/images/awesome.gif + # + def full_url(input) + expand_url(input, site_url) + end + + # Prepends input with a url fragment + # + # input - An absolute url, e.g. /images/awesome.gif + # url - The fragment to prepend the input, e.g. /blog + # + # Returns the modified url, e.g /blog + # + def expand_url(input, url=nil) + url ||= root + + url = if input.start_with?("http", url) + input + else + File.join(url, input) + end + + smart_slash(url) + end + + # Ensure a trailing slash if a url ends with a directory + def smart_slash(input) + if !(input =~ /\.\w+$/) + input = File.join(input, '/') + end + input + end + + # Convert url input into a standard canonical url by expanding urls and + # removing url fragments ending with `index.[ext]` + def canonical_url(input) + full_url(input).sub(/index\.\w+$/i, '') + end + end +end + +Liquid::Template.register_filter(Jekyll::AssetFilter) diff --git a/source/_posts/2016-02-11-classifying-the-internet-of-things.markdown b/source/_posts/2016-02-11-classifying-the-internet-of-things.markdown index e346e352169..932cf42f78c 100644 --- a/source/_posts/2016-02-11-classifying-the-internet-of-things.markdown +++ b/source/_posts/2016-02-11-classifying-the-internet-of-things.markdown @@ -2,7 +2,7 @@ layout: post title: "Classifying the Internet of Things" description: "" -date: 2016-02-11 22:31:00 -0800 +date: 2016-02-12 22:31:00 UTC date_formatted: "February 12, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2016-02-13-speedtest-bloomsky-splunk-and-garage-doors.markdown b/source/_posts/2016-02-13-speedtest-bloomsky-splunk-and-garage-doors.markdown index 19f9169fb6f..de5e7e7760b 100644 --- a/source/_posts/2016-02-13-speedtest-bloomsky-splunk-and-garage-doors.markdown +++ b/source/_posts/2016-02-13-speedtest-bloomsky-splunk-and-garage-doors.markdown @@ -2,7 +2,7 @@ layout: post title: "0.13: Speedtest.net, Bloomsky, Splunk and Garage Doors" description: "Home Assistant 0.13 brings test coverage to a whopping 90% and adds a whole bunch of new components." -date: 2016-02-12 22:15:00 -0800 +date: 2016-02-13 22:15:00 UTC date_formatted: "February 13, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2016-04-04-your-hub-should-be-local-and-open.markdown b/source/_posts/2016-04-04-your-hub-should-be-local-and-open.markdown index 653665fbeb9..d56e8b0d3c7 100644 --- a/source/_posts/2016-04-04-your-hub-should-be-local-and-open.markdown +++ b/source/_posts/2016-04-04-your-hub-should-be-local-and-open.markdown @@ -2,7 +2,7 @@ layout: post title: "Your hub should be local and open" description: "Running a hub that depends on the cloud is a risk that can cost you your home automation." -date: 2016-04-04 21:11:00 -0700 +date: 2016-04-05 21:11:00 UTC date_formatted: "April 5, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2016-04-09-onkyo-panasonic-gtfs-and-config-validation.markdown b/source/_posts/2016-04-09-onkyo-panasonic-gtfs-and-config-validation.markdown index 3b5dfa4c65f..33c8d3e97c5 100644 --- a/source/_posts/2016-04-09-onkyo-panasonic-gtfs-and-config-validation.markdown +++ b/source/_posts/2016-04-09-onkyo-panasonic-gtfs-and-config-validation.markdown @@ -2,7 +2,7 @@ layout: post title: "0.17: Onkyo, Panasonic, GTFS and config validation" description: "Home Assistant 0.17 has arrived." -date: 2016-04-08 23:10:00 -0700 +date: 2016-04-09 23:10:00 UTC date_formatted: "April 9, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2016-04-17-updated-documentation.markdown b/source/_posts/2016-04-17-updated-documentation.markdown index 8d87f518ef1..e0e956e4f0e 100644 --- a/source/_posts/2016-04-17-updated-documentation.markdown +++ b/source/_posts/2016-04-17-updated-documentation.markdown @@ -2,7 +2,7 @@ layout: post title: "Updated documentation" description: "We have reorganised our documentation which should make it easier to get started and develop for Home Assistant." -date: 2016-04-16 23:09:00 -0700 +date: 2016-04-17 23:09:00 UTC date_formatted: "April 17, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2016-04-19-to-infinity-and-beyond.markdown b/source/_posts/2016-04-19-to-infinity-and-beyond.markdown index 46f411bdd27..e8b0e0ffd2d 100644 --- a/source/_posts/2016-04-19-to-infinity-and-beyond.markdown +++ b/source/_posts/2016-04-19-to-infinity-and-beyond.markdown @@ -2,7 +2,7 @@ layout: post title: "To Infinity and Beyond 🚀" description: "The state of Home Assistant: past, present, future." -date: 2016-04-18 22:44:00 -0700 +date: 2016-04-19 22:44:00 UTC date_formatted: "April 19, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2016-04-21-bluetooth-lg-webos-tvs-and-roombas.markdown b/source/_posts/2016-04-21-bluetooth-lg-webos-tvs-and-roombas.markdown index fbfce7cbc9b..14794081d8a 100644 --- a/source/_posts/2016-04-21-bluetooth-lg-webos-tvs-and-roombas.markdown +++ b/source/_posts/2016-04-21-bluetooth-lg-webos-tvs-and-roombas.markdown @@ -2,8 +2,8 @@ layout: post title: "0.18: Bluetooth, LG WebOS TVs and Roombas." description: "Home Assistant 0.18 has arrived." -date: 2016-04-19 23:10:00 -0700 -date_formatted: "April 21, 2016" +date: 2016-04-20 23:10:00 UTC +date_formatted: "April 20, 2016" author: Paulus Schoutsen author_twitter: balloob comments: true diff --git a/source/_posts/2016-08-27-notifications-hue-fake-unification.markdown b/source/_posts/2016-08-27-notifications-hue-fake-unification.markdown index 1901422103b..de09817dbde 100644 --- a/source/_posts/2016-08-27-notifications-hue-fake-unification.markdown +++ b/source/_posts/2016-08-27-notifications-hue-fake-unification.markdown @@ -2,8 +2,8 @@ layout: post title: "0.27 is here to break eggs and take names: notifications, Hue fakery, safety and unification come to Home Assistant" description: "HTML5 push notifications and grouping support, Configuration validations and checking, cover, climate and fan." -date: 2016-08-27 20:30:25 -0700 -date_formatted: "August 27, 2016" +date: 2016-08-28 20:30:25 UTC +date_formatted: "August 28, 2016" author: Robbie Trencheny author_twitter: Robbie comments: true diff --git a/source/_posts/2016-10-24-explaining-the-updater.markdown b/source/_posts/2016-10-24-explaining-the-updater.markdown index fd920bd0d31..86937e279dc 100644 --- a/source/_posts/2016-10-24-explaining-the-updater.markdown +++ b/source/_posts/2016-10-24-explaining-the-updater.markdown @@ -2,8 +2,8 @@ layout: post title: "Explaining the Updater" description: "An update to the recent updater component changes" -date: 2016-10-24 21:30:00 -0700 -date_formatted: "October 24, 2016" +date: 2016-10-25 21:30:00 UTC +date_formatted: "October 25, 2016" author: Paulus Schoutsen author_twitter: balloob comments: true diff --git a/source/_posts/2016-12-19-thank-you.markdown b/source/_posts/2016-12-19-thank-you.markdown index 805ea6c4265..54644bb167a 100644 --- a/source/_posts/2016-12-19-thank-you.markdown +++ b/source/_posts/2016-12-19-thank-you.markdown @@ -2,7 +2,7 @@ layout: post title: "Thank You" description: "Thanks to all our contributors, dependencies and companies that help make Home Assistant awesome." -date: 2016-12-18 21:04:05 -0800 +date: 2016-12-19 21:04:05 UTC date_formatted: "December 19, 2016" author: Paulus Schoutsen author_twitter: balloob diff --git a/source/_posts/2017-02-04-babyphone.markdown b/source/_posts/2017-02-04-babyphone.markdown index 057e80b968a..1c51f99c921 100644 --- a/source/_posts/2017-02-04-babyphone.markdown +++ b/source/_posts/2017-02-04-babyphone.markdown @@ -2,8 +2,8 @@ layout: post title: "Smart Baby Monitor" description: "How to build your own smart baby monitor" -date: 2017-02-04 00:00:00 +0100 -date_formatted: "February 4, 2017" +date: 2017-02-03 01:00:00 UTC +date_formatted: "February 3, 2017" author: Pascal Vizeli comments: true categories: How-To