trejo 0.0.2 → 0.0.3

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: 1d7167dcc26e34868545129b750246edb2bd34df
4
- data.tar.gz: aef5d381977f15648365cb1484031a10514b0735
3
+ metadata.gz: 3e4a9088253876b300c639d1fee7f115f67daf82
4
+ data.tar.gz: b5ad57c97473c7b1413cc1e1edc8cf49a4c1e867
5
5
  SHA512:
6
- metadata.gz: f4570e03d3106449ecdcd6d19e44e2ab99b82ea409ae7a86511a5ad3346246c3a0af4239815f0f64954f17ca82cbe85421bf28763e8fdbcff25fcb2aaeb91fc5
7
- data.tar.gz: 3a6dbb02b6adbf83178b8162bdf2b0a09b1c0808a06052bc94671f6bb0fe5388529a67b837f386d6fe4f20f5773a38d6ef4092be38cb5712278e9445ed08c84f
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 title tag for the current page.
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
@@ -1,3 +1,3 @@
1
1
  module Trejo
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -19,9 +19,10 @@ module Trejo
19
19
  .flatten.uniq.join ' '
20
20
  end
21
21
 
22
- def title page_title
23
- return if page_title.blank?
24
- content_for(:title) { "#{page_title} | #{Trejo.configuration.site_title}" }
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.2
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-01-19 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack