Repository navigation
Expand file tree
/
Copy pathreset.js
More file actions
32 lines (28 loc) · 1.38 KB
/
Copy pathreset.js
File metadata and controls
32 lines (28 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import fs from "node:fs";
import path from "node:path";
// Remove imported entries, keeping each source folder’s data file
for(let source of fs.readdirSync("content", { withFileTypes: true })) {
if(!source.isDirectory() || source.name.startsWith("_") || source.name.startsWith(".")) {
continue;
}
let dir = path.join("content", source.name);
for(let entry of fs.readdirSync(dir)) {
if(entry !== `${source.name}.11tydata.js`) {
fs.rmSync(path.join(dir, entry), { recursive: true, force: true });
}
}
}
fs.rmSync(".cache", { recursive: true, force: true });
fs.rmSync("_site", { recursive: true, force: true });
fs.writeFileSync("import.config.js", `export default [
// { type: "bluesky", target: "@example.com", output: "content/bluesky" },
// { type: "fediverse", target: "user@mastodon.social", output: "content/fediverse" },
// { type: "github", target: "username", output: "content/github" },
// { type: "npm", target: "username", output: "content/npm" },
// { type: "youtubeuser", target: "UC_CHANNEL_ID", output: "content/youtube" },
// { type: "letterboxd", target: "username", output: "content/letterboxd" },
// { type: "atom", target: "https://example.com/feed.xml", output: "content/blog" },
// { type: "rss", target: "https://example.com/podcast.rss", output: "content/podcast" },
// { type: "hackernews", target: "https://example.com", output: "content/hackernews" },
];
`);