evil-front 0.3.3 → 0.3.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: 03f7151c66f57efd62460aaa13ae348a98c9f870
4
- data.tar.gz: 060bafda4d205499b8e3a831845e0f79ba9c8e0b
3
+ metadata.gz: dac3af1ab6c5c7d20ff843a7f619e8dab0bc72eb
4
+ data.tar.gz: 7226a706f77f65f141318c5b09a262fbb808f17a
5
5
  SHA512:
6
- metadata.gz: e59f590c257caab8695a7b2ba41d57a73b902148375a6f1ae11465d7523ed8980f6300351831574eea2487545c2b1173f1810375bdf692dc8c29ed90df6a1f8b
7
- data.tar.gz: 98665a87eca007c34094b51beb224c4c4e77528435faa3347477afd3c2059a0af4959035c8a29d3edb9429c9c4ce659e757bc71263678519a2bc97a226acc0d9
6
+ metadata.gz: 51c3c41d498002ff1c054f76be6145a12d493d620e2b6f8af8d4c5e2856dd6cfc9be13238fc8fd1680dc94a6760e82f4c1e75741f6195c2b46d3eef427f1e969
7
+ data.tar.gz: 087caae7b5b4d34f5ac2b0c653350d02d5fcd50cb30e0e780c12596a59f0d7b3781be8dfd9a3eedbe1d582524307ebe0dd47511be5b1d8453252c8ca5d4e467f
data/ChangeLog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.4
2
+
3
+ * Add `no_site` option to `title` helper.
4
+ * Better `+stroke-text` by Vadim Sikora.
5
+
1
6
  ## 0.3.3
2
7
 
3
8
  * Fix `+hover` mixin loading.
@@ -5,4 +5,4 @@
5
5
  // color: white
6
6
  // +stroke-text(black)
7
7
  @mixin stroke-text($color)
8
- text-shadow: 1px 1px 1px $color, 1px -1px 1px $color, 1px 1px 1px $color, -1px -1px 1px $color
8
+ text-shadow: 1px 1px 1px $color, 1px -1px 1px $color, -1px 1px 1px $color, -1px -1px 1px $color
@@ -7,7 +7,15 @@ module EvilFront::Helpers
7
7
  # You can set subtitles (order will be reversed):
8
8
  #
9
9
  # - title 'FAQ', 'Ask'
10
+ #
11
+ # By default `title_tag` will add site name to page title. You can show only
12
+ # page title by `no_site` option:
13
+ #
14
+ # - title 'Site Home', no_site: true
10
15
  def title(*titles)
16
+ options = titles.extract_options!
17
+ @evil_front_no_site_in_title = true if options[:no_site]
18
+
11
19
  @evil_front_titles ||= []
12
20
  @evil_front_titles += titles
13
21
  end
@@ -17,11 +17,14 @@ module EvilFront::Helpers
17
17
  #
18
18
  # = title_tag('Foo Company', separator: ' * ')
19
19
  def title_tag(*site)
20
- @evil_front_titles ||= []
21
20
  options = site.extract_options!
22
21
  separator = options[:separator] || (I18n.locale == :ru ? ' — ' : ' - ')
23
- titles = (@evil_front_titles + site).compact
24
- titles = titles.join(separator)
22
+
23
+ site = [] if @evil_front_no_site_in_title
24
+
25
+ @evil_front_titles ||= []
26
+ titles = (@evil_front_titles + site).compact
27
+ titles = titles.join(separator)
25
28
  EvilFront.html_safe("<title>#{ EvilFront.escape(titles) }</title>")
26
29
  end
27
30
  end
@@ -1,3 +1,3 @@
1
1
  module EvilFront
2
- VERSION = '0.3.3' unless defined? EvilFront::VERSION
2
+ VERSION = '0.3.4' unless defined? EvilFront::VERSION
3
3
  end
data/spec/helpers_spec.rb CHANGED
@@ -142,6 +142,11 @@ describe EvilFront::Helpers do
142
142
  title_tag.should == '<title>&lt;B&gt;</title>'
143
143
  end
144
144
 
145
+ it 'hides site name on request' do
146
+ title 'Page', no_site: true
147
+ title_tag('Site').should == '<title>Page</title>'
148
+ end
149
+
145
150
  end
146
151
 
147
152
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evil-front
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-18 00:00:00.000000000 Z
11
+ date: 2014-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n