homesteading_helpers 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe94fdda60c5f05851820ffd0742def1588104f7
|
4
|
+
data.tar.gz: cc38df2883760ad4aa5ef751846c6158c4dda19f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33407b22276206131ba58b3a8496d54e0122ad03a91be5d36a82c1ba83e6431423ec95d6767804cbaca36b29573f4dd15b354e6003f917095dfa9a1b3526055a
|
7
|
+
data.tar.gz: 562640f1135fa10c43c880862cd4006df7fa63d15a89cb4d6d2a4a0af0a534ba850d5a1996ed31e156a2a95f83403539a699cd70eaf30185a48cbea44e09842c
|
@@ -2,12 +2,12 @@ module HomesteadingHelpers
|
|
2
2
|
module ApplicationHelper
|
3
3
|
|
4
4
|
def shorturl_link_tag(post)
|
5
|
-
url = "http://#{setting :short_domain}"
|
6
|
-
|
7
5
|
if index_action?
|
8
|
-
url = "http://#{setting :short_domain}/#{setting
|
6
|
+
url = "http://#{setting :short_domain}/#{setting(:post_short_code)}"
|
9
7
|
elsif show_action?
|
10
8
|
url = short_url(post)
|
9
|
+
else
|
10
|
+
url = "http://#{setting :short_domain}"
|
11
11
|
end
|
12
12
|
|
13
13
|
tag(:link, id: "shortlink", rel: "shortlink", type: "text/html", href: url)
|
@@ -16,7 +16,7 @@ module HomesteadingHelpers
|
|
16
16
|
def short_url(post)
|
17
17
|
pieces = [setting(:post_short_code)]
|
18
18
|
|
19
|
-
pieces << Date.parse("#{post.year}
|
19
|
+
pieces << Date.parse("#{post.year}-#{post.month}-#{post.day}").to_sxg
|
20
20
|
pieces << nth_of_day(post)
|
21
21
|
|
22
22
|
"http://#{setting :short_domain}/#{pieces.join}"
|
@@ -39,12 +39,13 @@ module HomesteadingHelpers
|
|
39
39
|
"http://#{setting :long_domain}"
|
40
40
|
else
|
41
41
|
# TODO refactor away from "note"
|
42
|
-
"http://#{setting :long_domain}/#{note_path(post)}"
|
42
|
+
"http://#{setting :long_domain}/#{note_path(post.params)}"
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
def rel_canonical_link_tag(post)
|
47
47
|
url = "http://#{setting :long_domain}"
|
48
|
+
|
48
49
|
if index_action?
|
49
50
|
url = "http://#{setting :long_domain}/#{setting(:post_type).pluralize.downcase}"
|
50
51
|
elsif show_action?
|
@@ -55,12 +56,12 @@ module HomesteadingHelpers
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def page_description(post=nil)
|
58
|
-
page_description = setting(:site_description)
|
59
|
-
|
60
59
|
if index_action?
|
61
60
|
page_description = "#{setting(:post_type).pluralize.capitalize} by #{setting :author_name}"
|
62
61
|
elsif show_action?
|
63
62
|
page_description = post.content
|
63
|
+
else
|
64
|
+
page_description = setting(:site_description)
|
64
65
|
end
|
65
66
|
|
66
67
|
page_description
|