We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d83773a + e0d9ce4 commit 9f814f6Copy full SHA for 9f814f6
_plugins/last_modified_at.rb
@@ -46,7 +46,13 @@ def pre_render(site)
46
set_mode = "git"
47
end
48
rescue => e
49
- # Ignored
+ begin
50
+ page.data['last_modified_at'] = File.mtime(page_relative_path).strftime(DATE_FORMAT)
51
+ set_mode = "mtime"
52
+ rescue => e
53
+ page.data['last_modified_at'] = Time.now.strftime(DATE_FORMAT)
54
+ set_mode = "rescue"
55
+ end
56
57
58
puts" #{page.relative_path}#{path_override}\n last_modified_at(#{set_mode}): #{page.data['last_modified_at']}"
0 commit comments