aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'nuldoc-src/command.ts')
-rw-r--r--nuldoc-src/command.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/nuldoc-src/command.ts b/nuldoc-src/command.ts
index 70532d4..57e4820 100644
--- a/nuldoc-src/command.ts
+++ b/nuldoc-src/command.ts
@@ -10,6 +10,7 @@ import { Document } from "./docbook/document.ts";
import convertPost from "./templates/post.ts";
import convertPostList from "./templates/post_list.ts";
import convertTag from "./templates/tag.ts";
+import generateAbout from "./templates/about.ts";
export async function run(command: string, config: Config) {
if (command === "build") {
@@ -25,6 +26,7 @@ async function cmdBuild(config: Config) {
const posts = await generatePosts(config);
await generateTags(posts, config);
await generatePostList(posts, config);
+ await generateAboutPage(config);
await copyStaticFiles(config);
}
@@ -110,6 +112,19 @@ async function outputPostList(postList: Document, config: Config) {
await writeHtmlFile(postList, destFilePath);
}
+async function generateAboutPage(config: Config) {
+ const aboutDoc = await generateAbout(config);
+ await outputAboutPage(aboutDoc, config);
+}
+
+async function outputAboutPage(about: Document, config: Config) {
+ const cwd = Deno.cwd();
+ const destDir = join(cwd, config.locations.destDir);
+ const destFilePath = join(destDir, "about", "index.html");
+ await ensureDir(dirname(destFilePath));
+ await writeHtmlFile(about, destFilePath);
+}
+
async function generateTags(posts: Document[], config: Config) {
const tagsAndPosts = collectTags(posts);
const tagDocs = await buildTagDocs(tagsAndPosts, config);