homura 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 90c1153d94b2e52151ecd279bbbade8903362a6c
|
|
4
|
+
data.tar.gz: 158e5c65b493980f5b06f8725bd907be3708dfab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5124d361ea71b962c0877ecdcb67f43a4e8029c0685521bd5397a752963e772f5ab5a295de29f89810a8e57c585f0c8727b9847ecf6430bfcf714750301ba71e
|
|
7
|
+
data.tar.gz: f94ce0ce00fcd8fbe883fcf7debeb2aa7c54740ca06a5fcc6b0d63f77cc294fa31a26e9e8717e3465acb6f5a74757c23042ffa06d0fb523079e164f15bbb6f38
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
module Homura
|
|
2
2
|
module LayoutHelper
|
|
3
|
+
DEFAULT_PAGE_TITLE_KEY = :'homura.default_page_title'
|
|
4
|
+
DEFAULT_PAGE_DESCRIPTION_KEY = :'homura.default_page_description'
|
|
5
|
+
|
|
3
6
|
def controller_action_full_name
|
|
4
7
|
[params[:controller], params[:action]].join('#')
|
|
5
8
|
end
|
|
@@ -13,16 +16,16 @@ module Homura
|
|
|
13
16
|
@page_title = text
|
|
14
17
|
og_properties title: text
|
|
15
18
|
end
|
|
16
|
-
@page_title
|
|
19
|
+
@page_title || t('.page_title', default: [DEFAULT_PAGE_TITLE_KEY,
|
|
20
|
+
controller_action_full_name])
|
|
17
21
|
end
|
|
18
22
|
|
|
19
23
|
def page_title_tag
|
|
20
24
|
if @page_title.blank?
|
|
21
|
-
@page_title = controller_action_full_name
|
|
22
25
|
logger.warn "in #{controller_action_full_name}:"
|
|
23
26
|
logger.warn 'No page title specified, please use `page_title` helper.'
|
|
24
27
|
end
|
|
25
|
-
content_tag(:title, t('homura.layout.title', title:
|
|
28
|
+
content_tag(:title, t('homura.layout.title', title: page_title))
|
|
26
29
|
end
|
|
27
30
|
|
|
28
31
|
def page_description(text = nil)
|
|
@@ -30,16 +33,17 @@ module Homura
|
|
|
30
33
|
@page_description = text
|
|
31
34
|
og_properties description: text
|
|
32
35
|
end
|
|
33
|
-
@page_description
|
|
36
|
+
@page_description ||
|
|
37
|
+
t('.page_description', default: [DEFAULT_PAGE_DESCRIPTION_KEY, ''])
|
|
34
38
|
end
|
|
35
39
|
|
|
36
40
|
def page_description_tag
|
|
37
41
|
if @page_description.blank?
|
|
38
42
|
logger.warn "in #{controller_action_full_name}:"
|
|
39
43
|
logger.warn 'No page description specified, please use `page_description` helper.'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
tag(:meta, name: :description, content:
|
|
44
|
+
end
|
|
45
|
+
if page_description.present?
|
|
46
|
+
tag(:meta, name: :description, content: page_description)
|
|
43
47
|
end
|
|
44
48
|
end
|
|
45
49
|
|
data/lib/homura/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: homura
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ayaya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-03-
|
|
11
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|