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: b50362479975ec52638b2eb14fb1c33547a826e9
4
- data.tar.gz: d84edc9b3b17e409b9243f29ad1dc0aa69193dfb
3
+ metadata.gz: fe94fdda60c5f05851820ffd0742def1588104f7
4
+ data.tar.gz: cc38df2883760ad4aa5ef751846c6158c4dda19f
5
5
  SHA512:
6
- metadata.gz: eb13b00be5b11efaccf5208ec19bb030d3336d29d0b44c88fe5ccb71090232fa9d96f7822fb4c1dd6639bd7b387ebd930bf21986e34817330c0ddca1c0dddd02
7
- data.tar.gz: b79b9b619492b36208aa44821962ae0bb865d083783800a897726d0cff56326e851216413a2e9d2cdf58e32cbdb7bc91da15e694cac37d6f1505ca90ea2fc2a3
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 :post_short_code}"
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}/#{post.month}/#{post.day}").to_sxg
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
@@ -1,3 +1,3 @@
1
1
  module HomesteadingHelpers
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homesteading_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker