jekyll-git_metadata 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/jekyll-git_metadata.gemspec +1 -1
- data/lib/jekyll/git_metadata/generator.rb +9 -4
- data/lib/jekyll/git_metadata/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0280f1d68740d28eda7bbbc1cf45963a6fb88e5
|
4
|
+
data.tar.gz: 891fef742808bc08bdcaf827cb038896e3463385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be68cfb054fb105e6470e2e1f5aab39b671b81832b98b13c75cf80b1c3202bc6ff390f4a8257041cc9aeaa00c0746c09ab4ebfd189f6dc2b31c7d2efd0149b9b
|
7
|
+
data.tar.gz: 031245921d99b103ec49bdd94d296092a4a58a56226ed0512621788f89d6f2a95f2c44e62aac6e99f76cc04c57b8fdc792ae9453e2c094981c7c2a22fef325d7
|
data/README.md
CHANGED
@@ -11,14 +11,14 @@ Expose Git metadata to Jekyll. Just like how Github exposes [repository metadata
|
|
11
11
|
Add to your `Gemfile`:
|
12
12
|
|
13
13
|
```
|
14
|
-
gem 'jekyll-
|
14
|
+
gem 'jekyll-git_metadata'
|
15
15
|
```
|
16
16
|
|
17
17
|
Add to your `_config.yml`:
|
18
18
|
|
19
19
|
```yml
|
20
20
|
gems:
|
21
|
-
- jekyll-
|
21
|
+
- jekyll-git_metadata
|
22
22
|
```
|
23
23
|
|
24
24
|
## Usage
|
data/jekyll-git_metadata.gemspec
CHANGED
@@ -18,7 +18,7 @@ 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 "jekyll", '~>
|
21
|
+
spec.add_dependency "jekyll", '~> 3.0'
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
24
24
|
spec.add_development_dependency "rake"
|
@@ -11,11 +11,16 @@ module Jekyll
|
|
11
11
|
|
12
12
|
Dir.chdir(site.source) do
|
13
13
|
site.config['git'] = site_data
|
14
|
-
(site.pages + site.posts).each do |page|
|
15
|
-
page.
|
14
|
+
(site.pages + site.posts.docs).each do |page|
|
15
|
+
if page.is_a?(Jekyll::Page)
|
16
|
+
path = page.path
|
17
|
+
else
|
18
|
+
path = page.relative_path
|
19
|
+
end
|
20
|
+
page.data['git'] = page_data(path)
|
16
21
|
end
|
17
22
|
end
|
18
|
-
|
23
|
+
|
19
24
|
end
|
20
25
|
|
21
26
|
def site_data
|
@@ -42,7 +47,7 @@ module Jekyll
|
|
42
47
|
|
43
48
|
def authors(file = nil)
|
44
49
|
results = []
|
45
|
-
cmd = 'git shortlog -se'
|
50
|
+
cmd = 'git shortlog -se HEAD'
|
46
51
|
cmd << " -- #{file}" if file
|
47
52
|
result = %x{ #{cmd} }
|
48
53
|
result.lines.each do |line|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-git_metadata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Tse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
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
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
184
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
185
|
+
rubygems_version: 2.5.1
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Expose Git metadata to Jekyll.
|