mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 12:20:20 +01:00
Fix robots formatting
This commit is contained in:
parent
adb12b7278
commit
94dbcace8f
|
|
@ -5,14 +5,14 @@ const APPS_PATH = "components/apps";
|
|||
const PUBLIC_PATH = "public";
|
||||
const INDEXED_FILE_TYPES = new Set([".md", ".whtml"]);
|
||||
|
||||
const indexData = [];
|
||||
const indexData = ["User-agent: *", "Allow: /"];
|
||||
|
||||
const createAppIndex = () => {
|
||||
readdirSync(APPS_PATH).forEach((entry) => {
|
||||
const stats = statSync(join(APPS_PATH, entry));
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
indexData.push(encodeURI(`/?app=${entry}`));
|
||||
indexData.push(`Allow: ${encodeURI(`/?app=${entry}`)}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -25,11 +25,11 @@ const createFileIndex = (path) => {
|
|||
createFileIndex(join(path, entry));
|
||||
} else if (INDEXED_FILE_TYPES.has(extname(entry))) {
|
||||
indexData.push(
|
||||
encodeURI(
|
||||
`Allow: ${encodeURI(
|
||||
`/?url=${join(path, entry)
|
||||
.replace(PUBLIC_PATH, "")
|
||||
.replace(/\\/g, "/")}`
|
||||
)
|
||||
)}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user