jekyll-authors 0.0.2 → 0.0.3
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/jekyll-authors.rb +30 -4
- data/lib/jekyll-authors/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1aabff063e1458d62bb753264526742d982a9bf
|
4
|
+
data.tar.gz: de2097638656f6790618855fd815ac46347ecb4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc2926535b10d15777202a43bee7e2988d28bdd2c3d964e52c680035b2f5b3f2deff6878e732ee11025554829ed1e18513fbfaf07a792fbf0aef6cb40cbccf5
|
7
|
+
data.tar.gz: 7737504f2ed13b4d777e181bc3bc3bb3e9266676c2b1251303cbd1303ccc3e023280bc0114853c5ee16a54eedbb2cf9d4343beecf06b6a35a2ff6a943ea4fe1c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/jekyll-authors.rb
CHANGED
@@ -2,7 +2,34 @@ require 'jekyll-authors/tags'
|
|
2
2
|
|
3
3
|
module Jekyll
|
4
4
|
module Authors
|
5
|
+
module Utils
|
6
|
+
|
7
|
+
# Returns the `display_name` associated with the author. If there isn't
|
8
|
+
# one, it returns the nickname.
|
9
|
+
#
|
10
|
+
# @param author [String]
|
11
|
+
# @return [String]
|
12
|
+
def display_name(author)
|
13
|
+
return unless site.config['authors']
|
14
|
+
|
15
|
+
if site.config['authors'][author]
|
16
|
+
site.config['authors'][author]['display_name']
|
17
|
+
else
|
18
|
+
author
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns the `author_title_prefix` or "Author: "
|
23
|
+
#
|
24
|
+
# @return [String]
|
25
|
+
def author_title_prefix
|
26
|
+
site.config['author_title_prefix'] || 'Author: '
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
5
30
|
class AuthorIndex < Page
|
31
|
+
include Jekyll::Authors::Utils
|
32
|
+
|
6
33
|
def initialize(site, base, dir, author)
|
7
34
|
@site = site
|
8
35
|
@base = base
|
@@ -12,12 +39,13 @@ module Jekyll
|
|
12
39
|
self.process(@name)
|
13
40
|
self.read_yaml(File.join(base, '_layouts'), 'author_index.html')
|
14
41
|
self.data['author'] = author
|
15
|
-
|
16
|
-
self.data['title'] = "#{author_title_prefix}#{author}"
|
42
|
+
self.data['title'] = "#{author_title_prefix}#{display_name(author)}"
|
17
43
|
end
|
18
44
|
end
|
19
45
|
|
20
46
|
class AuthorFeed < Page
|
47
|
+
include Jekyll::Authors::Utils
|
48
|
+
|
21
49
|
def initialize(site, base, dir, author)
|
22
50
|
@site = site
|
23
51
|
@base = base
|
@@ -27,8 +55,6 @@ module Jekyll
|
|
27
55
|
self.process(@name)
|
28
56
|
self.read_yaml(File.join(base, '_layouts'), 'author_feed.xml')
|
29
57
|
self.data['author'] = author
|
30
|
-
|
31
|
-
author_title_prefix = site.config['author_title_prefix'] || 'Author: '
|
32
58
|
self.data['title'] = "#{author_title_prefix}#{author}"
|
33
59
|
end
|
34
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-authors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauro Otonelli
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|