fix: static export failure

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-08-07 17:14:18 +08:00
parent d5a4a2a4da
commit ac8c625381
6 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
</NavigationMenu.Item> </NavigationMenu.Item>
<NavigationMenu.Item> <NavigationMenu.Item>
<NavigationMenu.Link href="/packages/" class="text-sm font-medium"> <NavigationMenu.Link href="/packages.html" class="text-sm font-medium">
{m.nav_packages()} {m.nav_packages()}
</NavigationMenu.Link> </NavigationMenu.Link>
</NavigationMenu.Item> </NavigationMenu.Item>
+1
View File
@@ -0,0 +1 @@
export const prerender = true
+1 -1
View File
@@ -85,7 +85,7 @@
<Table.Body> <Table.Body>
{#each results as item} {#each results as item}
<Table.Row> <Table.Row>
<Table.Cell><a href={`/packages/pkginfo/?pkgIdent=${strPkgIdent(item)}&mirrorName=${selectedMirror}`}>{item.name}</a></Table.Cell> <Table.Cell><a href={`/packages/pkginfo?pkgIdent=${strPkgIdent(item)}&mirrorName=${selectedMirror}`}>{item.name}</a></Table.Cell>
<Table.Cell>{item.version}</Table.Cell> <Table.Cell>{item.version}</Table.Cell>
<Table.Cell>{item.arch}</Table.Cell> <Table.Cell>{item.arch}</Table.Cell>
</Table.Row> </Table.Row>
+1 -1
View File
@@ -41,7 +41,7 @@ export function baseUrlForMirror(mirror: string): string {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function getRepoDb(url: string): Promise<any> { export async function getRepoDb(url: string): Promise<any> {
const sqlPromise = initSqlJs({ locateFile: (file: string) => `/node_modules/sql.js/dist/${file}` }); const sqlPromise = initSqlJs();
const dataPromise = fetch(url).then((res) => res.arrayBuffer()); const dataPromise = fetch(url).then((res) => res.arrayBuffer());
const [SQL, data] = await Promise.all([sqlPromise, dataPromise]); const [SQL, data] = await Promise.all([sqlPromise, dataPromise]);
return new SQL.Database(new Uint8Array(data)); return new SQL.Database(new Uint8Array(data));
+3 -3
View File
@@ -72,9 +72,9 @@
<p>{m.pkginfo_download_size()}: {pkgInfo ? formatSize(pkgInfo['download_size']) : ""}</p> <p>{m.pkginfo_download_size()}: {pkgInfo ? formatSize(pkgInfo['download_size']) : ""}</p>
</Card.Content> </Card.Content>
<Card.Footer> <Card.Footer>
<a href="{baseUrl}/{(pkgIdent ? strPkgIdent(pkgIdent) : '') + '.pkg'}" download> <Button onclick={() => {
<Button>{m.pkginfo_download_action()}</Button> window.location.href = `${baseUrl}/${(pkgIdent ? strPkgIdent(pkgIdent) : '') + '.pkg'}`;
</a> }}>{m.pkginfo_download_action()}</Button>
</Card.Footer> </Card.Footer>
</Card.Root> </Card.Root>
</div> </div>
Binary file not shown.