diff --git a/gulp/_template.js b/gulp/_template.js deleted file mode 100644 index 567b4d2..0000000 --- a/gulp/_template.js +++ /dev/null @@ -1,12 +0,0 @@ - -const format = require('date-fns/format'); - -module.exports = exports = ({ id, date }) => `--- -id: "${id}" -date: "${date.toISOString()}" -title: "" -description: "Outfit of the Day for ${format(date, 'MMM do, yyyy')}" -tags: - - OOTD ---- -`; diff --git a/gulp/new.js b/gulp/new.js deleted file mode 100644 index 7e1e4a6..0000000 --- a/gulp/new.js +++ /dev/null @@ -1,35 +0,0 @@ - -const argv = require('minimist')(process.argv.slice(2)); -const format = require('date-fns/format'); -const parse = require('date-fns/parse'); -const random = require('./lib/random'); -const path = require('path'); -const fs = require('fs-extra'); -const log = require('fancy-log'); -const template = require('./_template'); - -const ROOT = path.dirname(__dirname); - -module.exports = exports = async function newPost () { - var date = argv.date ? parse(argv.date, 'yyyy-MM-dd', new Date()) : new Date(); - - if (!date.getHours()) { - const now = new Date(); - date.setHours(now.getHours()); - date.setMinutes(now.getMinutes()); - } - - // console.log(date);return; - var id = random.id().substr(-6).toUpperCase(); - var fname = format(date, 'yyyy-MM-dd.HHmm.') + id; - - var target = path.join(ROOT, 'posts', fname); - - await fs.ensureDir(target); - - var contents = template({ id, date }); - - await fs.writeFile(path.join(target, 'index.md'), contents); - - log('Created new post at posts/' + fname); -};