Date et heure complète à la création d'un fichier
This commit is contained in:
@@ -22,6 +22,7 @@ const path = require('path');
|
||||
const https = require('https');
|
||||
const readline = require('readline');
|
||||
const { loadToolsConfig } = require('./lib/config');
|
||||
const { formatDateTime } = require('./lib/datetime');
|
||||
|
||||
const ROOT = process.cwd();
|
||||
const LEGO_ROOT = path.join(ROOT, 'content', 'collections', 'lego');
|
||||
@@ -366,8 +367,7 @@ async function main() {
|
||||
const indexExists = fsSync.existsSync(indexPath);
|
||||
if (!indexExists) {
|
||||
const pageTitle = setDetails.name || selected.name;
|
||||
const today = new Date();
|
||||
const date = today.toISOString().slice(0, 10);
|
||||
const createdAt = formatDateTime();
|
||||
|
||||
// Collect images present in imagesDir (existing or just downloaded)
|
||||
let imageFiles = [];
|
||||
@@ -417,7 +417,7 @@ async function main() {
|
||||
const coverLine = coverFile ? `cover: images/${coverFile}\n` : '';
|
||||
const md = `---\n` +
|
||||
`title: "${pageTitle.replace(/"/g, '\\"')}"\n` +
|
||||
`date: ${date}\n` +
|
||||
`date: ${createdAt}\n` +
|
||||
coverLine +
|
||||
`---\n\n` +
|
||||
body;
|
||||
|
||||
Reference in New Issue
Block a user