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/events");
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)),
27 // This uses your default system timezone, so if you are not in 'America/Los_Angeles' the output will be incorrect.
28 // const starts = DateTime.fromSeconds(fileContents.data.starts).toISO();
29 // const ends = DateTime.fromSeconds(fileContents.data.ends).toISO();
31 // fileContents.data.date = DateTime.fromISO(fileContents.data.date).plus({
34 // fileContents.data.ends = DateTime.fromISO(fileContents.data.ends).plus({
38 // fileContents.data.guests = fileContents.data.contributors;
39 // delete fileContents.data.contributors;
41 fileContents.data.starts = `${fileContents.data.date}`;
42 delete fileContents.data.date;
44 const data = matter.stringify(
50 // 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