jekyll-last-modified-at 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/last_modified_at.rb +13 -0
  3. metadata +86 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 01bb4b4ade9d823f7de1e8c8d9d8a0a2dda35b24
4
+ data.tar.gz: aa8698880916eadca11a603b04574291a116b3ee
5
+ SHA512:
6
+ metadata.gz: c930c332cfe2b6d50e9ee20d8c732eaf7114f9245ecae05145f5ea5d3587414a3c317b9fbc9c6acaefd21d99e2db631cb347f02959fe08d067f330b13356cb16
7
+ data.tar.gz: 4cbbffe23eba7a52c01a92daa1ea78f701f7e6c569c6b2d96c7567ca422dc746885ec646d7f947f6e05049c3d844d27239b7f200b2cdc8c965cd151e967a434c
@@ -0,0 +1,13 @@
1
+ module Jekyll
2
+ class LastModifiedAtTag < Liquid::Tag
3
+ def render(context)
4
+ article_file = context.environments.first["page"]["path"]
5
+ article_file_path = File.join(context.registers[:site].source, article_file)
6
+ last_commit_date = `git log --format="%ct" -- .#{article_file_path}`.strip
7
+ last_modified_time = !last_commit_date.empty? ? last_commit_date : File.mtime(article_file_path)
8
+ Time.at(last_modified_time.to_i).strftime("%d-%b-%y")
9
+ end
10
+ end
11
+ end
12
+
13
+ Liquid::Template.register_tag('last_modified_at', Jekyll::LastModifiedAtTag)
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-last-modified-at
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Garen J. Torikian
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 2.13.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 2.13.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/last_modified_at.rb
62
+ homepage: https://github.com/gjtorikian/jekyll-last-modified-at
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.0.3
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: A liquid tag for Jekyll to indicate the last time a file was modified.
86
+ test_files: []