feat: fetch root files at build step and handle double click on mobile

This commit is contained in:
Pihkaal
2024-09-10 18:21:36 +02:00
parent 2b48e71248
commit 477f6b6c66
7 changed files with 78 additions and 25 deletions

View File

@@ -23,6 +23,11 @@ type Project = {
private: boolean;
};
type File = {
name: string;
content: string;
};
export const manifest = (): Plugin => ({
name: "generate-pages-plugin",
buildStart: async () => {
@@ -86,14 +91,27 @@ export const manifest = (): Plugin => ({
});
}
const files: Array<File> = [];
for (const file of manifest.files) {
const content = await getRepoFileContent("pihkaal", file);
files.push({
name: file,
content,
});
}
const code = `
const projects = ${JSON.stringify(projects, null, 2)} as const;
const links = ${JSON.stringify(manifest.links, null, 2)} as const;
const files = ${JSON.stringify(files, null, 2)} as const;
export const assets = {
projects,
links
links,
files
};
`;