diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..1d22c6b
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml
new file mode 100644
index 0000000..dcca7ce
--- /dev/null
+++ b/.idea/jsonSchemas.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/mercury.iml b/.idea/mercury.iml
index 39cd9a1..4e641cc 100644
--- a/.idea/mercury.iml
+++ b/.idea/mercury.iml
@@ -10,5 +10,6 @@
+
\ No newline at end of file
diff --git a/src/components/Search.astro b/src/components/Search.astro
index 6b0c794..82dff35 100644
--- a/src/components/Search.astro
+++ b/src/components/Search.astro
@@ -234,6 +234,9 @@ const domain = Astro.url.host
// Initialize with default config
initSearch();
+
+ // Re-initialize when Astro's view transitions occur, this provides fix for SPA navigation
+ document.addEventListener('astro:page-load', initSearch);
}
\ No newline at end of file
diff --git a/src/config.ts b/src/config.ts
index 07d1f04..c8cd0eb 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -9,6 +9,7 @@ export const siteConfig = {
email: 'hi@mercury.info',
},
// features
+ spa: false, // enable single page application mode, this will enable navigation (with fade transitions) without reloading the page, and enable client-side routing
noClientJavaScript: false, // disable client-side javascript, this will:
// 1. disable most built-in client-side javascript from rendering (protected content component and umami still needs javascript to function, sorry)
// 2. the full text search will be redirected to a search engine
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index 055801a..e761380 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -19,6 +19,9 @@ interface Props {
ogImage?: string;
}
+import { ClientRouter } from "astro:transitions";
+const spaEnabled = siteConfig.spa
+
const noscript = siteConfig.noClientJavaScript
const statisticsEnabled = siteConfig.siteAnalytics.enabled
@@ -44,6 +47,8 @@ const { title = pageTitle, author = siteConfig.defaultAuthor.name,description =
{pageTitle}
+ {spaEnabled && }
+