middleman-title 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: 1fb2a922916b5111439d744037d6d6b1e1777569
4
- data.tar.gz: e891cad4a69d680472768b16e2e2aa49fffde704
3
+ metadata.gz: 905b57b97b08acd97e7305dca9bb78ce393d3cfb
4
+ data.tar.gz: 7792436582d0ecabeb0e0e340de188e28804db5b
5
5
  SHA512:
6
- metadata.gz: a7a7675a4d9ff10dac71cd054f731877fdb1ad38deb353b2f3408b65e589c9a8e379c60b8f857ac5e72529c97c3430aa946fe8777c19daee07eb9115855d3ac5
7
- data.tar.gz: bce2a8617200ac8352028c5ae89cb8c0e6ed337b4bca9a4767cbf77e93afa158cb2965be62f5f4edccd6ded48bb57635a0a156f3cf13f896cfc17e6500aa43ea
6
+ metadata.gz: 5ba9d6c37b5d0e2fcd187861b799cf244fa42858ec00a9b1a9a13f4797a92a709ea245da95ddd7db6d3472437cc87eebf8cbb36e84003b5629d318e65a7bdb19
7
+ data.tar.gz: d2058bf70334d73aa65fda7fa3721b31feb1a7a450ad3bec4a604215c02fb8472bcf67a905345f6141eef053c00d93192930cc4c3bdc99dfa0f1f3d1295b5312
data/.travis.yml CHANGED
@@ -1,8 +1,10 @@
1
+ language: ruby
2
+ cache: bundler
1
3
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
+ - 2.3.0
5
+ - 2.2.0
4
6
  - 2.1.0
5
- script: 'bundle exec rspec'
7
+ - 2.0.0
6
8
  addons:
7
9
  code_climate:
8
- repo_token: 96d351848c244b986b3888fd13d12b6e916dcfbc83474c8a7a2c03d1c7827ecf
10
+ repo_token: 96d351848c244b986b3888fd13d12b6e916dcfbc83474c8a7a2c03d1c7827ecf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.3
2
+ * Fix Rspec stub name for title_options
3
+ * Adjust Middleman dependency to 3.2 or higher
4
+
1
5
  ## 0.0.2
2
6
  * Fix conflict with options set for middleman-deploy
3
7
  * Allow options to be passed in as hash or block
data/README.md CHANGED
@@ -7,11 +7,15 @@ This Middleman extension allows you to easily set page titles for your website.
7
7
  ## Setup
8
8
  Add the following line to `Gemfile`, then run `bundle install`:
9
9
 
10
- gem 'middleman-title'
10
+ ```Ruby
11
+ gem 'middleman-title'
12
+ ```
11
13
 
12
14
  After installation, activate the extension in `config.rb`:
13
15
 
14
- activate :title, site: 'Your Website Name', separator: ' — '
16
+ ```Ruby
17
+ activate :title, site: 'Your Website Name', separator: ' — '
18
+ ```
15
19
 
16
20
  *The separator is optional and will default to a dash.*
17
21
 
@@ -20,58 +24,74 @@ After installation, activate the extension in `config.rb`:
20
24
 
21
25
  In your layout file, you can use the `page_title` helper to output the current page title:
22
26
 
23
- <title><%= page_title %></title>
27
+ ```HTML+ERB
28
+ <title><%= page_title %></title>
29
+ ```
24
30
 
25
31
  Then, add a page `title` to the Frontmatter any page:
26
32
 
27
- ---
28
- title: The title of this page goes here
29
- ---
33
+ ```YAML
34
+ ---
35
+ title: The title of this page goes here
36
+ ---
37
+ ```
30
38
 
31
39
  This would output:
32
40
 
33
- The title of this page goes here — Your Website Name
34
-
41
+ ```Text
42
+ The title of this page goes here — Your Website Name
43
+ ```
35
44
 
36
45
  ## Outputting Website Name First
37
46
 
38
47
  Sometimes it is desirable to put the website name first, such as on the home page. This can be done by setting `title_reverse` to `true` in the frontmatter of the page.
39
48
 
40
- ---
41
- title: The title of this page goes here
42
- title_reverse: true
43
- ---
49
+ ```YAML
50
+ ---
51
+ title: The title of this page goes here
52
+ title_reverse: true
53
+ ---
54
+ ```
44
55
 
45
56
  This would output:
46
57
 
47
- Your Website Name — The title of this page goes here
58
+ ```Text
59
+ Your Website Name — The title of this page goes here
60
+ ```
48
61
 
49
62
  You can also put the website name first on every page by setting it when you activate the extension:
50
63
 
51
- activate :title, site: 'Your Website Name', reverse: true
64
+ ```Ruby
65
+ activate :title, site: 'Your Website Name', reverse: true
66
+ ```
52
67
 
53
68
  Then on any page where you want the website name to come last, you can set `title_reverse` to false in the Frontmatter:
54
69
 
55
- ---
56
- title: The title of this page goes here
57
- title_reverse: false
58
- ---
70
+ ```YAML
71
+ ---
72
+ title: The title of this page goes here
73
+ title_reverse: false
74
+ ---
75
+ ```
59
76
 
60
77
 
61
78
  ## Multi-level Page Titles
62
79
 
63
80
  When your website has heirachy, it is sometimes desirable to have multiple parts to the title. This can be done by passing an array in the Frontmatter:
64
81
 
65
- ---
66
- title:
67
- - John Doe
68
- - Staff
69
- ---
82
+ ```YAML
83
+ ---
84
+ title:
85
+ - John Doe
86
+ - Staff
87
+ ---
88
+ ```
70
89
 
71
90
  This would output:
72
91
 
73
- John Doe — Staff — Your Website Name
74
-
92
+ ```Text
93
+ John Doe — Staff — Your Website Name
94
+ ```
75
95
 
76
96
  ## Contributing
77
97
 
@@ -79,4 +99,4 @@ This would output:
79
99
  2. Create your feature branch (`git checkout -b my-new-feature`)
80
100
  3. Commit your changes (`git commit -am 'Add some feature'`)
81
101
  4. Push to the branch (`git push origin my-new-feature`)
82
- 5. Create a new Pull Request
102
+ 5. Create a new Pull Request
data/Rakefile CHANGED
@@ -1,2 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
2
3
 
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task :default => :spec
7
+ task :test => :spec
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Title
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'middleman-core', '~> 3.2'
21
+ spec.add_dependency 'middleman-core', '>= 3.2'
22
22
  end
@@ -5,9 +5,9 @@ describe Middleman::Title::Helpers do
5
5
 
6
6
  describe '#page_title' do
7
7
  before(:each) do
8
- h.stub_chain(:options, :site).and_return(false)
9
- h.stub_chain(:options, :separator).and_return(' &mdash; ')
10
- h.stub_chain(:options, :reverse).and_return(false)
8
+ h.stub_chain(:title_options, :site).and_return(false)
9
+ h.stub_chain(:title_options, :separator).and_return(' &mdash; ')
10
+ h.stub_chain(:title_options, :reverse).and_return(false)
11
11
 
12
12
  h.stub_chain(:current_page, :data, :title).and_return(nil)
13
13
  h.stub_chain(:current_page, :data, :title_site).and_return(nil)
@@ -15,7 +15,7 @@ describe Middleman::Title::Helpers do
15
15
  end
16
16
 
17
17
  context 'website name is set' do
18
- before(:each) { h.stub_chain(:options, :site).and_return('Website Name') }
18
+ before(:each) { h.stub_chain(:title_options, :site).and_return('Website Name') }
19
19
 
20
20
  context 'page name is set' do
21
21
  before(:each) { h.stub_chain(:current_page, :data, :title).and_return('How to Say Hello to the World') }
@@ -35,20 +35,20 @@ describe Middleman::Title::Helpers do
35
35
  end
36
36
 
37
37
  it 'puts website name first when activate reverse is true' do
38
- h.stub_chain(:options, :reverse).and_return(true)
38
+ h.stub_chain(:title_options, :reverse).and_return(true)
39
39
  expect(h.page_title).to eq 'Website Name &mdash; How to Say Hello to the World'
40
40
  end
41
41
 
42
42
  it 'puts website name last when activate reverse is true but frontmatter is false' do
43
- h.stub_chain(:options, :reverse).and_return(true)
43
+ h.stub_chain(:title_options, :reverse).and_return(true)
44
44
  h.stub_chain(:current_page, :data, :title_reverse).and_return(false)
45
45
  expect(h.page_title).to eq 'How to Say Hello to the World &mdash; Website Name'
46
46
  end
47
47
 
48
48
  context 'separator is set' do
49
49
  it 'to a vertical bar' do
50
- h.stub_chain(:options, :site).and_return('Website Name')
51
- h.stub_chain(:options, :separator).and_return(' | ')
50
+ h.stub_chain(:title_options, :site).and_return('Website Name')
51
+ h.stub_chain(:title_options, :separator).and_return(' | ')
52
52
  expect(h.page_title).to eq 'How to Say Hello to the World | Website Name'
53
53
  end
54
54
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-title
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
  - Justin Cypret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-07 00:00:00.000000000 Z
11
+ date: 2016-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.2'
27
27
  description: A Middleman extension for setting the page title
@@ -67,10 +67,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  requirements: []
69
69
  rubyforge_project:
70
- rubygems_version: 2.2.2
70
+ rubygems_version: 2.5.1
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: A Middleman extension for setting the page title
74
74
  test_files:
75
75
  - spec/extension_spec.rb
76
76
  - spec/spec_helper.rb
77
+ has_rdoc: