mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: skeleton and proper file extensions
This commit is contained in:
1 parent
b52c107af9
commit
04e09b84ff
11 files changed
+124
-93
No files matched your search
@@ -33,11 +33,14 @@ export async function glossary() {
|
||||
avatars[key].avatar.name.locales[supported.locale] =
|
||||
glossaryEntry.title;
|
||||
} else {
|
||||
const extension = extname(glossaryEntry.image_url);
|
||||
|
||||
avatars[key] = {
|
||||
url: glossaryEntry.image_url,
|
||||
avatar: {
|
||||
id: key,
|
||||
name: { locales: { [supported.locale]: glossaryEntry.title } },
|
||||
extension,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -65,13 +68,12 @@ export async function glossary() {
|
||||
|
||||
gallery.avatars.push(avatar);
|
||||
|
||||
const fileExtension = extname(url);
|
||||
const content = await fetch(url).then((response) =>
|
||||
response.arrayBuffer(),
|
||||
);
|
||||
|
||||
changes.push({
|
||||
path: `gallery/avatars/${key}${fileExtension}`,
|
||||
path: `gallery/avatars/${key}${avatar.extension}`,
|
||||
content: Buffer.from(content),
|
||||
});
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export async function commitAssets(message: string, changes: FileChange[]) {
|
||||
|
||||
if (changes.length === 0) return;
|
||||
|
||||
const chunks = chunk(changes, 16);
|
||||
const chunks = chunk(changes, 64);
|
||||
let chunkIndex = 0;
|
||||
|
||||
for (const chunk of chunks) {
|
||||
|
||||
@@ -38,7 +38,11 @@ export async function commitMultipleFiles(
|
||||
);
|
||||
|
||||
changes.push(change);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`🔵 (${buffer.length.toLocaleString()}B) ${blobPath}`);
|
||||
} else {
|
||||
throw new Error(
|
||||
`Unexpected status code ${response.status} for ${blobPath}`,
|
||||
|
||||
Reference in new issue
Block a user