Fallback title based on time

This commit is contained in:
Anatol Broder 2014-05-05 10:37:21 +02:00
parent 3517b9f4e2
commit 367a818c26
1 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,11 @@ def run_jekyll(args)
end end
def slug(title) def slug(title)
if title
title.downcase.gsub(/[^\w]/, " ").strip.gsub(/\s+/, '-') title.downcase.gsub(/[^\w]/, " ").strip.gsub(/\s+/, '-')
else
Time.now.strftime("%s%9N") # nanoseconds since the Epoch
end
end end
def location(folder, direction) def location(folder, direction)