mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Fix new-post glitch
This commit is contained in:
parent
715634a8b9
commit
f18b07fa41
@ -19,7 +19,7 @@ module.exports = exports = async function newPost () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// console.log(date);return;
|
// console.log(date);return;
|
||||||
var id = random.id(6).toUpperCase();
|
var id = random.id(10).toUpperCase();
|
||||||
var fname = format(date, 'yyyy-MM-dd.HHmm.') + id;
|
var fname = format(date, 'yyyy-MM-dd.HHmm.') + id;
|
||||||
|
|
||||||
var target = resolve('posts', fname);
|
var target = resolve('posts', fname);
|
||||||
@ -29,7 +29,7 @@ module.exports = exports = async function newPost () {
|
|||||||
target += '.md';
|
target += '.md';
|
||||||
} else {
|
} else {
|
||||||
await fs.ensureDir(target);
|
await fs.ensureDir(target);
|
||||||
target += path.join(target, 'index.md');
|
target = path.join(target, 'index.md');
|
||||||
}
|
}
|
||||||
|
|
||||||
await fs.writeFile(target, contents);
|
await fs.writeFile(target, contents);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user