octopress-linkblog 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{test/.clash.yml → .clash.yml} +0 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/README.md +23 -18
- data/lib/octopress-linkblog.rb +27 -16
- data/lib/octopress-linkblog/configuration.rb +10 -18
- data/lib/octopress-linkblog/version.rb +2 -4
- data/octopress-linkblog.gemspec +6 -1
- data/test/_config.yml +4 -0
- data/test/_expected/2014/05/25/awesome-things.html +1 -1
- data/test/_expected/articles.html +15 -1
- data/test/_expected/posts.html +14 -0
- data/test/_posts/2014-05-25-awesome-things.markdown +5 -0
- data/test/articles.html +1 -1
- metadata +19 -6
- data/test/_octopress.yml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8efaff5112e216bd1fa25b543caf5b20f84be0f4
|
4
|
+
data.tar.gz: 2c88cbeba8a2c6240cf9afb708808a128fa6f1c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80d63e08d52244c2ceb82ae757d9d6933ca0a96ad859f697f024d741c91a37f0941e0733025177ca7debcc072009010f3d8c046d8c93c01a7df2a972fa521062
|
7
|
+
data.tar.gz: f4e401db51717ccdebcbff94dd1c2b3e596e2b4e1ecef53d8af79dd905e9f43989ac1b00237824c4361a8e2346a7c452d19b266dfad863f354ea329415ab1e7e
|
File without changes
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
-
|
11
|
+
### Using Bundler
|
12
12
|
|
13
|
-
|
13
|
+
Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
|
14
14
|
|
15
|
-
|
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
|
-
|
23
|
+
### Manual Installation
|
20
24
|
|
21
25
|
$ gem install octopress-linkblog
|
22
26
|
|
23
|
-
|
27
|
+
Then add the gem to your Jekyll configuration.
|
24
28
|
|
25
29
|
gems:
|
26
|
-
-
|
30
|
+
-octopress-linkblog
|
27
31
|
|
28
32
|
## Usage
|
29
33
|
|
@@ -75,19 +79,20 @@ of post.
|
|
75
79
|
|
76
80
|
## Configuration
|
77
81
|
|
78
|
-
|
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
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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
|
data/lib/octopress-linkblog.rb
CHANGED
@@ -5,13 +5,13 @@ require 'titlecase'
|
|
5
5
|
require 'octopress-hooks'
|
6
6
|
|
7
7
|
module Octopress
|
8
|
-
module
|
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
|
29
|
-
page.data['title_html'] =
|
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
|
42
|
+
post.data['title'].titlecase! if Linkblog.config['titlecase']
|
43
43
|
|
44
44
|
if linkpost
|
45
|
-
config =
|
45
|
+
config = Linkblog.config['linkpost']
|
46
46
|
else
|
47
|
-
config =
|
47
|
+
config = Linkblog.config['post']
|
48
48
|
end
|
49
49
|
|
50
|
-
post.data['title_text'] =
|
51
|
-
post.data['title_html'] =
|
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'] =
|
55
|
-
post.data['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
|
63
|
+
if Linkblog.config['unorphan']
|
64
64
|
title.sub(/\s+(\S+)\s*$/, ' \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:
|
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
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
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
|
data/octopress-linkblog.gemspec
CHANGED
@@ -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::
|
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
|
data/test/_config.yml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Hey Guys
|
1
|
+
<p>Hey Guys.</p>
|
@@ -1,5 +1,19 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
Titles:
|
3
|
+
normal: Some Awesome Post
|
4
|
+
html: <span class='post-marker post-marker-before'>★</span> Some Awesome 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> Some Awesome 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> Some Awesome Post
|
5
19
|
text: ★ Some Awesome Post
|
data/test/_expected/posts.html
CHANGED
@@ -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> Some Awesome 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> Some Awesome 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> Some Awesome 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
|
|
data/test/articles.html
CHANGED
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:
|
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:
|
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
|
data/test/_octopress.yml
DELETED