mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
jekyll(last_modified_at): fallback to mtime on rescue
if fallback doesn't work like for pageless redirections, use current time as best effort. Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -46,7 +46,13 @@ module Jekyll
|
||||
set_mode = "git"
|
||||
end
|
||||
rescue => e
|
||||
# Ignored
|
||||
begin
|
||||
page.data['last_modified_at'] = File.mtime(page_relative_path).strftime(DATE_FORMAT)
|
||||
set_mode = "mtime"
|
||||
rescue => e
|
||||
page.data['last_modified_at'] = Time.now.strftime(DATE_FORMAT)
|
||||
set_mode = "rescue"
|
||||
end
|
||||
end
|
||||
end
|
||||
puts" #{page.relative_path}#{path_override}\n last_modified_at(#{set_mode}): #{page.data['last_modified_at']}"
|
||||
|
||||
Reference in New Issue
Block a user