website

#astro#js#html#css

git clone https://git.pyrossh.dev/website

木 Personal website of pyrossh. Built with astrojs, shiki, vite.


6f9e3f4 — pyrossh 2025-10-27T22:27:11+05:30
add android back handler

Generated files not shown: bun.lock

.gitignore CHANGED
@@ -56,3 +56,4 @@ dist-ssr
56
56
  *.njsproj
57
57
  *.sln
58
58
  *.sw?
59
+ target
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.8.1",
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
- runTauriCli("$executable.cmd")
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
- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
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}>