jekyll-last-modified 1.0.2 → 1.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/README.md +2 -0
- data/jekyll-last-modified.gemspec +1 -1
- data/lib/jekyll/last_modified.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d34b842ba3dd823353cb96ce4c5cefb2719ae78d999e61c4da84289e0409df72
|
|
4
|
+
data.tar.gz: d8437c2a143ee76fa9ba9e7f6c1ce3df3f1707b9cb1ff4ceb3676f3f05408603
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 564a89ce5c7a1810c92d4d25ccd3975ecb92b5dc2eca6e41d8672eca59f4b4c3ff240f3e4eccd93c3f7e17f26a1ac7b5280b276c97db44a4b5740f4adb248713
|
|
7
|
+
data.tar.gz: 7a2c74004faf143f58df9e7ad1bac836eb218b750dd5caffbf993f044202faa7d8c6bb7180f7b370b4367c992494b284d1f5881d00044637f4f824b2c0e0dd3b
|
data/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# Jekyll::LastModified
|
|
2
2
|
|
|
3
3
|
This is a fork of [ivantsepp/jekyll-git_metadata](https://github.com/ivantsepp/jekyll-git_metadata), with the addition that it populates `page.date` (if unset) and `page.last_modified_at` from retrieved Git metadata.
|
|
4
|
+
|
|
5
|
+
Additionally, `subject` and `body` are available for commits, for retrieving the first line and the rest of the commit message separately.
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "jekyll-last-modified"
|
|
7
|
-
spec.version = '1.0.
|
|
7
|
+
spec.version = '1.0.3'
|
|
8
8
|
spec.authors = ["iBug"]
|
|
9
9
|
spec.email = ["i@ibugone.com"]
|
|
10
10
|
spec.summary = %q{Set page date from Git database}
|
data/lib/jekyll/last_modified.rb
CHANGED
|
@@ -112,7 +112,8 @@ module Jekyll
|
|
|
112
112
|
|
|
113
113
|
def commit(sha)
|
|
114
114
|
result = %x{ git show --format=fuller --name-only #{sha} }
|
|
115
|
-
long_sha, author_name, author_email, author_date, commit_name, commit_email, commit_date, message, changed_files = result.scan(/commit (.*)\nAuthor:(.*)<(.*)>\nAuthorDate:(.*)\nCommit:(.*)<(.*)>\nCommitDate:(.*)\n\n((
|
|
115
|
+
long_sha, author_name, author_email, author_date, commit_name, commit_email, commit_date, message, changed_files = result.scan(/commit (.*)\nAuthor:(.*)<(.*)>\nAuthorDate:(.*)\nCommit:(.*)<(.*)>\nCommitDate:(.*)\n\n((?:^\s{4}[^\r\n]*\n)*)\n(.*)/m).first.map(&:strip)
|
|
116
|
+
message.gsub! /^\s{4}/, ''
|
|
116
117
|
{
|
|
117
118
|
'short_sha' => sha,
|
|
118
119
|
'long_sha' => long_sha,
|
|
@@ -122,7 +123,9 @@ module Jekyll
|
|
|
122
123
|
'commit_name' => commit_name,
|
|
123
124
|
'commit_email' => commit_email,
|
|
124
125
|
'commit_date' => commit_date,
|
|
125
|
-
'
|
|
126
|
+
'subject' => message.lines.first.strip,
|
|
127
|
+
'body' => message.lines[2..]&.join,
|
|
128
|
+
'message' => message,
|
|
126
129
|
'changed_files' => changed_files.split("\n")
|
|
127
130
|
}
|
|
128
131
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-last-modified
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- iBug
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|