diff --git a/blog/pnpm-lock.yaml b/blog/pnpm-lock.yaml index 98e99f8b..dd0edd93 100644 --- a/blog/pnpm-lock.yaml +++ b/blog/pnpm-lock.yaml @@ -17,9 +17,6 @@ dependencies: nprogress: specifier: ^0.2.0 version: 0.2.0 - shiki: - specifier: 1.0.0-rc.0 - version: 1.0.0-rc.0 vue: specifier: ^3.4.15 version: 3.4.18(typescript@5.3.3) @@ -33,7 +30,7 @@ dependencies: devDependencies: '@antfu/eslint-config': specifier: ^2.6.4 - version: 2.6.4(@vue/compiler-sfc@3.4.18)(eslint@8.56.0)(typescript@5.3.3) + version: 2.6.4(@vue/compiler-sfc@3.4.19)(eslint@8.56.0)(typescript@5.3.3) '@iconify/json': specifier: ^2.2.180 version: 2.2.182 @@ -127,6 +124,9 @@ devDependencies: prompts: specifier: ^2.4.2 version: 2.4.2 + shiki: + specifier: ^1.0.0-rc.0 + version: 1.1.2 typescript: specifier: ^5.3.3 version: 5.3.3 @@ -138,7 +138,7 @@ devDependencies: version: 0.17.5(@vueuse/core@10.7.2) unplugin-icons: specifier: ^0.18.5 - version: 0.18.5(@vue/compiler-sfc@3.4.18) + version: 0.18.5(@vue/compiler-sfc@3.4.19) unplugin-vue-components: specifier: ^0.26.0 version: 0.26.0(vue@3.4.18) @@ -153,7 +153,7 @@ devDependencies: version: 0.8.3(vite@5.1.1) vite-plugin-pages: specifier: ^0.32.0 - version: 0.32.0(@vue/compiler-sfc@3.4.18)(vite@5.1.1) + version: 0.32.0(@vue/compiler-sfc@3.4.19)(vite@5.1.1) vite-ssg: specifier: ^0.23.6 version: 0.23.6(vite@5.1.1)(vue-router@4.2.5)(vue@3.4.18) @@ -176,7 +176,7 @@ packages: '@jridgewell/trace-mapping': 0.3.20 dev: true - /@antfu/eslint-config@2.6.4(@vue/compiler-sfc@3.4.18)(eslint@8.56.0)(typescript@5.3.3): + /@antfu/eslint-config@2.6.4(@vue/compiler-sfc@3.4.19)(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-dMD/QC5KWS1OltdpKLhfZM7W7y7zils85opk8d4lyNr7yn0OFjZs7eMYtcC6DrrN2kQ1JrFvBM7uB0QdWn5PUQ==} hasBin: true peerDependencies: @@ -230,7 +230,7 @@ packages: eslint-plugin-vitest: 0.3.22(@typescript-eslint/eslint-plugin@6.21.0)(eslint@8.56.0)(typescript@5.3.3) eslint-plugin-vue: 9.21.1(eslint@8.56.0) eslint-plugin-yml: 1.12.2(eslint@8.56.0) - eslint-processor-vue-blocks: 0.1.1(@vue/compiler-sfc@3.4.18)(eslint@8.56.0) + eslint-processor-vue-blocks: 0.1.1(@vue/compiler-sfc@3.4.19)(eslint@8.56.0) globals: 13.24.0 jsonc-eslint-parser: 2.4.0 local-pkg: 0.5.0 @@ -1232,10 +1232,6 @@ packages: dev: true optional: true - /@shikijs/core@1.0.0-rc.0: - resolution: {integrity: sha512-j/7te+hvEYlQTvk/wPoA+1rOklZTz8QuyqVvV81KcEN/g1WXKVnqp9WZ7jFuv0ZVLqBtDx/V8viRDROJniyMLA==} - dev: false - /@shikijs/core@1.1.2: resolution: {integrity: sha512-ERVzNQz88ZkDqUpWeC57Kp+Kmx5RjqeDBR1M8AGWGom4yrkITiTfXCGmjchlDSw12MhDTuPYR4HVFW8uT61RaQ==} dev: true @@ -3147,13 +3143,13 @@ packages: - supports-color dev: true - /eslint-processor-vue-blocks@0.1.1(@vue/compiler-sfc@3.4.18)(eslint@8.56.0): + /eslint-processor-vue-blocks@0.1.1(@vue/compiler-sfc@3.4.19)(eslint@8.56.0): resolution: {integrity: sha512-9+dU5lU881log570oBwpelaJmOfOzSniben7IWEDRYQPPWwlvaV7NhOtsTuUWDqpYT+dtKKWPsgz4OkOi+aZnA==} peerDependencies: '@vue/compiler-sfc': ^3.3.0 eslint: ^8.50.0 dependencies: - '@vue/compiler-sfc': 3.4.18 + '@vue/compiler-sfc': 3.4.19 eslint: 8.56.0 dev: true @@ -4954,12 +4950,6 @@ packages: engines: {node: '>=8'} dev: true - /shiki@1.0.0-rc.0: - resolution: {integrity: sha512-aeEjERF5qeK+YChgEv94LOjcEcjZBLd0acPaHginz0N8FvyTn2iSLhO0AtoqfvlZ8cWGCJRKLWtDApnQVQB6/Q==} - dependencies: - '@shikijs/core': 1.0.0-rc.0 - dev: false - /shiki@1.1.2: resolution: {integrity: sha512-qNzFwTv5uhEDNUIwp7wHjsrffVeLbmOgWnM5mZZhoiz7G2qAUvqVfUzuWfieD45/YAKipzCtdV9SndacKtABow==} dependencies: @@ -5382,7 +5372,7 @@ packages: - rollup dev: true - /unplugin-icons@0.18.5(@vue/compiler-sfc@3.4.18): + /unplugin-icons@0.18.5(@vue/compiler-sfc@3.4.19): resolution: {integrity: sha512-KVNAohXbZ7tVcG1C3p6QaC7wU9Qrj7etv4XvsMMJAxr5LccQZ+Iuv5LOIv/7GtqXaGN1BuFCqRO1ErsHEgEXdQ==} peerDependencies: '@svgr/core': '>=7.0.0' @@ -5405,7 +5395,7 @@ packages: '@antfu/install-pkg': 0.3.1 '@antfu/utils': 0.7.7 '@iconify/utils': 2.1.22 - '@vue/compiler-sfc': 3.4.18 + '@vue/compiler-sfc': 3.4.19 debug: 4.3.4 kolorist: 1.8.0 local-pkg: 0.5.0 @@ -5542,7 +5532,7 @@ packages: - supports-color dev: true - /vite-plugin-pages@0.32.0(@vue/compiler-sfc@3.4.18)(vite@5.1.1): + /vite-plugin-pages@0.32.0(@vue/compiler-sfc@3.4.19)(vite@5.1.1): resolution: {integrity: sha512-OxS3n0zUo5wsfgNCAuw2FiG/KD1ipgQV+2Flst4RyeI2iPv+m0YueVq+nx41k5NOWJj/zhqEas6I0b7HXveXjA==} peerDependencies: '@vue/compiler-sfc': ^2.7.0 || ^3.0.0 @@ -5552,7 +5542,7 @@ packages: optional: true dependencies: '@types/debug': 4.1.12 - '@vue/compiler-sfc': 3.4.18 + '@vue/compiler-sfc': 3.4.19 debug: 4.3.4 deep-equal: 2.2.3 extract-comments: 1.1.0 diff --git a/blog/src/alomerry/index.ts b/blog/src/alomerry/index.ts index 8745c926..b138734e 100644 --- a/blog/src/alomerry/index.ts +++ b/blog/src/alomerry/index.ts @@ -8,8 +8,8 @@ export function formatDateByAlomerry(d: string | Date, onlyDate = true) { const DISPLAY_COMMENT = "display_comment"; -export const ALOMERRY_BLOG_DOMAIN="blog.alomerry.com" -export const ALOMERRY_BLOG_WALINE_DOMAIN="https://waline-blog.alomerry.com" +export const ALOMERRY_BLOG_DOMAIN = "blog.alomerry.com"; +export const ALOMERRY_BLOG_WALINE_DOMAIN = "https://waline-blog.alomerry.com"; export function displayComment(): boolean { return getLocalStorage(DISPLAY_COMMENT) === "true"; @@ -20,9 +20,11 @@ export function setDefaultDisplayComment(displayComment: boolean) { } function getLocalStorage(key: string): any { - return localStorage.getItem(key); + return typeof localStorage === "undefined" ? null : localStorage.getItem(key); } function setLocalStorage(key: string, value: string) { - return localStorage.setItem(key, value); + if (typeof localStorage !== "undefined") { + localStorage?.setItem(key, value); + } }