trejo 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +7 -3
- data/lib/trejo/version.rb +1 -1
- data/lib/trejo/view_helpers.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e4a9088253876b300c639d1fee7f115f67daf82
|
|
4
|
+
data.tar.gz: b5ad57c97473c7b1413cc1e1edc8cf49a4c1e867
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d0c4984b847f90688b5c3690ec7e547520c9cf2337ef73a5b5ba103d8c28835c84be35054cc67c61bc3d2e71ff92a4292db6df0363fe1be71a44fe11cd4552b4
|
|
7
|
+
data.tar.gz: ad6619c351edee268c37ef6b47d26655109d569331da1e133a644be1056b59b6b1eb2126466a0a327cca8cf5dfb5cb7e9c37f4e35e548ecb94ba5e1ff6fe92a6
|
data/README.md
CHANGED
|
@@ -104,14 +104,19 @@ merge_classes ['walter', 'sobchak'], ['shomer', ['shabbas']] => 'walter sobchak
|
|
|
104
104
|
|
|
105
105
|
Whitespaces, duplicates and blank/nil values are omitted.
|
|
106
106
|
|
|
107
|
+
### site_title
|
|
108
|
+
|
|
109
|
+
`site_title` returns the parameter of the same name as configured in the initializer. If no value is initialized, then it
|
|
110
|
+
returns the top level application module name.
|
|
111
|
+
|
|
107
112
|
### title
|
|
108
113
|
|
|
109
|
-
`title` generates the
|
|
114
|
+
`title` is called from the current template and generates the content that goes in the title tag.
|
|
110
115
|
|
|
111
116
|
In the application layout template, add the following
|
|
112
117
|
|
|
113
118
|
```erb
|
|
114
|
-
<title><%= yield(:title).presence %></title>
|
|
119
|
+
<title><%= yield(:title).presence || site_title %></title>
|
|
115
120
|
```
|
|
116
121
|
|
|
117
122
|
Then set the page title anywhere in the current page template
|
|
@@ -126,7 +131,6 @@ which yields
|
|
|
126
131
|
<title>About Us | My Website Title</title>
|
|
127
132
|
```
|
|
128
133
|
|
|
129
|
-
The website title defaults to the top level application module name. Set the config param `site_title` to customize this value.
|
|
130
134
|
|
|
131
135
|
### copyright_notice
|
|
132
136
|
|
data/lib/trejo/version.rb
CHANGED
data/lib/trejo/view_helpers.rb
CHANGED
|
@@ -19,9 +19,10 @@ module Trejo
|
|
|
19
19
|
.flatten.uniq.join ' '
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def title page_title
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
def title page_title = nil
|
|
23
|
+
content_for(:title) do
|
|
24
|
+
[page_title, Trejo.configuration.site_title].compact.join(' | ')
|
|
25
|
+
end
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def body_id
|
|
@@ -47,5 +48,9 @@ module Trejo
|
|
|
47
48
|
def copyright_notice company_name = nil
|
|
48
49
|
"\u00A9 #{Date.current.year} #{company_name.presence || Trejo.configuration.company_name}, All Rights Reserved"
|
|
49
50
|
end
|
|
51
|
+
|
|
52
|
+
def site_title
|
|
53
|
+
Trejo.configuration.site_title
|
|
54
|
+
end
|
|
50
55
|
end
|
|
51
56
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trejo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Boram Yoon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionpack
|