octopress-linkblog 1.2.0 → 2.0.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: 229e1770b7c86baa60043417aa597b3302ac2463
4
- data.tar.gz: 2e7c77c125d43c9f009c3a175e4a118e3869613e
3
+ metadata.gz: 8efaff5112e216bd1fa25b543caf5b20f84be0f4
4
+ data.tar.gz: 2c88cbeba8a2c6240cf9afb708808a128fa6f1c5
5
5
  SHA512:
6
- metadata.gz: c04ad260e8a47e5a96ed82ca4f5abb3eb5f856dc0c5594485ccd52b86c0258e031095d970e51786842040e6356e08f950883294f4e108315a7e78e2e1524c90e
7
- data.tar.gz: 6f9333d04546b2f1e4ef40c947216abf292906041a36fb73eab63da293541632d41c8b1a0a756369b52e6691cf1945a7eb276ae6712ed13000b52252302b5b93
6
+ metadata.gz: 80d63e08d52244c2ceb82ae757d9d6933ca0a96ad859f697f024d741c91a37f0941e0733025177ca7debcc072009010f3d8c046d8c93c01a7df2a972fa521062
7
+ data.tar.gz: f4e401db51717ccdebcbff94dd1c2b3e596e2b4e1ecef53d8af79dd905e9f43989ac1b00237824c4361a8e2346a7c452d19b266dfad863f354ea329415ab1e7e
File without changes
@@ -2,4 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 1.9.3
5
- script: cd test && bundle exec clash
5
+ script: bundle exec clash test
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.0.0 - 2015-01-06
4
+
5
+ - Breaking: Configuration is now set in _config.yml beneath the `linkblog` key.
6
+ - Improved configuration management.
7
+ - Support for Octopress Docs.
8
+
3
9
  ### 1.2.0 - 2014-08-21
4
10
 
5
11
  - New: `page.title_html` outputs page title, titlecased and unorphaned.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Octopress Linkblog
2
2
 
3
- Adds link blogging features, along with some other niceties, to any Jekyll site.
3
+ Adds link blogging features, along with some other niceties to any Jekyll site.
4
4
 
5
5
  [![Build Status](https://travis-ci.org/octopress/linkblog.svg)](https://travis-ci.org/octopress/linkblog)
6
6
  [![Gem Version](http://img.shields.io/gem/v/octopress-linkblog.svg)](https://rubygems.org/gems/octopress-linkblog)
@@ -8,22 +8,26 @@ Adds link blogging features, along with some other niceties, to any Jekyll site.
8
8
 
9
9
  ## Installation
10
10
 
11
- Add this line to your application's Gemfile:
11
+ ### Using Bundler
12
12
 
13
- gem 'octopress-linkblog'
13
+ Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
14
14
 
15
- And then execute:
15
+ group :jekyll_plugins do
16
+ gem 'octopress-linkblog'
17
+ end
18
+
19
+ Then install the gem with Bundler
16
20
 
17
21
  $ bundle
18
22
 
19
- Or install it yourself as:
23
+ ### Manual Installation
20
24
 
21
25
  $ gem install octopress-linkblog
22
26
 
23
- Next add it to your gems list in Jekyll's `_config.yml`
27
+ Then add the gem to your Jekyll configuration.
24
28
 
25
29
  gems:
26
- - octopress-linkblog
30
+ -octopress-linkblog
27
31
 
28
32
  ## Usage
29
33
 
@@ -75,19 +79,20 @@ of post.
75
79
 
76
80
  ## Configuration
77
81
 
78
- In your site's `_octopress.yml` you can configure the Linkblog features. Here are the defaults.
82
+ You can configure this plugin in your site's `_config.yml` under the `linkblog` key. Here are the defaults.
79
83
 
80
84
  ```ruby
81
- linkpost:
82
- marker:
83
- marker_position: after
84
- posts:
85
- marker: false
86
- marker_position: before
87
-
88
- titlecase: true
89
- unorphan: true
90
- permalink_label: Permalink
85
+ linkblog:
86
+ linkpost:
87
+ marker:
88
+ marker_position: after
89
+ posts:
90
+ marker: false
91
+ marker_position: before
92
+
93
+ titlecase: true
94
+ unorphan: true
95
+ permalink_label: Permalink
91
96
  ```
92
97
 
93
98
  ## Contributing
@@ -5,13 +5,13 @@ require 'titlecase'
5
5
  require 'octopress-hooks'
6
6
 
7
7
  module Octopress
8
- module LinkBlog
9
-
10
- def self.config
11
- LinkBlog::Configuration.config
12
- end
8
+ module Linkblog
13
9
 
14
10
  class SiteHook < Hooks::Site
11
+ def pre_read(site)
12
+ Linkblog.config(site.config)
13
+ end
14
+
15
15
  def merge_payload(payload, site)
16
16
  {
17
17
  'site' => {
@@ -25,8 +25,8 @@ module Octopress
25
25
  class PageHook < Hooks::Page
26
26
  def post_init(page)
27
27
  if page.data['title']
28
- page.data['title'].titlecase! if LinkBlog.config['titlecase']
29
- page.data['title_html'] = LinkBlog.unorphan(page.data['title'])
28
+ page.data['title'].titlecase! if Linkblog.config['titlecase']
29
+ page.data['title_html'] = Linkblog.unorphan(page.data['title'])
30
30
  end
31
31
  end
32
32
  end
@@ -39,28 +39,28 @@ module Octopress
39
39
  def add_post_vars(post)
40
40
  linkpost = post.data['external-url']
41
41
 
42
- post.data['title'].titlecase! if LinkBlog.config['titlecase']
42
+ post.data['title'].titlecase! if Linkblog.config['titlecase']
43
43
 
44
44
  if linkpost
45
- config = LinkBlog.config['linkpost']
45
+ config = Linkblog.config['linkpost']
46
46
  else
47
- config = LinkBlog.config['post']
47
+ config = Linkblog.config['post']
48
48
  end
49
49
 
50
- post.data['title_text'] = LinkBlog.post_title_text(post.data['title'], config)
51
- post.data['title_html'] = LinkBlog.post_title_html(post.data['title'], config)
50
+ post.data['title_text'] = Linkblog.post_title_text(post.data['title'], config)
51
+ post.data['title_html'] = Linkblog.post_title_html(post.data['title'], config)
52
52
  post.data['title_url'] = linkpost || post.url
53
53
  post.data['linkpost'] = !linkpost.nil?
54
- post.data['title_link'] = LinkBlog.post_title_link(post.data)
55
- post.data['permalink'] = LinkBlog.post_link(LinkBlog.config['permalink_label'], post.url, 'article-permalink')
56
-
54
+ post.data['title_link'] = Linkblog.post_title_link(post.data)
55
+ post.data['permalink'] = Linkblog.post_link(Linkblog.config['permalink_label'], post.url, 'article-permalink')
56
+
57
57
  post
58
58
  end
59
59
 
60
60
  end
61
61
 
62
62
  def self.unorphan(title)
63
- if LinkBlog.config['unorphan']
63
+ if Linkblog.config['unorphan']
64
64
  title.sub(/\s+(\S+)\s*$/, '&nbsp;\1')
65
65
  else
66
66
  title
@@ -107,3 +107,14 @@ module Octopress
107
107
  end
108
108
  end
109
109
 
110
+ if defined? Octopress::Docs
111
+ Octopress::Docs.add({
112
+ name: "Octopress Linkblog",
113
+ gem: "octopress-linkblog",
114
+ description: "Add link-blogging features to any Jekyll site",
115
+ path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
116
+ source_url: "https://github.com/octopress/linkblog",
117
+ version: Octopress::Linkblog::VERSION
118
+ })
119
+ end
120
+
@@ -1,19 +1,9 @@
1
- # encoding: utf-8
2
- module Octopress
3
- unless defined? Octopress.config
4
- def self.config
5
- file = '_octopress.yml'
6
- if File.exist?(file)
7
- SafeYAML.load_file(file) || {}
8
- else
9
- {}
10
- end
11
- end
12
- end
1
+ # encoding: UTF-8
13
2
 
14
- module LinkBlog
15
- module Configuration
16
- DEFAULTS = {
3
+ module Octopress
4
+ module Linkblog
5
+ DEFAULT_OPTIONS = {
6
+ 'linkblog' => {
17
7
  'linkpost' => {
18
8
  'marker' => "→",
19
9
  'marker_position' => 'after'
@@ -28,10 +18,12 @@ module Octopress
28
18
  'unorphan' => true,
29
19
  'permalink_label' => 'Permalink'
30
20
  }
21
+ }
31
22
 
32
- def self.config
33
- @config ||= Jekyll::Utils.deep_merge_hashes(DEFAULTS, Octopress.config)
34
- end
23
+ def self.config(options={})
24
+ @config ||= Jekyll::Utils.deep_merge_hashes(DEFAULT_OPTIONS, options)
25
+ @config['linkblog']
35
26
  end
27
+
36
28
  end
37
29
  end
@@ -1,7 +1,5 @@
1
1
  module Octopress
2
- module Tags
3
- module LinkBlog
4
- VERSION = "1.2.0"
5
- end
2
+ module Linkblog
3
+ VERSION = "2.0.0"
6
4
  end
7
5
  end
@@ -5,7 +5,7 @@ require 'octopress-linkblog/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "octopress-linkblog"
8
- spec.version = Octopress::Tags::LinkBlog::VERSION
8
+ spec.version = Octopress::Linkblog::VERSION
9
9
  spec.authors = ["Brandon Mathis"]
10
10
  spec.email = ["brandon@imathis.com"]
11
11
  spec.summary = %q{Add linkblog features to your Jekyll site.}
@@ -24,4 +24,9 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.6"
25
25
  spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency "clash"
27
+
28
+ if RUBY_VERSION >= "2"
29
+ spec.add_development_dependency "pry-byebug"
30
+ end
31
+
27
32
  end
@@ -12,3 +12,7 @@ exclude:
12
12
  markdown: kramdown
13
13
  gems:
14
14
  - octopress-linkblog
15
+
16
+ linkblog:
17
+ post:
18
+ marker: ★
@@ -1 +1 @@
1
- Hey Guys.
1
+ <p>Hey Guys.</p>
@@ -1,5 +1,19 @@
1
1
 
2
- Titles:
2
+ Titles:
3
+ normal: Some Awesome Post
4
+ html: <span class='post-marker post-marker-before'>★</span>&nbsp;Some Awesome&nbsp;Post
5
+ text: ★ Some Awesome Post
6
+
7
+ Urls:
8
+ normal: /2014/05/25/awesome-things.html
9
+ title_url: /2014/05/25/awesome-things.html
10
+ title_link: <a href='/2014/05/25/awesome-things.html' class='article-link'><span class='post-marker post-marker-before'>★</span>&nbsp;Some Awesome&nbsp;Post</a>
11
+ permalink: <a href='/2014/05/25/awesome-things.html' class='article-permalink'>Permalink</a>
12
+
13
+ linkpost: false
14
+
15
+
16
+ Titles:
3
17
  normal: Some Awesome Post
4
18
  html: <span class='post-marker post-marker-before'>★</span>&nbsp;Some Awesome&nbsp;Post
5
19
  text: ★ Some Awesome Post
@@ -24,6 +24,20 @@ title_url: /2014/05/25/awesome-things.html
24
24
  title_link: <a href='/2014/05/25/awesome-things.html' class='article-link'><span class='post-marker post-marker-before'>★</span>&nbsp;Some Awesome&nbsp;Post</a>
25
25
  permalink: <a href='/2014/05/25/awesome-things.html' class='article-permalink'>Permalink</a>
26
26
 
27
+ linkpost: false
28
+
29
+
30
+ Titles:
31
+ normal: Some Awesome Post
32
+ html: <span class='post-marker post-marker-before'>★</span>&nbsp;Some Awesome&nbsp;Post
33
+ text: ★ Some Awesome Post
34
+
35
+ Urls:
36
+ normal: /2014/05/25/awesome-things.html
37
+ title_url: /2014/05/25/awesome-things.html
38
+ title_link: <a href='/2014/05/25/awesome-things.html' class='article-link'><span class='post-marker post-marker-before'>★</span>&nbsp;Some Awesome&nbsp;Post</a>
39
+ permalink: <a href='/2014/05/25/awesome-things.html' class='article-permalink'>Permalink</a>
40
+
27
41
  linkpost: false
28
42
 
29
43
 
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Some awesome post
3
+ ---
4
+
5
+ Hey Guys.
@@ -2,5 +2,5 @@
2
2
  ---
3
3
 
4
4
  {% for post in site.articles %}
5
- {% include post.html %}
5
+ {% include post.html %}
6
6
  {% endfor %}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-linkblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-24 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-hooks
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: Add linkblog features to your Jekyll site.
84
98
  email:
85
99
  - brandon@imathis.com
@@ -87,6 +101,7 @@ executables: []
87
101
  extensions: []
88
102
  extra_rdoc_files: []
89
103
  files:
104
+ - ".clash.yml"
90
105
  - ".gitignore"
91
106
  - ".travis.yml"
92
107
  - CHANGELOG.md
@@ -98,7 +113,6 @@ files:
98
113
  - lib/octopress-linkblog/configuration.rb
99
114
  - lib/octopress-linkblog/version.rb
100
115
  - octopress-linkblog.gemspec
101
- - test/.clash.yml
102
116
  - test/Gemfile
103
117
  - test/_config.yml
104
118
  - test/_expected/2014/05/25/awesome-things.html
@@ -107,8 +121,8 @@ files:
107
121
  - test/_expected/linkposts.html
108
122
  - test/_expected/posts.html
109
123
  - test/_includes/post.html
110
- - test/_octopress.yml
111
124
  - test/_posts/2014-05-25-awesome-things.html
125
+ - test/_posts/2014-05-25-awesome-things.markdown
112
126
  - test/_posts/2014-06-25-some-linkpost.html
113
127
  - test/articles.html
114
128
  - test/linkposts.html
@@ -138,7 +152,6 @@ signing_key:
138
152
  specification_version: 4
139
153
  summary: Add linkblog features to your Jekyll site.
140
154
  test_files:
141
- - test/.clash.yml
142
155
  - test/Gemfile
143
156
  - test/_config.yml
144
157
  - test/_expected/2014/05/25/awesome-things.html
@@ -147,8 +160,8 @@ test_files:
147
160
  - test/_expected/linkposts.html
148
161
  - test/_expected/posts.html
149
162
  - test/_includes/post.html
150
- - test/_octopress.yml
151
163
  - test/_posts/2014-05-25-awesome-things.html
164
+ - test/_posts/2014-05-25-awesome-things.markdown
152
165
  - test/_posts/2014-06-25-some-linkpost.html
153
166
  - test/articles.html
154
167
  - test/linkposts.html
@@ -1,2 +0,0 @@
1
- post:
2
- marker: ★