forked from shadowfacts/shadowfacts.net
Remove unnecessary blocking generators
This commit is contained in:
parent
2a0f1ab773
commit
f7dea0647f
|
@ -30,9 +30,9 @@ async function generate(theme: string) {
|
|||
}
|
||||
|
||||
export default async function css() {
|
||||
await generate("light");
|
||||
await generate("dark");
|
||||
await generate("auto");
|
||||
generate("light");
|
||||
generate("dark");
|
||||
generate("auto");
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
require("fs").watch("site/css/", css);
|
||||
|
|
|
@ -4,7 +4,7 @@ import css from "./css";
|
|||
import errors from "./errors";
|
||||
import homepage from "./homepage";
|
||||
import posts from "./posts";
|
||||
import rss from "./rss";
|
||||
import * as rss from "./rss";
|
||||
import tutorials from "./tutorials";
|
||||
import years from "./years";
|
||||
|
||||
|
|
|
@ -24,12 +24,18 @@ async function generateFeed(posts: Page[], permalink: string, category?: string)
|
|||
util.write(dest, text);
|
||||
}
|
||||
|
||||
export default async function rss(posts: Page[], categories: Map<string, Page[]>, tutorials: TutorialSeries[]) {
|
||||
export async function posts(posts: Page[]) {
|
||||
generateFeed(posts, "/");
|
||||
}
|
||||
|
||||
export async function categories(categories: Map<string, Page[]>) {
|
||||
categories.forEach((posts, category) => {
|
||||
generateFeed(posts, `/${category}/`, category);
|
||||
});
|
||||
}
|
||||
|
||||
export async function tutorials(tutorials: TutorialSeries[]) {
|
||||
tutorials.forEach(series => {
|
||||
generateFeed(series.posts, `/tutorials/${series.series}/`, series.seriesName);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,13 @@ async function generate(): Promise<Page[]> {
|
|||
generators.css();
|
||||
generators.errors();
|
||||
|
||||
const tutorials = await generators.tutorials();
|
||||
generators.tutorials().then(generators.rss.tutorials);
|
||||
|
||||
const posts = await generators.posts();
|
||||
generators.homepage(posts);
|
||||
generators.years(posts);
|
||||
const categories = await generators.categories(posts);
|
||||
await generators.rss(posts, categories, tutorials);
|
||||
generators.rss.posts(posts)
|
||||
generators.categories(posts).then(generators.rss.categories);
|
||||
|
||||
return posts;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue