17 lines
561 B
PHP
17 lines
561 B
PHP
<?php
|
|
if (!isset($argv[1])) die('usage: php newpost.php [slug]');
|
|
if (file_exists("blog/{$argv[1]}.md")) die("エラー: ファイル「blog/{$argv[1]}.md」は既に存在します。\n");
|
|
|
|
include('util.php');
|
|
$post = fopen("blog/{$argv[1]}.md", "w");
|
|
fwrite($post, "title: 【】\n");
|
|
fwrite($post, "uuid: ".uuid()."\n");
|
|
fwrite($post, "author: 諏訪子\n");
|
|
fwrite($post, "date: ".date("Y-m-d H:i:s")."\n");
|
|
fwrite($post, "thumbnail: \n");
|
|
fwrite($post, "thumborient: center\n");
|
|
fwrite($post, "category: \n");
|
|
fwrite($post, "----\n");
|
|
fclose($post);
|
|
?>
|