mirror of
https://github.com/adulau/brouilleursdeblanc.git
synced 2024-11-22 01:57:08 +00:00
28 lines
436 B
Text
28 lines
436 B
Text
|
require 'active_support/all'
|
||
|
|
||
|
class Post < Thor
|
||
|
include Thor::Actions
|
||
|
|
||
|
desc "new", "Creates a new post"
|
||
|
argument :title
|
||
|
def new
|
||
|
date = Time.now.strftime("%Y-%m-%d")
|
||
|
create_file "_posts/#{(date + '-' + title).parameterize}.md", <<-eos
|
||
|
---
|
||
|
layout: post
|
||
|
title: #{title}
|
||
|
description: A description
|
||
|
modified: #{date}
|
||
|
category: articles
|
||
|
tags: []
|
||
|
image:
|
||
|
credit:
|
||
|
creditlink:
|
||
|
feature:
|
||
|
comments: true
|
||
|
---
|
||
|
|
||
|
eos
|
||
|
end
|
||
|
|
||
|
end
|