From 61700b416c48bfa0a1fb226b78c16ba8933a0eda Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 20 Jun 2023 02:26:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E7=BA=BF=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E7=89=88-=E4=BC=98=E5=8C=96=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 1 + docs.md | 1 + locales/en_US.ts | 11 ++++ locales/zh_CN.ts | 10 +++ nuxt.config.ts | 8 ++- nuxt.node.config.ts | 8 ++- nuxt.siyuan.config.ts | 8 ++- nuxt.vercel.config.ts | 8 ++- package.json | 1 + pages/about.vue | 2 - pages/docs.vue | 46 ++++++++++++++ pages/share.vue | 144 ++++++++++++++++++++++++++++++++++++++++-- pnpm-lock.yaml | 41 ++++++++---- siyuan/topbar.ts | 2 +- 14 files changed, 266 insertions(+), 25 deletions(-) create mode 100644 pages/docs.vue diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e968eee9..a2f90e09 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -20,6 +20,7 @@ module.exports = { semi: "off", quotes: "off", "no-undef": "off", + "no-extra-boolean-cast":"off", "vue/multi-word-component-names": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-var-requires": "off", diff --git a/docs.md b/docs.md index 7813aae3..b5d36269 100644 --- a/docs.md +++ b/docs.md @@ -3,6 +3,7 @@ ## SSR ``` +http://localhost:3000/share?id=aaa&origin=ddd&isSsr=false http://localhost:3000/s/20230411223531-n81ogbh ``` diff --git a/locales/en_US.ts b/locales/en_US.ts index 55f4141b..7f80c148 100644 --- a/locales/en_US.ts +++ b/locales/en_US.ts @@ -68,4 +68,15 @@ export default { "siyuan.theme.light": "Light theme", "siyuan.theme.dark": "Dark theme", "siyuan.theme.select": "Select theme", + "share.to.web": "Share to web", + "share.to.web.before.tip": "Publish and share link to everyone", + "share.to.web.after.tip": "Anyone with the link can view", + "share.copy.web.link": "Copy web link", + "share.show.link.option": "Show link options", + "share.other.option": "Set other options here", + "share.other.option.link.expires": "Allow link expires", + "share.link.expires.time.placeholder": + "If this feature is enabled, you can set the link expiration time, unit/second, and support up to 7 days", + "share.help": "Learn about sharing", + "share.copy.link": "Copy link", } diff --git a/locales/zh_CN.ts b/locales/zh_CN.ts index fa211b91..d89db60f 100644 --- a/locales/zh_CN.ts +++ b/locales/zh_CN.ts @@ -68,4 +68,14 @@ export default { "siyuan.theme.light": "浅色主题", "siyuan.theme.dark": "暗色主题", "siyuan.theme.select": "请选择主题", + "share.to.web": "在线分享", + "share.to.web.before.tip": "向所有人发布和共享链接", + "share.to.web.after.tip": "知道链接的任何人都可以查看", + "share.copy.web.link": "复制网页链接", + "share.show.link.option": "显示链接选项", + "share.other.option": "在此处设置其他选项", + "share.other.option.link.expires": "允许链接过期", + "share.link.expires.time.placeholder": "若开启此功能,可设置链接过期时间,单位/秒,若开启最多支持7天", + "share.help": "了解共享", + "share.copy.link": "复制链接", } diff --git a/nuxt.config.ts b/nuxt.config.ts index 0ab084cc..bd78352f 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -20,7 +20,7 @@ export default defineNuxtConfig({ }, devtools: { - enabled: true, + enabled: false, }, // build modules @@ -51,6 +51,12 @@ export default defineNuxtConfig({ plugins: [], }, + elementPlus: { + icon: "ElIcon", + importStyle: "scss", + themes: ["dark"], + }, + css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"], app: { diff --git a/nuxt.node.config.ts b/nuxt.node.config.ts index 0ab084cc..bd78352f 100644 --- a/nuxt.node.config.ts +++ b/nuxt.node.config.ts @@ -20,7 +20,7 @@ export default defineNuxtConfig({ }, devtools: { - enabled: true, + enabled: false, }, // build modules @@ -51,6 +51,12 @@ export default defineNuxtConfig({ plugins: [], }, + elementPlus: { + icon: "ElIcon", + importStyle: "scss", + themes: ["dark"], + }, + css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"], app: { diff --git a/nuxt.siyuan.config.ts b/nuxt.siyuan.config.ts index 6faa16a1..483bfc6e 100644 --- a/nuxt.siyuan.config.ts +++ b/nuxt.siyuan.config.ts @@ -20,7 +20,7 @@ export default defineNuxtConfig({ }, devtools: { - enabled: true, + enabled: false, }, // build modules @@ -58,6 +58,12 @@ export default defineNuxtConfig({ plugins: [], }, + elementPlus: { + icon: "ElIcon", + importStyle: "scss", + themes: ["dark"], + }, + // https://nuxt.com/docs/guide/going-further/custom-routing#hash-mode-spa ssr: false, router: { diff --git a/nuxt.vercel.config.ts b/nuxt.vercel.config.ts index 0ab084cc..bd78352f 100644 --- a/nuxt.vercel.config.ts +++ b/nuxt.vercel.config.ts @@ -20,7 +20,7 @@ export default defineNuxtConfig({ }, devtools: { - enabled: true, + enabled: false, }, // build modules @@ -51,6 +51,12 @@ export default defineNuxtConfig({ plugins: [], }, + elementPlus: { + icon: "ElIcon", + importStyle: "scss", + themes: ["dark"], + }, + css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"], app: { diff --git a/package.json b/package.json index f4e69c2b..81605476 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@terwer/eslint-config-custom": "^1.3.6", "@types/node": "^18.16.18", "@vueuse/nuxt": "^10.2.0", + "@vueuse/router": "^10.2.0", "esbuild-plugin-copy": "^2.1.1", "esbuild-style-plugin": "^1.6.2", "minimist": "^1.2.8", diff --git a/pages/about.vue b/pages/about.vue index b051b5b0..d06989db 100644 --- a/pages/about.vue +++ b/pages/about.vue @@ -26,8 +26,6 @@ useSeoMeta(seoMeta)

熟悉Java、Spring、Spring Cloud、Vue、React、Python 的拼写

了解 Linux、windows、macOS 的开关机方式

精通 Git 的 pull 和 push,并注册了 GitHub 帐号刷了一些 star

-

微信公众号:架构设计漫谈

-

✉️ 联系

diff --git a/pages/docs.vue b/pages/docs.vue new file mode 100644 index 00000000..f0bb1859 --- /dev/null +++ b/pages/docs.vue @@ -0,0 +1,46 @@ + + + + + + + diff --git a/pages/share.vue b/pages/share.vue index fea414c6..8b769423 100644 --- a/pages/share.vue +++ b/pages/share.vue @@ -1,9 +1,14 @@ - + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a12561c4..608bcff7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,10 +45,10 @@ devDependencies: version: 3.2.0 '@nuxtjs/i18n': specifier: 8.0.0-beta.12 - version: 8.0.0-beta.12(vue@3.3.4) + version: 8.0.0-beta.12(vue-router@4.2.2)(vue@3.3.4) '@nuxtjs/i18n-edge': specifier: 8.0.0-beta.12-28113576.7bc33c3 - version: 8.0.0-beta.12-28113576.7bc33c3(vue@3.3.4) + version: 8.0.0-beta.12-28113576.7bc33c3(vue-router@4.2.2)(vue@3.3.4) '@terwer/esbuild-config-custom': specifier: ^1.0.12 version: 1.0.12(@types/minimist@1.2.2)(dotenv@16.3.1)(esbuild-plugin-copy@2.1.1)(esbuild-plugin-d.ts@1.1.0)(esbuild-plugin-ifdef@1.0.1)(esbuild-plugin-inline-image@0.0.9)(esbuild-plugin-vue3@0.3.2)(esbuild-style-plugin@1.6.2)(esbuild@0.17.19)(minimist@1.2.8)(rimraf@4.4.1)(stylus@0.59.0) @@ -61,6 +61,9 @@ devDependencies: '@vueuse/nuxt': specifier: ^10.2.0 version: 10.2.0(nuxt@3.5.3)(vue@3.3.4) + '@vueuse/router': + specifier: ^10.2.0 + version: 10.2.0(vue-router@4.2.2)(vue@3.3.4) esbuild-plugin-copy: specifier: ^2.1.1 version: 2.1.1(esbuild@0.17.19) @@ -968,7 +971,7 @@ packages: vue-i18n: 9.3.0-beta.19(vue@3.3.4) dev: true - /@intlify/vue-router-bridge@0.8.0(vue@3.3.4): + /@intlify/vue-router-bridge@0.8.0(vue-router@4.2.2)(vue@3.3.4): resolution: {integrity: sha512-CNxOgvyQcRhtGmRrksicL+HGjDijXtz+J/x04C/RslZ74CFdZkxjCe8MABkeD3xr+ry8G8tCm2nV2hLjZbynQw==} engines: {node: '>= 12'} hasBin: true @@ -983,6 +986,7 @@ packages: optional: true dependencies: vue-demi: 0.13.11(vue@3.3.4) + vue-router: 4.2.2(vue@3.3.4) transitivePeerDependencies: - vue dev: true @@ -1416,7 +1420,7 @@ packages: - supports-color dev: true - /@nuxtjs/i18n-edge@8.0.0-beta.12-28113576.7bc33c3(vue@3.3.4): + /@nuxtjs/i18n-edge@8.0.0-beta.12-28113576.7bc33c3(vue-router@4.2.2)(vue@3.3.4): resolution: {integrity: sha512-O7KoGB7VMj/P3nHTY4VdKDBoAD351juC4cLH6N/FaSIM12cMMplKGUk7eoIZ+jJY9fq5azE+jbp7e+Bg3KF8yw==} engines: {node: ^14.16.0 || >=16.11.0} dependencies: @@ -1441,7 +1445,7 @@ packages: unplugin: 1.3.1 unstorage: 1.6.1 vue-i18n: 9.3.0-beta.19(vue@3.3.4) - vue-i18n-routing: 0.13.0(vue-i18n@9.3.0-beta.19)(vue@3.3.4) + vue-i18n-routing: 0.13.0(vue-i18n@9.3.0-beta.19)(vue-router@4.2.2)(vue@3.3.4) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -1461,7 +1465,7 @@ packages: - vue-router dev: true - /@nuxtjs/i18n@8.0.0-beta.12(vue@3.3.4): + /@nuxtjs/i18n@8.0.0-beta.12(vue-router@4.2.2)(vue@3.3.4): resolution: {integrity: sha512-f149HXPyk4RJZul3ThWo4YVN7WmL3scge8UZx08cxAiKjhoCIoHySKxX05CwAu0v7sfYxeYeP+qCeQyGaBErpQ==} engines: {node: ^14.16.0 || >=16.11.0} dependencies: @@ -1486,7 +1490,7 @@ packages: unplugin: 1.3.1 unstorage: 1.6.1 vue-i18n: 9.3.0-beta.17(vue@3.3.4) - vue-i18n-routing: 0.13.0(vue-i18n@9.3.0-beta.17)(vue@3.3.4) + vue-i18n-routing: 0.13.0(vue-i18n@9.3.0-beta.17)(vue-router@4.2.2)(vue@3.3.4) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -2355,6 +2359,19 @@ packages: - vue dev: true + /@vueuse/router@10.2.0(vue-router@4.2.2)(vue@3.3.4): + resolution: {integrity: sha512-vks2xHCZWeKaFWfgfmrzi6kJ0cTHvRCHzPUzmjvfbmzDrB2YOS1ymCPjfu1LH3E82H+RyebaSRhTeoDc3AsEFw==} + peerDependencies: + vue-router: '>=4.0.0-rc.1' + dependencies: + '@vueuse/shared': 10.2.0(vue@3.3.4) + vue-demi: 0.14.5(vue@3.3.4) + vue-router: 4.2.2(vue@3.3.4) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + dev: true + /@vueuse/shared@10.2.0(vue@3.3.4): resolution: {integrity: sha512-dIeA8+g9Av3H5iF4NXR/sft4V6vys76CpZ6hxwj8eMXybXk2WRl3scSsOVi+kQ9SX38COR7AH7WwY83UcuxbSg==} dependencies: @@ -8635,7 +8652,7 @@ packages: - supports-color dev: true - /vue-i18n-routing@0.13.0(vue-i18n@9.3.0-beta.17)(vue@3.3.4): + /vue-i18n-routing@0.13.0(vue-i18n@9.3.0-beta.17)(vue-router@4.2.2)(vue@3.3.4): resolution: {integrity: sha512-d/WVAZKo68blFqv6BPxFrGy530+FgvXsYVMbuvaICaoFO2CUxuaszF4vPCzCPIi9T68WRzWeUMTUb7vmv2SLyQ==} engines: {node: '>= 14.6'} peerDependencies: @@ -8658,14 +8675,15 @@ packages: dependencies: '@intlify/shared': 9.3.0-beta.19 '@intlify/vue-i18n-bridge': 0.8.0(vue-i18n@9.3.0-beta.17) - '@intlify/vue-router-bridge': 0.8.0(vue@3.3.4) + '@intlify/vue-router-bridge': 0.8.0(vue-router@4.2.2)(vue@3.3.4) ufo: 1.1.2 vue: 3.3.4 vue-demi: 0.13.11(vue@3.3.4) vue-i18n: 9.3.0-beta.17(vue@3.3.4) + vue-router: 4.2.2(vue@3.3.4) dev: true - /vue-i18n-routing@0.13.0(vue-i18n@9.3.0-beta.19)(vue@3.3.4): + /vue-i18n-routing@0.13.0(vue-i18n@9.3.0-beta.19)(vue-router@4.2.2)(vue@3.3.4): resolution: {integrity: sha512-d/WVAZKo68blFqv6BPxFrGy530+FgvXsYVMbuvaICaoFO2CUxuaszF4vPCzCPIi9T68WRzWeUMTUb7vmv2SLyQ==} engines: {node: '>= 14.6'} peerDependencies: @@ -8688,11 +8706,12 @@ packages: dependencies: '@intlify/shared': 9.3.0-beta.19 '@intlify/vue-i18n-bridge': 0.8.0(vue-i18n@9.3.0-beta.19) - '@intlify/vue-router-bridge': 0.8.0(vue@3.3.4) + '@intlify/vue-router-bridge': 0.8.0(vue-router@4.2.2)(vue@3.3.4) ufo: 1.1.2 vue: 3.3.4 vue-demi: 0.13.11(vue@3.3.4) vue-i18n: 9.3.0-beta.19(vue@3.3.4) + vue-router: 4.2.2(vue@3.3.4) dev: true /vue-i18n@9.3.0-beta.17(vue@3.3.4): diff --git a/siyuan/topbar.ts b/siyuan/topbar.ts index c209d2d7..387edac1 100644 --- a/siyuan/topbar.ts +++ b/siyuan/topbar.ts @@ -46,7 +46,7 @@ export function initTopbar(pluginInstance: SiyuanBlog) { }) topBarElement.addEventListener("click", async () => { - const sharePage = "/plugins/siyuan-blog/#/share" + const sharePage = "/plugins/siyuan-blog/#/share?id=" + PageUtil.getPageId() + "&origin=" + getAvailableOrigin()+"&isSsr=false" showPopView(pluginInstance, topBarElement, sharePage) })