Skip to content

Commit 1ba86e8

Browse files
committed
Fix canonical urls and blog post dates
1 parent 371245a commit 1ba86e8

12 files changed

+91
-15
lines changed

plugins/filters.rb

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
module Jekyll
2+
module AssetFilter
3+
# Octopress filters
4+
# Copyright (c) 2014 Brandon Mathis
5+
6+
# MIT License
7+
8+
# Permission is hereby granted, free of charge, to any person obtaining
9+
# a copy of this software and associated documentation files (the
10+
# "Software"), to deal in the Software without restriction, including
11+
# without limitation the rights to use, copy, modify, merge, publish,
12+
# distribute, sublicense, and/or sell copies of the Software, and to
13+
# permit persons to whom the Software is furnished to do so, subject to
14+
# the following conditions:
15+
16+
# The above copyright notice and this permission notice shall be
17+
# included in all copies or substantial portions of the Software.
18+
19+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25+
26+
def site_url
27+
'https://home-assistant.io'
28+
end
29+
30+
# Prepend a url with the full site url
31+
#
32+
# input - a url
33+
#
34+
# Returns input with all urls expanded to include the full site url
35+
# e.g. /images/awesome.gif => http://example.com/images/awesome.gif
36+
#
37+
def full_url(input)
38+
expand_url(input, site_url)
39+
end
40+
41+
# Prepends input with a url fragment
42+
#
43+
# input - An absolute url, e.g. /images/awesome.gif
44+
# url - The fragment to prepend the input, e.g. /blog
45+
#
46+
# Returns the modified url, e.g /blog
47+
#
48+
def expand_url(input, url=nil)
49+
url ||= root
50+
51+
url = if input.start_with?("http", url)
52+
input
53+
else
54+
File.join(url, input)
55+
end
56+
57+
smart_slash(url)
58+
end
59+
60+
# Ensure a trailing slash if a url ends with a directory
61+
def smart_slash(input)
62+
if !(input =~ /\.\w+$/)
63+
input = File.join(input, '/')
64+
end
65+
input
66+
end
67+
68+
# Convert url input into a standard canonical url by expanding urls and
69+
# removing url fragments ending with `index.[ext]`
70+
def canonical_url(input)
71+
full_url(input).sub(/index\.\w+$/i, '')
72+
end
73+
end
74+
end
75+
76+
Liquid::Template.register_filter(Jekyll::AssetFilter)

source/_posts/2016-02-11-classifying-the-internet-of-things.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "Classifying the Internet of Things"
44
description: ""
5-
date: 2016-02-11 22:31:00 -0800
5+
date: 2016-02-12 22:31:00 UTC
66
date_formatted: "February 12, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2016-02-13-speedtest-bloomsky-splunk-and-garage-doors.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "0.13: Speedtest.net, Bloomsky, Splunk and Garage Doors"
44
description: "Home Assistant 0.13 brings test coverage to a whopping 90% and adds a whole bunch of new components."
5-
date: 2016-02-12 22:15:00 -0800
5+
date: 2016-02-13 22:15:00 UTC
66
date_formatted: "February 13, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2016-04-04-your-hub-should-be-local-and-open.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "Your hub should be local and open"
44
description: "Running a hub that depends on the cloud is a risk that can cost you your home automation."
5-
date: 2016-04-04 21:11:00 -0700
5+
date: 2016-04-05 21:11:00 UTC
66
date_formatted: "April 5, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2016-04-09-onkyo-panasonic-gtfs-and-config-validation.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "0.17: Onkyo, Panasonic, GTFS and config validation"
44
description: "Home Assistant 0.17 has arrived."
5-
date: 2016-04-08 23:10:00 -0700
5+
date: 2016-04-09 23:10:00 UTC
66
date_formatted: "April 9, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2016-04-17-updated-documentation.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "Updated documentation"
44
description: "We have reorganised our documentation which should make it easier to get started and develop for Home Assistant."
5-
date: 2016-04-16 23:09:00 -0700
5+
date: 2016-04-17 23:09:00 UTC
66
date_formatted: "April 17, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2016-04-19-to-infinity-and-beyond.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "To Infinity and Beyond 🚀"
44
description: "The state of Home Assistant: past, present, future."
5-
date: 2016-04-18 22:44:00 -0700
5+
date: 2016-04-19 22:44:00 UTC
66
date_formatted: "April 19, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2016-04-21-bluetooth-lg-webos-tvs-and-roombas.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: post
33
title: "0.18: Bluetooth, LG WebOS TVs and Roombas."
44
description: "Home Assistant 0.18 has arrived."
5-
date: 2016-04-19 23:10:00 -0700
6-
date_formatted: "April 21, 2016"
5+
date: 2016-04-20 23:10:00 UTC
6+
date_formatted: "April 20, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob
99
comments: true

source/_posts/2016-08-27-notifications-hue-fake-unification.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: post
33
title: "0.27 is here to break eggs and take names: notifications, Hue fakery, safety and unification come to Home Assistant"
44
description: "HTML5 push notifications and grouping support, Configuration validations and checking, cover, climate and fan."
5-
date: 2016-08-27 20:30:25 -0700
6-
date_formatted: "August 27, 2016"
5+
date: 2016-08-28 20:30:25 UTC
6+
date_formatted: "August 28, 2016"
77
author: Robbie Trencheny
88
author_twitter: Robbie
99
comments: true

source/_posts/2016-10-24-explaining-the-updater.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: post
33
title: "Explaining the Updater"
44
description: "An update to the recent updater component changes"
5-
date: 2016-10-24 21:30:00 -0700
6-
date_formatted: "October 24, 2016"
5+
date: 2016-10-25 21:30:00 UTC
6+
date_formatted: "October 25, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob
99
comments: true

source/_posts/2016-12-19-thank-you.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: "Thank You"
44
description: "Thanks to all our contributors, dependencies and companies that help make Home Assistant awesome."
5-
date: 2016-12-18 21:04:05 -0800
5+
date: 2016-12-19 21:04:05 UTC
66
date_formatted: "December 19, 2016"
77
author: Paulus Schoutsen
88
author_twitter: balloob

source/_posts/2017-02-04-babyphone.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: post
33
title: "Smart Baby Monitor"
44
description: "How to build your own smart baby monitor"
5-
date: 2017-02-04 00:00:00 +0100
6-
date_formatted: "February 4, 2017"
5+
date: 2017-02-03 01:00:00 UTC
6+
date_formatted: "February 3, 2017"
77
author: Pascal Vizeli
88
comments: true
99
categories: How-To

0 commit comments

Comments
 (0)