diff --git a/src/components/Comments/Waline.astro b/src/components/Comments/Waline.astro
index 564aa8f..8314bd7 100644
--- a/src/components/Comments/Waline.astro
+++ b/src/components/Comments/Waline.astro
@@ -17,9 +17,6 @@ const {
imageUploader = false,
} = themeConfig.comment?.waline ?? {}
-// Get current path
-const currentPath = Astro.url.pathname
-
// Get the language code of Waline
function getWalineLang(currentPath: string, defaultLocale: string): string {
// Extract language code from path
@@ -32,7 +29,7 @@ function getWalineLang(currentPath: string, defaultLocale: string): string {
}
// Get Waline language and generate configuration
-const walineLang = getWalineLang(currentPath, defaultLocale)
+const walineLang = getWalineLang(Astro.url.pathname, defaultLocale)
const walineConfigJson = JSON.stringify({
serverURL,
lang: walineLang,
@@ -49,8 +46,7 @@ const walineConfigJson = JSON.stringify({
>
-
-
+
-
+