From c80342417c002c0154ae8396322566cb6157bc66 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 13 Sep 2022 08:57:04 +0200 Subject: [PATCH] Fix demo --- scripts/generate_fs_list.js | 3 +++ website/_redirects | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/generate_fs_list.js b/scripts/generate_fs_list.js index 0ccb5e3..34baf24 100644 --- a/scripts/generate_fs_list.js +++ b/scripts/generate_fs_list.js @@ -1,5 +1,6 @@ const { resolve } = require("path"); const { readdir } = require("fs").promises; +const mime = require("mime-types"); async function getFiles(dir) { const dirents = await readdir(dir, { withFileTypes: true }); @@ -19,6 +20,8 @@ getFiles(rootDir).then((files) => { .map((file) => ({ name: file.substring(rootDir.length + 1), lastModified: 0, + contentType: mime.lookup(file), + size: 0, perm: "rw", })) .filter((pageMeta) => !pageMeta.name.startsWith(".")); diff --git a/website/_redirects b/website/_redirects index 88453e4..c620734 100644 --- a/website/_redirects +++ b/website/_redirects @@ -1,3 +1,3 @@ -/page /index.json 200 -/page/* /empty.md 200 +/fs /index.json 200 +/fs/* /empty.md 200 /* /index.html 200 \ No newline at end of file