~repos /website
git clone https://pyrossh.dev/repos/website.git
木 Personal website of pyrossh. Built with astrojs, shiki, vite.
6f9e3f41
—
pyrossh 1 month ago
add android back handler
- .gitignore +1 -0
- bun.lock +13 -13
- package.json +1 -1
- src-tauri/Cargo.toml +9 -0
- src-tauri/gen/android/buildSrc/src/main/java/dev/pyrossh/website/kotlin/BuildTask.kt +17 -1
- src-tauri/tauri.conf.json +2 -1
- src/layouts/Base.astro +17 -1
.gitignore
CHANGED
|
@@ -56,3 +56,4 @@ dist-ssr
|
|
|
56
56
|
*.njsproj
|
|
57
57
|
*.sln
|
|
58
58
|
*.sw?
|
|
59
|
+
target
|
bun.lock
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@iconify-json/material-symbols": "^1.2.39",
|
|
18
18
|
"@playwright/test": "^1.52.0",
|
|
19
|
-
"@tauri-apps/cli": "^2.
|
|
19
|
+
"@tauri-apps/cli": "^2.9.1",
|
|
20
20
|
"@types/node": "^22.15.3",
|
|
21
21
|
},
|
|
22
22
|
},
|
|
@@ -218,29 +218,29 @@
|
|
|
218
218
|
|
|
219
219
|
"@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="],
|
|
220
220
|
|
|
221
|
-
"@tauri-apps/cli": ["@tauri-apps/cli@2.
|
|
221
|
+
"@tauri-apps/cli": ["@tauri-apps/cli@2.9.1", "", { "optionalDependencies": { "@tauri-apps/cli-darwin-arm64": "2.9.1", "@tauri-apps/cli-darwin-x64": "2.9.1", "@tauri-apps/cli-linux-arm-gnueabihf": "2.9.1", "@tauri-apps/cli-linux-arm64-gnu": "2.9.1", "@tauri-apps/cli-linux-arm64-musl": "2.9.1", "@tauri-apps/cli-linux-riscv64-gnu": "2.9.1", "@tauri-apps/cli-linux-x64-gnu": "2.9.1", "@tauri-apps/cli-linux-x64-musl": "2.9.1", "@tauri-apps/cli-win32-arm64-msvc": "2.9.1", "@tauri-apps/cli-win32-ia32-msvc": "2.9.1", "@tauri-apps/cli-win32-x64-msvc": "2.9.1" }, "bin": { "tauri": "tauri.js" } }, "sha512-kKi2/WWsNXKoMdatBl4xrT7e1Ce27JvsetBVfWuIb6D3ep/Y0WO5SIr70yarXOSWam8NyDur4ipzjZkg6m7VDg=="],
|
|
222
222
|
|
|
223
|
-
"@tauri-apps/cli-darwin-arm64": ["@tauri-apps/cli-darwin-arm64@2.
|
|
223
|
+
"@tauri-apps/cli-darwin-arm64": ["@tauri-apps/cli-darwin-arm64@2.9.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-sdwhtsE/6njD0AjgfYEj1JyxZH4SBmCJSXpRm6Ph5fQeuZD6MyjzjdVOrrtFguyREVQ7xn0Ujkwvbo01ULthNg=="],
|
|
224
224
|
|
|
225
|
-
"@tauri-apps/cli-darwin-x64": ["@tauri-apps/cli-darwin-x64@2.
|
|
225
|
+
"@tauri-apps/cli-darwin-x64": ["@tauri-apps/cli-darwin-x64@2.9.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-c86g+67wTdI4TUCD7CaSd/13+oYuLQxVST4ZNJ5C+6i1kdnU3Us1L68N9MvbDLDQGJc9eo0pvuK6sCWkee+BzA=="],
|
|
226
226
|
|
|
227
|
-
"@tauri-apps/cli-linux-arm-gnueabihf": ["@tauri-apps/cli-linux-arm-gnueabihf@2.
|
|
227
|
+
"@tauri-apps/cli-linux-arm-gnueabihf": ["@tauri-apps/cli-linux-arm-gnueabihf@2.9.1", "", { "os": "linux", "cpu": "arm" }, "sha512-IrB3gFQmueQKJjjisOcMktW/Gh6gxgqYO419doA3YZ7yIV5rbE8ZW52Q3I4AO+SlFEyVYer5kpi066p0JBlLGw=="],
|
|
228
228
|
|
|
229
|
-
"@tauri-apps/cli-linux-arm64-gnu": ["@tauri-apps/cli-linux-arm64-gnu@2.
|
|
229
|
+
"@tauri-apps/cli-linux-arm64-gnu": ["@tauri-apps/cli-linux-arm64-gnu@2.9.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-Ke7TyXvu6HbWSkmVkFbbH19D3cLsd117YtXP/u9NIvSpYwKeFtnbpirrIUfPm44Q+PZFZ2Hvg8X9qoUiAK0zKw=="],
|
|
230
230
|
|
|
231
|
-
"@tauri-apps/cli-linux-arm64-musl": ["@tauri-apps/cli-linux-arm64-musl@2.
|
|
231
|
+
"@tauri-apps/cli-linux-arm64-musl": ["@tauri-apps/cli-linux-arm64-musl@2.9.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-sGvy75sv55oeMulR5ArwPD28DsDQxqTzLhXCrpU9/nbFg/JImmI7k994YE9fr3V0qE3Cjk5gjLldRNv7I9sjwQ=="],
|
|
232
232
|
|
|
233
|
-
"@tauri-apps/cli-linux-riscv64-gnu": ["@tauri-apps/cli-linux-riscv64-gnu@2.
|
|
233
|
+
"@tauri-apps/cli-linux-riscv64-gnu": ["@tauri-apps/cli-linux-riscv64-gnu@2.9.1", "", { "os": "linux", "cpu": "none" }, "sha512-tEKbJydV3BdIxpAx8aGHW6VDg1xW4LlQuRD/QeFZdZNTreHJpMbJEcdvAcI+Hg6vgQpVpaoEldR9W4F6dYSLqQ=="],
|
|
234
234
|
|
|
235
|
-
"@tauri-apps/cli-linux-x64-gnu": ["@tauri-apps/cli-linux-x64-gnu@2.
|
|
235
|
+
"@tauri-apps/cli-linux-x64-gnu": ["@tauri-apps/cli-linux-x64-gnu@2.9.1", "", { "os": "linux", "cpu": "x64" }, "sha512-mg5msXHagtHpyCVWgI01M26JeSrgE/otWyGdYcuTwyRYZYEJRTbcNt7hscOkdNlPBe7isScW7PVKbxmAjJJl4g=="],
|
|
236
236
|
|
|
237
|
-
"@tauri-apps/cli-linux-x64-musl": ["@tauri-apps/cli-linux-x64-musl@2.
|
|
237
|
+
"@tauri-apps/cli-linux-x64-musl": ["@tauri-apps/cli-linux-x64-musl@2.9.1", "", { "os": "linux", "cpu": "x64" }, "sha512-lFZEXkpDreUe3zKilvnMsrnKP9gwQudaEjDnOz/GMzbzNceIuPfFZz0cR/ky1Aoq4eSvZonPKHhROq4owz4fzg=="],
|
|
238
238
|
|
|
239
|
-
"@tauri-apps/cli-win32-arm64-msvc": ["@tauri-apps/cli-win32-arm64-msvc@2.
|
|
239
|
+
"@tauri-apps/cli-win32-arm64-msvc": ["@tauri-apps/cli-win32-arm64-msvc@2.9.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-ejc5RAp/Lm1Aj0EQHaT+Wdt5PHfdgQV5hIDV00MV6HNbIb5W4ZUFxMDaRkAg65gl9MvY2fH396riePW3RoKXDw=="],
|
|
240
240
|
|
|
241
|
-
"@tauri-apps/cli-win32-ia32-msvc": ["@tauri-apps/cli-win32-ia32-msvc@2.
|
|
241
|
+
"@tauri-apps/cli-win32-ia32-msvc": ["@tauri-apps/cli-win32-ia32-msvc@2.9.1", "", { "os": "win32", "cpu": "ia32" }, "sha512-fSATtJDc0fNjVB6ystyi8NbwhNFk8i8E05h6KrsC8Fio5eaJIJvPCbC9pdrPl6kkxN1X7fj25ErBbgfqgcK8Fg=="],
|
|
242
242
|
|
|
243
|
-
"@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.
|
|
243
|
+
"@tauri-apps/cli-win32-x64-msvc": ["@tauri-apps/cli-win32-x64-msvc@2.9.1", "", { "os": "win32", "cpu": "x64" }, "sha512-/JHlOzpUDhjBOO9w167bcYxfJbcMQv7ykS/Y07xjtcga8np0rzUzVGWYmLMH7orKcDMC7wjhheEW1x8cbGma/Q=="],
|
|
244
244
|
|
|
245
245
|
"@trysound/sax": ["@trysound/sax@0.2.0", "", {}, "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA=="],
|
|
246
246
|
|
package.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@iconify-json/material-symbols": "^1.2.39",
|
|
28
28
|
"@playwright/test": "^1.52.0",
|
|
29
|
-
"@tauri-apps/cli": "^2.
|
|
29
|
+
"@tauri-apps/cli": "^2.9.1",
|
|
30
30
|
"@types/node": "^22.15.3"
|
|
31
31
|
}
|
|
32
32
|
}
|
src-tauri/Cargo.toml
CHANGED
|
@@ -23,3 +23,12 @@ tauri-plugin-opener = "2"
|
|
|
23
23
|
serde = { version = "1", features = ["derive"] }
|
|
24
24
|
serde_json = "1"
|
|
25
25
|
|
|
26
|
+
[profile.dev]
|
|
27
|
+
incremental = true # Compile your binary in smaller steps.
|
|
28
|
+
|
|
29
|
+
[profile.release]
|
|
30
|
+
codegen-units = 1 # Allows LLVM to perform better optimization.
|
|
31
|
+
lto = true # Enables link-time-optimizations.
|
|
32
|
+
opt-level = "s" # Prioritizes small binary size. Use `3` if you prefer speed.
|
|
33
|
+
panic = "abort" # Higher performance by disabling panic handlers.
|
|
34
|
+
strip = true # Ensures debug symbols are removed.
|
src-tauri/gen/android/buildSrc/src/main/java/dev/pyrossh/website/kotlin/BuildTask.kt
CHANGED
|
@@ -21,7 +21,23 @@ open class BuildTask : DefaultTask() {
|
|
|
21
21
|
runTauriCli(executable)
|
|
22
22
|
} catch (e: Exception) {
|
|
23
23
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
24
|
+
// Try different Windows-specific extensions
|
|
25
|
+
val fallbacks = listOf(
|
|
26
|
+
"$executable.exe",
|
|
24
|
-
|
|
27
|
+
"$executable.cmd",
|
|
28
|
+
"$executable.bat",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
var lastException: Exception = e
|
|
32
|
+
for (fallback in fallbacks) {
|
|
33
|
+
try {
|
|
34
|
+
runTauriCli(fallback)
|
|
35
|
+
return
|
|
36
|
+
} catch (fallbackException: Exception) {
|
|
37
|
+
lastException = fallbackException
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
throw lastException
|
|
25
41
|
} else {
|
|
26
42
|
throw e;
|
|
27
43
|
}
|
src-tauri/tauri.conf.json
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"build": {
|
|
7
7
|
"devUrl": "http://localhost:4321",
|
|
8
8
|
"beforeDevCommand": "bun run dev --host",
|
|
9
|
-
"frontendDist": "../dist"
|
|
9
|
+
"frontendDist": "../dist",
|
|
10
|
+
"removeUnusedCommands": true
|
|
10
11
|
},
|
|
11
12
|
"app": {
|
|
12
13
|
"withGlobalTauri": true,
|
src/layouts/Base.astro
CHANGED
|
@@ -22,7 +22,10 @@ const image = "/favicon.png";
|
|
|
22
22
|
<html lang="en">
|
|
23
23
|
<head>
|
|
24
24
|
<meta charset="utf-8" />
|
|
25
|
+
<meta
|
|
26
|
+
name="viewport"
|
|
25
|
-
|
|
27
|
+
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
|
28
|
+
/>
|
|
26
29
|
<meta name="theme-color" content="#131618" />
|
|
27
30
|
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
|
|
28
31
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
|
@@ -63,6 +66,19 @@ const image = "/favicon.png";
|
|
|
63
66
|
navigation: auto; /* enabled! */
|
|
64
67
|
}
|
|
65
68
|
</style>
|
|
69
|
+
<script is:inline>
|
|
70
|
+
console.log(window.__TAURI__);
|
|
71
|
+
if (window.__TAURI__) {
|
|
72
|
+
console.log("Back key triggered");
|
|
73
|
+
window.__TAURI__.app.onBackButtonPress(() => {
|
|
74
|
+
if (window.history.length > 1) {
|
|
75
|
+
window.history.back();
|
|
76
|
+
return true; // Mark event as handled
|
|
77
|
+
}
|
|
78
|
+
return false; // Let the app close
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
66
82
|
<Header />
|
|
67
83
|
<Wrapper>
|
|
68
84
|
<main class:list={classname}>
|