1const fs = require("fs");
2const matter = require("gray-matter");
3const toml = require("@iarna/toml");
4const path = require("path");
5const { DateTime } = require("luxon");
7const dir = path.join(process.cwd(), "../content/media");
12 parse: toml.parse.bind(toml),
13 stringify: toml.stringify.bind(toml),
20fs.readdirSync(dir, { withFileTypes: true })
21 .filter((f) => f.isFile() && f.name !== "_index.md")
23 const fileContents = matter(
24 fs.readFileSync(path.join(dir, f.name)),
28 const newDate = DateTime.fromJSDate(
29 new Date(fileContents.data.date)
30 ).toFormat("yyyy-MM-dd");
32 fileContents.data.date = newDate;
34 const data = matter.stringify(
40 // console.log(fileContents.data.date)
42 // fs.writeFileSync(path.join(dir, f.name), data);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list