Simpler logic to category patch
Replace single line with cleaner, more readable Ruby.
This commit is contained in:
parent
2fc2e068e6
commit
a53b4a95dc
1 changed files with 1 additions and 1 deletions
2
Rakefile
2
Rakefile
|
@ -47,7 +47,7 @@ task :post do
|
|||
title = ENV["title"] || "new-post"
|
||||
tags = ENV["tags"] || "[]"
|
||||
category = ENV["category"] || ""
|
||||
category = category.empty? ? "" : "\"#{category.gsub(/-/,' ')}\""
|
||||
category = "\"#{category.gsub(/-/,' ')}\"" if !category.empty?
|
||||
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
|
||||
begin
|
||||
date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')
|
||||
|
|
Loading…
Add table
Reference in a new issue